directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1083422 - in /directory/shared/branches/akarasulu/ldap/model/src: main/antlr/ main/java/org/apache/directory/shared/ldap/model/schema/ main/java/org/apache/directory/shared/ldap/model/schema/parsers/ test/java/org/apache/directory/shared/l...
Date Sun, 20 Mar 2011 12:37:53 GMT
Author: akarasulu
Date: Sun Mar 20 12:37:52 2011
New Revision: 1083422

URL: http://svn.apache.org/viewvc?rev=1083422&view=rev
Log:
devised new workaround for covariant return bug in JDK: model now compiles and tests pass

Modified:
    directory/shared/branches/akarasulu/ldap/model/src/main/antlr/schema.g
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractNormalizer.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSyntaxChecker.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRuleImpl.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableNormalizer.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSyntaxChecker.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
    directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/MatchingRuleDescriptionSchemaParser.java
    directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/LdapSyntaxDescriptionSchemaParserTest.java
    directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/MatchingRuleDescriptionSchemaParserTest.java

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/antlr/schema.g?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/antlr/schema.g (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/antlr/schema.g Sun Mar 20 12:37:52
2011
@@ -29,8 +29,10 @@ import java.util.Map;
 import org.apache.directory.shared.ldap.model.schema.parsers.LdapComparatorDescription;
 import org.apache.directory.shared.ldap.model.schema.DITContentRule;
 import org.apache.directory.shared.ldap.model.schema.DITStructureRule;
-import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
-import org.apache.directory.shared.ldap.model.schema.MatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRuleImpl;
 import org.apache.directory.shared.ldap.model.schema.MatchingRuleUse;
 import org.apache.directory.shared.ldap.model.schema.NameForm;
 import org.apache.directory.shared.ldap.model.schema.parsers.NormalizerDescription;
@@ -474,13 +476,13 @@ attributeTypeDescription returns [Attrib
      *    extensions WSP RPAREN      ; extensions
      * </pre>
     */
-ldapSyntaxDescription returns [LdapSyntax ldapSyntax]
+ldapSyntaxDescription returns [MutableLdapSyntax ldapSyntax]
     {
         matchedProduction( "ldapSyntaxDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
-    ( oid:STARTNUMERICOID { ldapSyntax = new LdapSyntax(numericoid(oid.getText())); } )
+    ( oid:STARTNUMERICOID { ldapSyntax = new MutableLdapSyntaxImpl(numericoid(oid.getText()));
} )
     (
         ( name:NAME { et.track("NAME", name); ldapSyntax.setNames(qdescrs(name.getText()));
} )
         |
@@ -511,13 +513,13 @@ ldapSyntaxDescription returns [LdapSynta
      *    extensions WSP RPAREN      ; extensions
      * </pre>
     */
-matchingRuleDescription returns [MatchingRule matchingRule]
+matchingRuleDescription returns [MutableMatchingRule matchingRule]
     {
         matchedProduction( "matchingRuleDescription()" );
         ElementTracker et = new ElementTracker();
     }
     :
-    ( oid:STARTNUMERICOID { matchingRule = new MatchingRule(numericoid(oid.getText())); }
)
+    ( oid:STARTNUMERICOID { matchingRule = new MutableMatchingRuleImpl(numericoid(oid.getText()));
} )
     (
         ( name:NAME { et.track("NAME", name); matchingRule.setNames(qdescrs(name.getText()));
} )
         |

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractNormalizer.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractNormalizer.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractNormalizer.java
Sun Mar 20 12:37:52 2011
@@ -80,7 +80,36 @@ public abstract class AbstractNormalizer
     }
 
     
-    public AbstractNormalizer copy()
+    /**
+     * {@inheritDoc}
+     */
+    public Normalizer copy()
+    {
+        return new AbstractNormalizer( oid )
+        {
+            private static final long serialVersionUID = 6617568248114910428L;
+
+
+            @Override
+            public String normalize( String value ) throws LdapException
+            {
+                return normalize( value );
+            }
+            
+        
+            @Override
+            public Value<?> normalize( Value<?> value ) throws LdapException
+            {
+                return normalize( value );
+            }
+        };
+    }
+    
+
+    /**
+     * {@inheritDoc}
+     */
+    public MutableNormalizer copyMutable()
     {
         return new AbstractNormalizer( oid )
         {

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSyntaxChecker.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSyntaxChecker.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSyntaxChecker.java
Sun Mar 20 12:37:52 2011
@@ -57,7 +57,10 @@ public abstract class AbstractSyntaxChec
     }
     
     
-    public AbstractSyntaxChecker copy()
+    /**
+     * {@inheritDoc}
+     */
+    public SyntaxChecker copy()
     {
         return new AbstractSyntaxChecker()
         {
@@ -71,16 +74,28 @@ public abstract class AbstractSyntaxChec
         };
     }
 
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.model.schema.SyntaxChecker#isValidSyntax(java.lang.Object)
+    
+    /**
+     * {@inheritDoc}
      */
+    public MutableSyntaxChecker copyMutable()
+    {
+        return new AbstractSyntaxChecker()
+        {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public boolean isValidSyntax( Object value )
+            {
+                return this.isValidSyntax( value );
+            }
+        };
+    }
+    
+
     public abstract boolean isValidSyntax( Object value );
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.model.schema.SyntaxChecker#assertSyntax(java.lang.Object)
-     */
     public void assertSyntax( Object value ) throws LdapException
     {
         if ( !isValidSyntax( value ) )

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
Sun Mar 20 12:37:52 2011
@@ -1589,6 +1589,15 @@ public class AttributeType extends Abstr
     /**
      * {@inheritDoc}
      */
+    public AttributeType copyMutable()
+    {
+        return copy();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public void clear()
     {
         // Clear the common elements

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java
Sun Mar 20 12:37:52 2011
@@ -115,8 +115,6 @@ import org.apache.directory.shared.ldap.
  * @see DescriptionUtils#getDescription(DITContentRule)
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-// super.hashCode is final
-@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
 public class DITContentRule extends AbstractMutableSchemaObject
 {
     private static final long serialVersionUID = 1L;
@@ -634,6 +632,15 @@ public class DITContentRule extends Abst
         return objectType + " " + DescriptionUtils.getDescription( this );
     }
 
+    
+    /**
+     * {@inheritDoc}
+     */
+    public DITContentRule copyMutable()
+    {
+        return copy();
+    }
+    
 
     /**
      * Copy a DITContentRule
@@ -697,7 +704,6 @@ public class DITContentRule extends Abst
      * @see Object#equals(Object)
      */
     @Override
-    @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java
Sun Mar 20 12:37:52 2011
@@ -80,8 +80,6 @@ import org.apache.directory.shared.util.
  * @see DescriptionUtils#getDescription(DITStructureRule)
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-// super.hashCode is final
-@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
 public class DITStructureRule extends AbstractMutableSchemaObject
 {
     private static final long serialVersionUID = 1L;
@@ -233,6 +231,15 @@ public class DITStructureRule extends Ab
     /**
      * {@inheritDoc}
      */
+    public DITStructureRule copyMutable()
+    {
+        return copy();
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
     public DITStructureRule copy()
     {
         DITStructureRule copy = new DITStructureRule( ruleId );
@@ -259,8 +266,6 @@ public class DITStructureRule extends Ab
      * {@inheritDoc}
      */
     @Override
-    @SuppressWarnings("PMD.UnusedLocalVariable")
-    // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
Sun Mar 20 12:37:52 2011
@@ -39,5 +39,8 @@ public interface MatchingRule extends Sc
     Normalizer getNormalizer();
 
 
+    /**
+     * {@inheritDoc}
+     */
     MatchingRule copy();
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java
Sun Mar 20 12:37:52 2011
@@ -84,8 +84,6 @@ import org.apache.directory.shared.ldap.
  *      [SYNTAXES]</a>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-// super.hashCode is final
-@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
 public class MatchingRuleUse extends AbstractMutableSchemaObject
 {
     private static final long serialVersionUID = 1L;
@@ -253,6 +251,15 @@ public class MatchingRuleUse extends Abs
 
 
     /**
+     * {@inheritDoc}
+     */
+    public MatchingRuleUse copyMutable()
+    {
+        return copy();
+    }
+    
+    
+    /**
      * Copy an MatchingRuleUse
      */
     public MatchingRuleUse copy()
@@ -282,7 +289,6 @@ public class MatchingRuleUse extends Abs
      * @see Object#equals(Object)
      */
     @Override
-    @SuppressWarnings("PMD.UnusedLocalVariable") // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntax.java
Sun Mar 20 12:37:52 2011
@@ -46,7 +46,13 @@ public interface MutableLdapSyntax exten
     /**
      * {@inheritDoc}
      */
-    MutableLdapSyntax copy();
+    MutableLdapSyntax copyMutable();
+
+
+    /**
+     * {@inheritDoc}
+     */
+    LdapSyntax copy();
 
 
     /**

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLdapSyntaxImpl.java
Sun Mar 20 12:37:52 2011
@@ -216,13 +216,30 @@ public class MutableLdapSyntaxImpl exten
     }
 
 
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.model.schema.LdapSyntax#copy()
+    /**
+     * {@inheritDoc}
      */
-    /* (non-Javadoc)
-     * @see org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax#copy()
+    public LdapSyntax copy()
+    {
+        MutableLdapSyntaxImpl copy = new MutableLdapSyntaxImpl( oid );
+
+        // Copy the SchemaObject common data
+        copy.copy( this );
+
+        // Copy the HR flag
+        copy.isHumanReadable = isHumanReadable;
+
+        // All the references to other Registries object are set to null.
+        copy.syntaxChecker = null;
+
+        return copy;
+    }
+
+
+    /**
+     * {@inheritDoc}
      */
-    public MutableLdapSyntaxImpl copy()
+    public MutableLdapSyntax copyMutable()
     {
         MutableLdapSyntaxImpl copy = new MutableLdapSyntaxImpl( oid );
 

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObject.java
Sun Mar 20 12:37:52 2011
@@ -27,13 +27,18 @@ package org.apache.directory.shared.ldap
  */
 public interface MutableLoadableSchemaObject extends LoadableSchemaObject, MutableSchemaObject
 {
+    /**
+     * {@inheritDoc}
+     */
     LoadableSchemaObject copy();
     
+    
     /**
      * {@inheritDoc}
      */
     MutableLoadableSchemaObject copyMutable();
     
+    
     /**
      * Stores some bytecode representing the compiled Java class for this
      * SchemaObject instance.

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableLoadableSchemaObjectImpl.java
Sun Mar 20 12:37:52 2011
@@ -141,6 +141,15 @@ public abstract class MutableLoadableSch
         return null;
     }
 
+    
+    /**
+     * {@inheritDoc}
+     */
+    public MutableLoadableSchemaObject copyMutable()
+    {
+        return null;
+    }
+    
 
     /**
      * {@inheritDoc}

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRule.java
Sun Mar 20 12:37:52 2011
@@ -80,5 +80,11 @@ public interface MutableMatchingRule ext
     /**
      * {@inheritDoc}
      */
-    MutableMatchingRule copy();
+    MatchingRule copy();
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    MutableMatchingRule copyMutable();
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRuleImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRuleImpl.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRuleImpl.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableMatchingRuleImpl.java
Sun Mar 20 12:37:52 2011
@@ -392,12 +392,12 @@ public class MutableMatchingRuleImpl ext
     {
         return objectType + " " + DescriptionUtils.getDescription( this );
     }
-
-
+    
+    
     /**
      * {@inheritDoc}
      */
-    public MutableMatchingRuleImpl copy()
+    public MutableMatchingRule copyMutable()
     {
         MutableMatchingRuleImpl copy = new MutableMatchingRuleImpl( oid );
 
@@ -417,6 +417,15 @@ public class MutableMatchingRuleImpl ext
 
 
     /**
+     * {@inheritDoc}
+     */
+    public MatchingRule copy()
+    {
+        return copyMutable();
+    }
+
+
+    /**
      * @see Object#equals()
      */
     @Override

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableNormalizer.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableNormalizer.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableNormalizer.java
Sun Mar 20 12:37:52 2011
@@ -29,5 +29,11 @@ public interface MutableNormalizer exten
     /**
      * {@inheritDoc}
      */
-    MutableNormalizer copy();
+    Normalizer copy();
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    MutableNormalizer copyMutable();
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSyntaxChecker.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSyntaxChecker.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSyntaxChecker.java
Sun Mar 20 12:37:52 2011
@@ -34,5 +34,11 @@ public interface MutableSyntaxChecker ex
      * 
      * {@inheritDoc}
      */
-    MutableSyntaxChecker copy();
+    SyntaxChecker copy();
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    MutableSyntaxChecker copyMutable();
 }
\ No newline at end of file

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java
Sun Mar 20 12:37:52 2011
@@ -94,8 +94,6 @@ import org.apache.directory.shared.ldap.
  * @see DescriptionUtils#getDescription(NameForm)
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-// super.hashCode is final
-@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
 public class NameForm extends AbstractMutableSchemaObject
 {
     private static final long serialVersionUID = 1L;
@@ -471,6 +469,15 @@ public class NameForm extends AbstractMu
 
 
     /**
+     * {@inheritDoc}
+     */
+    public NameForm copyMutable()
+    {
+        return copy();
+    }
+    
+    
+    /**
      * Copy a NameForm
      */
     public NameForm copy()
@@ -516,8 +523,6 @@ public class NameForm extends AbstractMu
      * @see Object#equals(Object)
      */
     @Override
-    @SuppressWarnings("PMD.UnusedLocalVariable")
-    // Remove me when the TODO is fixed 
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
Sun Mar 20 12:37:52 2011
@@ -905,6 +905,15 @@ public class ObjectClass extends Abstrac
 
 
     /**
+     * {@inheritDoc}
+     */
+    public ObjectClass copyMutable()
+    {
+        return copy();
+    }
+    
+    
+    /**
      * Copy an ObjectClass
      * @return 
      */

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/LdapSyntaxDescriptionSchemaParser.java
Sun Mar 20 12:37:52 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import java.text.ParseException;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -64,7 +64,7 @@ public class LdapSyntaxDescriptionSchema
      * @return the parsed LdapSyntax bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized MutableLdapSyntaxImpl parseLdapSyntaxDescription( String ldapSyntaxDescription
)
+    public synchronized MutableLdapSyntax parseLdapSyntaxDescription( String ldapSyntaxDescription
)
         throws ParseException
     {
         LOG.debug( "Parsing a LdapSyntax : {}", ldapSyntaxDescription );
@@ -79,7 +79,7 @@ public class LdapSyntaxDescriptionSchema
 
         try
         {
-            MutableLdapSyntaxImpl ldapSyntax = parser.ldapSyntaxDescription();
+            MutableLdapSyntax ldapSyntax = parser.ldapSyntaxDescription();
             ldapSyntax.setSpecification( ldapSyntaxDescription );
 
             // Update the schemaName
@@ -109,7 +109,7 @@ public class LdapSyntaxDescriptionSchema
      * @return An instance of LdapSyntax
      * @throws ParseException {@inheritDoc}
      */
-    public MutableLdapSyntaxImpl parse( String schemaDescription ) throws ParseException
+    public MutableLdapSyntax parse( String schemaDescription ) throws ParseException
     {
         return parseLdapSyntaxDescription( schemaDescription );
     }

Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/MatchingRuleDescriptionSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/MatchingRuleDescriptionSchemaParser.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/MatchingRuleDescriptionSchemaParser.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/parsers/MatchingRuleDescriptionSchemaParser.java
Sun Mar 20 12:37:52 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.ldap
 import java.text.ParseException;
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.schema.MutableMatchingRuleImpl;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -70,7 +70,7 @@ public class MatchingRuleDescriptionSche
      * @return the parsed MatchingRuleDescription bean
      * @throws ParseException if there are any recognition errors (bad syntax)
      */
-    public synchronized MutableMatchingRuleImpl parseMatchingRuleDescription( String matchingRuleDescription
)
+    public synchronized MutableMatchingRule parseMatchingRuleDescription( String matchingRuleDescription
)
         throws ParseException
     {
         LOG.debug( "Parsing a MatchingRule : {}", matchingRuleDescription );
@@ -85,7 +85,7 @@ public class MatchingRuleDescriptionSche
 
         try
         {
-            MutableMatchingRuleImpl matchingRule = parser.matchingRuleDescription();
+            MutableMatchingRule matchingRule = parser.matchingRuleDescription();
 
             // Update the schemaName
             updateSchemaName( matchingRule );
@@ -114,7 +114,7 @@ public class MatchingRuleDescriptionSche
      * @return An instance of MatchingRule
      * @throws ParseException {@inheritDoc}
      */
-    public MutableMatchingRuleImpl parse( String schemaDescription ) throws ParseException
+    public MutableMatchingRule parse( String schemaDescription ) throws ParseException
     {
         return parseMatchingRuleDescription( schemaDescription );
     }

Modified: directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/LdapSyntaxDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/LdapSyntaxDescriptionSchemaParserTest.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/LdapSyntaxDescriptionSchemaParserTest.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/LdapSyntaxDescriptionSchemaParserTest.java
Sun Mar 20 12:37:52 2011
@@ -27,7 +27,8 @@ import java.text.ParseException;
 
 import com.mycila.junit.concurrent.Concurrency;
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
-import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntaxImpl;
+
+import org.apache.directory.shared.ldap.model.schema.MutableLdapSyntax;
 import org.apache.directory.shared.ldap.model.schema.parsers.LdapSyntaxDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -118,7 +119,7 @@ public class LdapSyntaxDescriptionSchema
     public void testFull() throws ParseException
     {
         String value = null;
-        MutableLdapSyntaxImpl ldapSyntax = null;
+        MutableLdapSyntax ldapSyntax = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577'
X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
         ldapSyntax = parser.parseLdapSyntaxDescription( value );
@@ -160,7 +161,7 @@ public class LdapSyntaxDescriptionSchema
     public void testRfcBinary() throws ParseException
     {
         String value = "( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' X-NOT-HUMAN-READABLE
'TRUE' )";
-        MutableLdapSyntaxImpl ldapSyntax = parser.parseLdapSyntaxDescription( value );
+        MutableLdapSyntax ldapSyntax = parser.parseLdapSyntaxDescription( value );
 
         assertEquals( "1.3.6.1.4.1.1466.115.121.1.5", ldapSyntax.getOid() );
         assertEquals( "Binary", ldapSyntax.getDescription() );
@@ -179,7 +180,7 @@ public class LdapSyntaxDescriptionSchema
     public void testSyntaxWithExtensions() throws ParseException
     {
         String substrate = "( 1.3.6.1.4.1.18060.0.4.0.2.10000 DESC 'bogus description' X-SCHEMA
'blah' X-IS-HUMAN-READABLE 'true' )";
-        MutableLdapSyntaxImpl ldapSyntax = parser.parseLdapSyntaxDescription( substrate );
+        MutableLdapSyntax ldapSyntax = parser.parseLdapSyntaxDescription( substrate );
         assertEquals( "1.3.6.1.4.1.18060.0.4.0.2.10000", ldapSyntax.getOid() );
         assertEquals( "bogus description", ldapSyntax.getDescription() );
         assertNotNull( ldapSyntax.getExtensions().get( "X-IS-HUMAN-READABLE" ) );

Modified: directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/MatchingRuleDescriptionSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/MatchingRuleDescriptionSchemaParserTest.java?rev=1083422&r1=1083421&r2=1083422&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/MatchingRuleDescriptionSchemaParserTest.java
(original)
+++ directory/shared/branches/akarasulu/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/schema/syntaxes/parser/MatchingRuleDescriptionSchemaParserTest.java
Sun Mar 20 12:37:52 2011
@@ -35,7 +35,7 @@ import com.mycila.junit.concurrent.Concu
 import com.mycila.junit.concurrent.ConcurrentJunitRunner;
 
 import org.apache.directory.shared.ldap.model.schema.MatchingRule;
-import org.apache.directory.shared.ldap.model.schema.MutableMatchingRuleImpl;
+import org.apache.directory.shared.ldap.model.schema.MutableMatchingRule;
 import org.apache.directory.shared.ldap.model.schema.parsers.MatchingRuleDescriptionSchemaParser;
 import org.junit.After;
 import org.junit.Before;
@@ -176,7 +176,7 @@ public class MatchingRuleDescriptionSche
     public void testFull() throws ParseException, NamingException
     {
         String value = null;
-        MutableMatchingRuleImpl matchingRule = null;
+        MutableMatchingRule matchingRule = null;
 
         value = "( 1.2.3.4.5.6.7.8.9.0 NAME ( 'abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789'
'test' ) DESC 'Descripton \u00E4\u00F6\u00FC\u00DF \u90E8\u9577' OBSOLETE SYNTAX 0.1.2.3.4.5.6.7.8.9
X-TEST-a ('test1-1' 'test1-2') X-TEST-b ('test2-1' 'test2-2') )";
         matchingRule = parser.parseMatchingRuleDescription( value );
@@ -255,7 +255,7 @@ public class MatchingRuleDescriptionSche
     public void testRfc1() throws ParseException, NamingException
     {
         String value = "( 2.5.13.5 NAME 'caseExactMatch' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
)";
-        MutableMatchingRuleImpl matchingRule = parser.parseMatchingRuleDescription( value
);
+        MutableMatchingRule matchingRule = parser.parseMatchingRuleDescription( value );
 
         assertEquals( "2.5.13.5", matchingRule.getOid() );
         assertEquals( 1, matchingRule.getNames().size() );
@@ -271,7 +271,7 @@ public class MatchingRuleDescriptionSche
     public void testSun1() throws ParseException, NamingException
     {
         String value = "( 2.5.13.5 NAME 'caseExactMatch' DESC 'Case Exact Matching on Directory
String [defined in X.520]' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )";
-        MutableMatchingRuleImpl matchingRule = parser.parseMatchingRuleDescription( value
);
+        MutableMatchingRule matchingRule = parser.parseMatchingRuleDescription( value );
 
         assertEquals( "2.5.13.5", matchingRule.getOid() );
         assertEquals( 1, matchingRule.getNames().size() );
@@ -305,7 +305,7 @@ public class MatchingRuleDescriptionSche
         }
         else
         {
-            MutableMatchingRuleImpl matchingRule = parser.parseMatchingRuleDescription( value
);
+            MutableMatchingRule matchingRule = parser.parseMatchingRuleDescription( value
);
             assertEquals( "1.3.6.1.4.1.42.2.27.9.4.34.3.6", matchingRule.getOid() );
             assertEquals( 1, matchingRule.getNames().size() );
             assertEquals( "caseExactSubstringMatch-2.16.840.1.113730.3.3.2.11.3", matchingRule.getNames().get(
0 ) );



Mime
View raw message