[cp-patches] FYI: Added missing methods in org.ietf interface declarations.

2005-10-20 Thread Meskauskas Audrius
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.java2 Jul 2005 20:32:55 -   1.3
+++ org/ietf/jgss/GSSCredential.java20 Oct 2005 08:36:52 -
@@ -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 -   1.3
+++ org/ietf/jgss/GSSName.java  20 Oct 2005 08:36:52 -
@@ -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


Re: [cp-patches] FYI: Added missing methods in org.ietf interface declarations.

2005-10-20 Thread Tom Tromey
 Audrius == Meskauskas Audrius [EMAIL PROTECTED] writes:

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

Audrius 2005-10-20  Audrius Meskauskas  [EMAIL PROTECTED]
Audrius * org/ietf/jgss/GSSCredential.java (hashCode),
Audrius org/ietf/jgss/GSSName.java (hashCode): New declarations.

There was already some discussion of this change on one of the
classpath lists.

Short form: this particular japi note is probably a japi bug.  And,
this patch doesn't actually change anything of note... interfaces
already implicitly inherit hashCode from Object (there is a special
case in the JLS for certain methods of Object).

I don't think that this patch hurts anything either.  Now that it is
in I'd prefer it remain, if for no other reason than to placate japi.
(FWIW I still want to see those RCSId patches go in as well...)

Tom



___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches