This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]