This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFA: Patch: Fix IdentityHashMap Error
- From: Tom Tromey <tromey at redhat dot com>
- To: Ranjit Mathew <rmathew at gmail dot com>
- Cc: java-patches at gcc dot gnu dot org, classpath-patches at gnu dot org
- Date: 05 Jan 2005 11:57:06 -0700
- Subject: Re: RFA: Patch: Fix IdentityHashMap Error
- References: <cp3m5m$kul$1@sea.gmane.org><m3is7eccet.fsf@localhost.localdomain> <cp5ovf$ksr$1@sea.gmane.org>
- Reply-to: tromey at redhat dot com
>>>>> "Ranjit" == Ranjit Mathew <rmathew@gmail.com> writes:
Ranjit> Thanks, I've committed this to mainline.
Ranjit> Can someone please propagate this to Classpath?
I'm finally doing this. Classpath folks, the patch is appended.
Tom
Index: ChangeLog
from Ranjit Mathew <rmathew@hotmail.com>
* java/util/IdentityHashMap.java (put): Replace mistaken use
of "<<" by "*".
Index: java/util/IdentityHashMap.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/util/IdentityHashMap.java,v
retrieving revision 1.15
diff -u -r1.15 IdentityHashMap.java
--- java/util/IdentityHashMap.java 22 Oct 2004 17:15:57 -0000 1.15
+++ java/util/IdentityHashMap.java 5 Jan 2005 19:00:23 -0000
@@ -492,7 +492,7 @@
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;