classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Map.Entry.equals minor documentation fix


From: Julian Scheid
Subject: [cp-patches] Map.Entry.equals minor documentation fix
Date: Sat, 22 Oct 2005 19:34:30 +0200
User-agent: Debian Thunderbird 1.0.7 (X11/20051011)

Hi,

the documentation for method equals(Object) in java.util.Map.Entry
contains sample code which casts the other object to HashMap instead
of Map.Entry.  The attached patch fixes this minor glitch.

I don't have commit access, can someone check this in?


2005-10-22  Julian Scheid  <address@hidden>

        * java/util/Map.java (Entry.equals): Fixed invalid example code
        in documentation.


Julian
Index: java/util/Map.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/Map.java,v
retrieving revision 1.16
diff -u -r1.16 Map.java
--- java/util/Map.java  2 Jul 2005 20:32:42 -0000       1.16
+++ java/util/Map.java  22 Oct 2005 17:21:09 -0000
@@ -324,10 +324,10 @@
      * this must be:
      * 
 <p><pre>(o instanceof Map.Entry)
-&& (getKey() == null ? ((HashMap) o).getKey() == null
-                     : getKey().equals(((HashMap) o).getKey()))
-&& (getValue() == null ? ((HashMap) o).getValue() == null
-                       : getValue().equals(((HashMap) o).getValue()))</pre>
+&& (getKey() == null ? ((Map.Entry) o).getKey() == null
+                     : getKey().equals(((Map.Entry) o).getKey()))
+&& (getValue() == null ? ((Map.Entry) o).getValue() == null
+                       : getValue().equals(((Map.Entry) o).getValue()))</pre>
      *
      * @param o the object to compare
      *

reply via email to

[Prev in Thread] Current Thread [Next in Thread]