You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2009/10/06 11:41:23 UTC

svn commit: r822177 - in /harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse: CipherSuite.java ProtocolVersion.java

Author: tellison
Date: Tue Oct  6 09:41:22 2009
New Revision: 822177

URL: http://svn.apache.org/viewvc?rev=822177&view=rev
Log:
Define hashCode to compliment the equals method.

Modified:
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
    harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java?rev=822177&r1=822176&r2=822177&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java Tue Oct  6 09:41:22 2009
@@ -557,6 +557,14 @@
         }
         return false;
     }
+    
+    /**
+     * Returns the hash for this instance.
+     */
+    @Override
+    public int hashCode() {
+        return cipherSuiteCode[0] + cipherSuiteCode[1];
+    }
 
     /**
      * Returns cipher algorithm name

Modified: harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java?rev=822177&r1=822176&r2=822177&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java (original)
+++ harmony/enhanced/classlib/trunk/modules/x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java Tue Oct  6 09:41:22 2009
@@ -155,4 +155,12 @@
         }
         return false;
     }
+    
+    /**
+     * Returns the hash of the receiver.
+     */
+    @Override
+    public int hashCode() {
+        return version[0] + version[1];
+    }
 }
\ No newline at end of file