libgcj/2357: HashMap does not handle initialCapacity=0 correctly

Bryce McKinlay
Sat Mar 24 00:09:00 GMT 2001 wrote:

> >Description:
> When the initialCapacity of a HashMap is zero then bucket.length will be zero and then you will get a ArithmetichException in the hash() method.

I've checked in this fix. It seems better to simply bump the initialCapacity to 1 if 0 is given, than to add a special case in hash(), making it slower.


  [ bryce ]

More information about the Java-patches mailing list