This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
IdentityHashMap fix
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: java-patches at gcc dot gnu dot org
- Date: Wed, 03 Apr 2002 02:01:56 +1200
- Subject: IdentityHashMap fix
This patch fixes a bug in IdentityHashMap that was causing crashes in
JNI. The ScribbleWindow demo from qtjava in KDE 2.2.2 runs perfectly for
me now.
regards
Bryce.
2002-04-02 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* java/util/IdentityHashMap.java (put): Set new threshold correctly
when resizing table.
Index: IdentityHashMap.java
===================================================================
RCS file: /cvs/gcc/egcs/libjava/java/util/IdentityHashMap.java,v
retrieving revision 1.7
diff -u -r1.7 IdentityHashMap.java
--- IdentityHashMap.java 2002/01/22 22:40:38 1.7
+++ IdentityHashMap.java 2002/04/02 13:52:59
@@ -490,7 +490,7 @@
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)
{