Hi, Committed.
Regards, Jeroen 2006-01-06 Jeroen Frijters <[EMAIL PROTECTED]> PR classpath/24618 * java/util/AbstractMap.java (equals(Object,Object)): Test for identity first. * java/util/WeakHashMap.java (WeakBucket.WeakEntry.equals): Use helper method to determine equality. (WeakBucket.WeakEntry.toString): Fixed string representation of null key. (internalGet): Use helper method to determine equality.
Index: java/util/AbstractMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/AbstractMap.java,v retrieving revision 1.29 diff -u -r1.29 AbstractMap.java --- java/util/AbstractMap.java 2 Jul 2005 20:32:41 -0000 1.29 +++ java/util/AbstractMap.java 25 Dec 2005 11:50:51 -0000 @@ -594,13 +594,13 @@ * * @param o1 the first object * @param o2 the second object - * @return o1 == null ? o2 == null : o1.equals(o2) + * @return o1 == o2 || (o1 != null && o1.equals(o2)) */ // Package visible for use throughout java.util. // It may be inlined since it is final. static final boolean equals(Object o1, Object o2) { - return o1 == null ? o2 == null : o1.equals(o2); + return o1 == o2 || (o1 != null && o1.equals(o2)); } /** Index: java/util/WeakHashMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/WeakHashMap.java,v retrieving revision 1.20 diff -u -r1.20 WeakHashMap.java --- java/util/WeakHashMap.java 9 Nov 2005 22:51:54 -0000 1.20 +++ java/util/WeakHashMap.java 4 Jan 2006 11:06:24 -0000 @@ -475,7 +475,7 @@ if (o instanceof Map.Entry) { Map.Entry e = (Map.Entry) o; - return key.equals(e.getKey()) + return WeakHashMap.equals(getKey(), e.getKey()) && WeakHashMap.equals(value, e.getValue()); } return false; @@ -483,7 +483,7 @@ public String toString() { - return key + "=" + value; + return getKey() + "=" + value; } } @@ -657,7 +657,7 @@ while (bucket != null) { WeakBucket.WeakEntry entry = bucket.getEntry(); - if (entry != null && key.equals(entry.key)) + if (entry != null && equals(key, entry.key)) return entry; bucket = bucket.next;
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches