Author: toad
Date: 2008-04-05 10:34:09 +0000 (Sat, 05 Apr 2008)
New Revision: 19006

Modified:
   trunk/freenet/src/freenet/crypt/DSAPublicKey.java
Log:
Neither y nor group can be null.
And here xor is more appropriate than prime number voodoo, because we want it 
to be equally dependant on both.

Modified: trunk/freenet/src/freenet/crypt/DSAPublicKey.java
===================================================================
--- trunk/freenet/src/freenet/crypt/DSAPublicKey.java   2008-04-05 10:31:07 UTC 
(rev 19005)
+++ trunk/freenet/src/freenet/crypt/DSAPublicKey.java   2008-04-05 10:34:09 UTC 
(rev 19006)
@@ -164,10 +164,7 @@
        }

        public int hashCode() {
-               int hash = 5;
-               hash = 61 * hash + (this.y != null ? this.y.hashCode() : 0);
-               hash = 61 * hash + (this.group != null ? this.group.hashCode() 
: 0);
-               return hash;
+               return y.hashCode() ^ group.hashCode();
        }

        public boolean equals(Object o) {


Reply via email to