-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
sparc
-
solaris_2.6
-
Verified
Name: auR10023 Date: 08/15/2001
java.util.HashSet.remove(Object ) doesn`t work with null elements.
This method returns false for null element.
Here is the example:
---------------t.java---------------
import java.util.*;
class t {
public static void main(String [] args) {
HashSet hs = new HashSet();
hs.add(null);
System.out.println(hs.remove(null));
}
}
#java -version
java -version
java version "1.4.0-beta_refresh"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta_refresh-b75)
Java HotSpot(TM) Client VM (build 1.4.0-beta_refresh-b75, mixed mode)
#java -cp . t
false
#java -version
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, interpreted mode)
#java -cp .t
true
======================================================================