-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.2.0
-
sparc
-
solaris_2.5
Name: asC58863 Date: 12/22/97
java.util.Hashtable(int, float) doesn't throw an IllegalArgumentExcetion
in case the initialCapacity equals to zero.
(see JavaDoc Comment )
"public Hashtable(int initialCapacity,
float loadFactor)
.....................................
Throws: IllegalArgumentException
if the initial capacity is less than or equal to zero, <....>"
The bug has been introduced into JDK1.2beta3-A release.
JCK114Á test tests/api/java_util/Hashtable/HahstableTests.html#HashtableTests61
fails due to this bug.
Here is the test demonstrating the bug:
-----------------Test.java------------------------
import java.util.*;
class Test {
public static void main(String[] argv) {
try {
Hashtable hashtable = new Hashtable( 0, 0.5f);
System.out.println(" Failed : IllegalArgumentException has not been thrown");
} catch(IllegalArgumentException e) {
System.out.println(" Passed : OKAY ");
}
}
}
---------Output from the test---------------------
Failed : IllegalArgumentException has not been thrown
--------------------------------------------------
======================================================================
- relates to
-
JDK-4176512 Known Incompatibility: Can now create Hashtable with initial size of 0
- Closed