directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1748297 - /directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
Date Mon, 13 Jun 2016 18:20:51 GMT
Author: elecharny
Date: Mon Jun 13 18:20:51 2016
New Revision: 1748297

URL: http://svn.apache.org/viewvc?rev=1748297&view=rev
Log:
Fixed the hashCode so that it produces a different value for each of the inherited classes

Modified:
    directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java

Modified: directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java?rev=1748297&r1=1748296&r2=1748297&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
(original)
+++ directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
Mon Jun 13 18:20:51 2016
@@ -66,7 +66,14 @@ public abstract class AbstractAttributeT
     public int hashCode()
     {
         int hash = 37;
-        hash = hash * 17 + attributeTypes.hashCode();
+        
+        for ( AttributeType attributeType : attributeTypes )
+        {
+            hash = hash * 17 + attributeType.hashCode();
+        }
+        
+        hash = hash * 17 + this.getClass().getName().hashCode();
+        
         return hash;
     }
 



Mime
View raw message