Author: rfrovarp
Date: Tue Aug 14 09:34:12 2007
New Revision: 565827
URL: http://svn.apache.org/viewvc?view=rev&rev=565827
Log:
Fixed equal objects must have equal hash codes problem.
Modified:
lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java
Modified: lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java?view=diff&rev=565827&r1=565826&r2=565827
==============================================================================
--- lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java (original)
+++ lenya/trunk/src/modules-core/ac/java/src/org/apache/lenya/ac/impl/CredentialImpl.java Tue Aug 14 09:34:12 2007
@@ -105,4 +105,8 @@
Credential cred = (Credential) obj;
return cred.getAccreditable().equals(getAccreditable()) && cred.getRole().equals(getRole());
}
+
+ public int hashCode() {
+ return Integer.valueOf(getAccreditable().hashCode() + getRole().hashCode()).hashCode();
+ }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.