This patch adds the declaration of the hashCode method to these two interfaces. The method is inherited from Object, and explicit declaration just indicates that it must be overridden because the .equals must be overridden.

2005-10-20  Audrius Meskauskas  <[EMAIL PROTECTED]>

* org/ietf/jgss/GSSCredential.java (hashCode),
org/ietf/jgss/GSSName.java (hashCode): New declarations.

Index: org/ietf/jgss/GSSCredential.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/ietf/jgss/GSSCredential.java,v
retrieving revision 1.3
diff -u -r1.3 GSSCredential.java
--- org/ietf/jgss/GSSCredential.java    2 Jul 2005 20:32:55 -0000       1.3
+++ org/ietf/jgss/GSSCredential.java    20 Oct 2005 08:36:52 -0000
@@ -331,4 +331,14 @@
    * @return True if this object equals the other.
    */
   boolean equals(Object another);
+
+  /**
+   * Return the hash code of this credential. When overriding [EMAIL 
PROTECTED] #equals},
+   * it is necessary to override hashCode() as well.
+   *
+   * @return the hash code that must be the same for two credentials if
+   * [EMAIL PROTECTED] #equals} returns true.
+   */
+  int hashCode();
+
 }
Index: org/ietf/jgss/GSSName.java
===================================================================
RCS file: /cvsroot/classpath/classpath/org/ietf/jgss/GSSName.java,v
retrieving revision 1.3
diff -u -r1.3 GSSName.java
--- org/ietf/jgss/GSSName.java  2 Jul 2005 20:32:55 -0000       1.3
+++ org/ietf/jgss/GSSName.java  20 Oct 2005 08:36:52 -0000
@@ -201,6 +201,15 @@
   boolean equals(Object another);
 
   /**
+   * Return the hashcode of this GSSName. When overriding [EMAIL PROTECTED] 
#equals},
+   * it is normally necessary to override hashCode() as well.
+   *
+   * @return the hash code that must be the same for two names if [EMAIL 
PROTECTED] #equals}
+   * returns true.
+   */
+  int hashCode();
+
+  /**
    * Creates a mechanism name (MN) from an arbitrary internal name.  This
    * is equivalent to using the factory methods [EMAIL PROTECTED]
    * 
GSSManager#createName(java.lang.String,org.ietf.jgss.Oid,org.ietf.jgss.Oid)}
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to