This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RFA: Patch: Fix IdentityHashMap Error
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 07 Dec 2004 12:59:09 +0530
- Subject: RFA: Patch: Fix IdentityHashMap Error
Hi,
This patch fixes the java/util/IdentityHashMap.java regression
reported in:
http://gcc.gnu.org/ml/java/2004-11/msg00153.html
Tested on i686-pc-linux-gnu.
OK for mainline?
Thanks,
Ranjit.
--
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/
Index: ChangeLog
from Ranjit Mathew <rmathew@hotmail.com>
* java/util/IdentityHashMap.java (put): Replace mistaken use
of "<<" by "*".
Index: java/util/IdentityHashMap.java
===================================================================
--- java/util/IdentityHashMap.java 2004-12-07 11:59:00.000000000 +0530
+++ java/util/IdentityHashMap.java 2004-12-07 11:59:25.000000000 +0530
@@ -492,7 +492,7 @@ public class IdentityHashMap extends Abs
Object[] old = table;
// This isn't necessarily prime, but it is an odd number of key/value
// slots, which has a higher probability of fewer collisions.
- table = new Object[old.length << 1 + 2];
+ table = new Object[(old.length * 2) + 2];
Arrays.fill(table, emptyslot);
size = 0;
threshold = (table.length >>> 3) * 3;