IdentityHashMap.java (put): Set new threshold correctly when resizing table.
authorBryce McKinlay <bryce@waitaki.otago.ac.nz>
Tue, 2 Apr 2002 13:55:14 +0000 (13:55 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Tue, 2 Apr 2002 13:55:14 +0000 (14:55 +0100)
* java/util/IdentityHashMap.java (put): Set new threshold correctly
when resizing table.

From-SVN: r51751

libjava/ChangeLog
libjava/java/util/IdentityHashMap.java

index 4fe72e6..0f962be 100644 (file)
@@ -1,3 +1,8 @@
+2002-04-02  Bryce McKinlay  <bryce@waitaki.otago.ac.nz>
+
+       * java/util/IdentityHashMap.java (put): Set new threshold correctly
+       when resizing table.
+
 2002-04-01  Mark Wielaard  <mark@klomp.org>
 
         * java/util/BitSet.java (BitSet(int)): if nbits < 0 throw
index e6cd8c6..4609f01 100644 (file)
@@ -490,7 +490,7 @@ public class IdentityHashMap extends AbstractMap
         table = new Object[old.length * 2 + 2];
         Arrays.fill(table, emptyslot);
         size = 0;
-        threshold = table.length / 4 * 3;
+        threshold = (table.length / 2) / 4 * 3;
 
         for (int i = old.length - 2; i >= 0; i -= 2)
           {