Reported by f.haeglsperger@gmx.de [classpath patch #2485]
authorMark Wielaard <mark@klomp.org>
Wed, 5 May 2004 08:28:13 +0000 (08:28 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Wed, 5 May 2004 08:28:13 +0000 (08:28 +0000)
2004-05-05  Mark Wielaard  <mark@klomp.org>

Reported by f.haeglsperger@gmx.de [classpath patch #2485]
* java/util/HashMap.java (rehash): Add entry at start of bucket.

From-SVN: r81512

libjava/ChangeLog
libjava/java/util/HashMap.java

index 45febe3d83639f1ab95ff0246f452197e1056482..cdb04d0535c952de451a377ae1b595c85d608441 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-05  Mark Wielaard  <mark@klomp.org>
+
+       Reported by f.haeglsperger@gmx.de [classpath patch #2485]
+       * java/util/HashMap.java (rehash): Add entry at start of bucket.
+
 2004-05-05  Tom Tromey  <tromey@redhat.com>
 
        * java/io/BufferedReader.java (skip): Removed unused
index dc1b112302cf3cddba4f190eec1bd0b5fcd9d301..fe4c8b06022501dac47589a8b9c5069eb20d85fb 100644 (file)
@@ -743,18 +743,9 @@ public class HashMap extends AbstractMap
           {
             int idx = hash(e.key);
             HashEntry dest = buckets[idx];
-
-            if (dest != null)
-              {
-                while (dest.next != null)
-                  dest = dest.next;
-                dest.next = e;
-              }
-            else
-              buckets[idx] = e;
-
             HashEntry next = e.next;
-            e.next = null;
+            e.next = buckets[idx];
+            buckets[idx] = e;
             e = next;
           }
       }