directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r946816 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
Date Thu, 20 May 2010 23:12:10 GMT
Author: elecharny
Date: Thu May 20 23:12:10 2010
New Revision: 946816

URL: http://svn.apache.org/viewvc?rev=946816&view=rev
Log:
Fixed an infinite loop on the hashCode() method. 

Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java

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=946816&r1=946815&r2=946816&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
Thu May 20 23:12:10 2010
@@ -909,34 +909,9 @@ public class ObjectClass extends Abstrac
     public int hashCode()
     {
         int hash = 37;
-
-        hash = hash * 17 + super.hashCode();
-        hash = hash * 17 + objectClassType.hashCode();
-        hash = hash * 17 + superiorOids.size();
-        // Order doesn't matters, thus just add the hashCode
-        for ( String oid : superiorOids )
-        {
-            hash = hash + oid.hashCode();
-        }
-        hash = hash * 17 + superiors.size();
-        // Order doesn't matters, thus just add the hashCode
-        for ( ObjectClass oid : superiors )
-        {
-            hash = hash + oid.hashCode();
-        }
-        hash = hash * 17 + mayAttributeTypeOids.size();
-        // Order doesn't matters, thus just add the hashCode
-        for ( String oid : mayAttributeTypeOids )
-        {
-            hash = hash + oid.hashCode();
-        }
-        hash = hash * 17 + mayAttributeTypes.size();
-        // Order doesn't matters, thus just add the hashCode
-        for ( AttributeType oid : mayAttributeTypes )
-        {
-            hash = hash + oid.hashCode();
-        }
-        hash = hash * 17 + superiorOids.hashCode();
+        
+        // Th eObjectClass hashcode is entirelly defined by it's OID
+        hash = hash * 17 + oid.hashCode();
 
         return hash;
     }



Mime
View raw message