You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2016/06/13 18:20:51 UTC
svn commit: r1748297 -
/directory/shared/branches/shared-value/ldap/extras/aci/src/main/java/org/apache/directory/api/ldap/aci/protectedItem/AbstractAttributeTypeProtectedItem.java
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;
}