java.util.Hashtable: difference between JDK and kaffe

Ito Kazumitsu ito.kazumitsu at hitachi-cable.co.jp
Fri Jan 26 00:17:55 PST 2001



In message "java.util.Hashtable: difference between JDK and kaffe"
    on 01/01/26, Ito Kazumitsu <ito.kazumitsu at hitachi-cable.co.jp> writes:

> And the cause of the problem seems to be in the different
> behaviour of kaffe's java.util.Hashtable from that of JDK's.

Attached patch solves this problem.

bash$ diff -u ~/kaffe/cvs/kaffe/libraries/javalib/java/util/HashMap.java HashMap.java
--- /home/ito/kaffe/cvs/kaffe/libraries/javalib/java/util/HashMap.java	Fri Apr  7 06:46:16 2000
+++ HashMap.java	Fri Jan 26 17:22:35 2001
@@ -234,7 +234,8 @@
 
 	private Entry find(Object key, int bucket) {
 		for (Entry e = table[bucket]; e != null; e = e.next) {
-			if (key == null ? e.key == null : key.equals(e.key)) {
+			// if (key == null ? e.key == null : key.equals(e.key)) {
+			if (e.key == null ? key == null : (e.key).equals(key)) {
 				return e;
 			}
 		}
bash$


More information about the kaffe mailing list