directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r946954 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/
Date Fri, 21 May 2010 09:41:12 GMT
Author: elecharny
Date: Fri May 21 09:41:11 2010
New Revision: 946954

URL: http://svn.apache.org/viewvc?rev=946954&view=rev
Log:
Removed the hashcode() methods and declared the abstract method's hashcode() method as final
(with some comments in the Javadoc to explain why)

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AbstractSchemaObject.java
Fri May 21 09:41:11 2010
@@ -625,9 +625,16 @@ public abstract class AbstractSchemaObje
 
 
     /**
+     * This method is final to forbid the inherited classes to implement
+     * it. This has been done for performances reasons : the hashcode should 
+     * be computed only once, and stored locally.
+     * 
+     * The hashcode is currently computed in the lock() method, which is a hack
+     * that should be fixed.
+     * 
      * @see Object#hashCode()
      */
-    public int hashCode()
+    public final int hashCode()
     {
         return h;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITContentRule.java
Fri May 21 09:41:11 2010
@@ -694,21 +694,6 @@ public class DITContentRule extends Abst
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        
-        // TODO: Fix me when equals() is implemented
-        hash = hash * 17 + getClass().getName().hashCode();
-
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals(Object)
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/DITStructureRule.java
Fri May 21 09:41:11 2010
@@ -252,21 +252,6 @@ public class DITStructureRule extends Ab
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        
-        // TODO: Fix me when equals() is implemented
-        hash = hash * 17 + getClass().getName().hashCode();
-
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals(Object)
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LdapSyntax.java
Fri May 21 09:41:11 2010
@@ -285,21 +285,6 @@ public class LdapSyntax extends Abstract
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        hash = hash * 17 + ( isHumanReadable ? 0 : 1 );
-        hash = hash * 17 + syntaxChecker.getOid().hashCode(); 
-        hash = hash * 17 + super.hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals()
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/LoadableSchemaObject.java
Fri May 21 09:41:11 2010
@@ -151,26 +151,6 @@ public abstract class LoadableSchemaObje
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        
-        // Add hashCodes from fields used in equals() 'Check the byteCode' TODO
-        // TODO
-        if ( fqcn != null )
-        {
-            hash = hash * 17 + fqcn.hashCode();
-        }
-        hash = hash * 17 + super.hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals()
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRule.java
Fri May 21 09:41:11 2010
@@ -424,31 +424,6 @@ public class MatchingRule extends Abstra
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        if ( ldapComparator != null )
-        {
-            hash = hash * 17 + ldapComparator.hashCode();
-        }
-        if ( normalizer != null )
-        {
-            hash = hash * 17 + normalizer.hashCode();
-        }
-        if ( ldapSyntaxOid != null )
-        {
-            hash = hash * 17 + ldapSyntaxOid.hashCode();
-        }
-        hash = hash * 17 + super.hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals()
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/MatchingRuleUse.java
Fri May 21 09:41:11 2010
@@ -280,21 +280,6 @@ public class MatchingRuleUse extends Abs
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        
-        // TODO complete when equals() is complete
-        hash = hash * 17 + super.hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals(Object)
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
Fri May 21 09:41:11 2010
@@ -514,21 +514,6 @@ public class NameForm extends AbstractSc
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        
-        // TODO complete when equals() is complete
-        hash = hash * 17 + super.hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals(Object)
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
Fri May 21 09:41:11 2010
@@ -91,20 +91,6 @@ public abstract class Normalizer extends
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        hash = hash * 17 + super.hashCode();
-        hash = hash * 17 + getClass().getName().hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals()
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
Fri May 21 09:41:11 2010
@@ -903,21 +903,6 @@ public class ObjectClass extends Abstrac
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        
-        // Th eObjectClass hashcode is entirelly defined by it's OID
-        hash = hash * 17 + oid.hashCode();
-
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals(Object)
      */
     @Override

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java?rev=946954&r1=946953&r2=946954&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SyntaxChecker.java
Fri May 21 09:41:11 2010
@@ -85,20 +85,6 @@ public abstract class SyntaxChecker exte
 
 
     /**
-     * {@inheritDoc}
-     */
-    @Override
-    public int hashCode()
-    {
-        int hash = 37;
-        hash = hash * 17 + getClass().getName().hashCode();
-        hash=hash * 17 + super.hashCode();
-        
-        return hash;
-    }
-
-
-    /**
      * @see Object#equals()
      */
     @Override



Mime
View raw message