diff options
author | Tom Tromey <tromey@redhat.com> | 2003-08-01 21:30:14 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2003-08-01 21:30:14 +0000 |
commit | 4b7c65cb23cb76463af0ec379092b766c5f4d713 (patch) | |
tree | a0672a281d2ca00e3af1ca2565488e06511dc7ef | |
parent | 84d61a8a5dd4642b0cdfbee80df695844dd049d6 (diff) |
Fix for PR libgcj/11241:
* java/util/WeakHashMap.java (WeakHashMap(int,float)): If
initialCapacity is 0, set it to 1.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@70070 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/java/util/WeakHashMap.java | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e42d79acaf8..71b863f2679 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2003-08-01 Tom Tromey <tromey@redhat.com> + + Fix for PR libgcj/11241: + * java/util/WeakHashMap.java (WeakHashMap(int,float)): If + initialCapacity is 0, set it to 1. + 2003-08-01 Stephen Crawley <crawley@dstc.edu.au> * java/net/SocketImpl.java (toString): Display the remote address diff --git a/libjava/java/util/WeakHashMap.java b/libjava/java/util/WeakHashMap.java index 3431ac921e1..4cce821c5ff 100644 --- a/libjava/java/util/WeakHashMap.java +++ b/libjava/java/util/WeakHashMap.java @@ -1,6 +1,6 @@ /* WeakHashMap -- a hashtable that keeps only weak references to its keys, allowing the virtual machine to reclaim them - Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -544,6 +544,8 @@ public class WeakHashMap extends AbstractMap implements Map // Check loadFactor for NaN as well. if (initialCapacity < 0 || ! (loadFactor > 0)) throw new IllegalArgumentException(); + if (initialCapacity == 0) + initialCapacity = 1; this.loadFactor = loadFactor; threshold = (int) (initialCapacity * loadFactor); theEntrySet = new WeakEntrySet(); |