[ 
https://issues.apache.org/jira/browse/DIRAPI-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15923470#comment-15923470
 ] 

Emmanuel Lecharny commented on DIRAPI-292:
------------------------------------------

Reconsidering the {{BooleanSyntaxChecker}} class, it makes no sense to have a 
mutable version. The only reason the test is failing is because the test tries 
to set a different {{OID}}, instead of creating a new {{SyntaxChecker}} class.

The problem is related to the other ticket I opened last week-end : 
https://issues.apache.org/jira/browse/DIRAPI-291. The reason we have those 
class mutable is because we can load them dynamically from serialized Java 
classes in apacheds (that makes it extensible)

We have a mutable version of all the schema objects (AT, OC, Syntax, etc), and 
an immutable version. Except that we can't use the immutable version. We should 
only have immutable versions. For those {{SyntaxCheckers}} that can change (ie, 
the one with regexp), we should provide a constructor that takes a regexp as a 
parameter.

The {{setOid()}} method should not be visible at all, alas it's part of the 
{{SchemaObject}} interface. I think we should review our options for 2.0...

> Add static Instances in SyntaxChecker classes to ease their use
> ---------------------------------------------------------------
>
>                 Key: DIRAPI-292
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-292
>             Project: Directory Client API
>          Issue Type: Improvement
>    Affects Versions: 1.0.0-RC2
>            Reporter: Emmanuel Lecharny
>             Fix For: 1.0.0-RC3
>
>
> We don't have static instance of {{SyntaxChecker}}s. This is annoying, 
> because we have to dynamically instanciate them when we need to validate a 
> value. Adding something like :
> {noformat}
> public class BooleanSyntaxChecker extends SyntaxChecker
> {
>     /** A logger for this class */
>     private static final Logger LOG = LoggerFactory.getLogger( 
> BooleanSyntaxChecker.class );
>     
>     /**
>      * A public instance of this SyntaxChecker
>      */
>     public static final BooleanSyntaxChecker INSTANCE = new 
> BooleanSyntaxChecker();
> ...
> {noformat}
> would help.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to