You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Stefan Seelmann (JIRA)" <ji...@apache.org> on 2017/03/13 20:12:41 UTC

[jira] [Commented] (DIRAPI-292) Add static Instances in SyntaxChecker classes to ease their use

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

Stefan Seelmann commented on DIRAPI-292:
----------------------------------------

Usage of "BooleanSyntaxChecker.INSTANCE" in "SchemaManagerDelTest" (changed in http://svn.apache.org/viewvc?rev=1786492&view=rev) makes the "testDeleteNonExistingSyntaxChecker" test fail randomly. When removing the @RunWith(ConcurrentJunitRunner.class) and @Concurrency() annotations it fails always. Seems the BooleanSyntaxChecker gets locked:

{noformat}
java.lang.UnsupportedOperationException: ERR_04441 Cannot modify the SchemaObject 0.1.1, it has been locked
	at org.apache.directory.api.ldap.model.schema.AbstractSchemaObject.setOid(AbstractSchemaObject.java:177)
	at org.apache.directory.api.ldap.schema.loader.SchemaManagerDelTest.testDeleteNonExistingSyntaxChecker(SchemaManagerDelTest.java:1055)
{noformat}


> 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)