-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
8u202
-
x86_64
-
windows_10
A DESCRIPTION OF THE PROBLEM :
HashSet containsAll method returning true for empty set values
Example:
Set<Long> first=new HashSet<>();
first.add(2L);
Set<Long> second=new HashSet<>();
first.containsAll(second) -->true;
comparing an empty list with a list which has values returning true,which should return false.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
false
---------- BEGIN SOURCE ----------
import java.util.HashSet;
import java.util.Set;
public class Test2 {
public static void main(String[] args){
Set<Long> first=new HashSet<>();
first.add(2L);
Set<Long> second=new HashSet<>();
first.containsAll(second);
System.out.println(first.containsAll(second));
}
}
---------- END SOURCE ----------
FREQUENCY : always
HashSet containsAll method returning true for empty set values
Example:
Set<Long> first=new HashSet<>();
first.add(2L);
Set<Long> second=new HashSet<>();
first.containsAll(second) -->true;
comparing an empty list with a list which has values returning true,which should return false.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
false
---------- BEGIN SOURCE ----------
import java.util.HashSet;
import java.util.Set;
public class Test2 {
public static void main(String[] args){
Set<Long> first=new HashSet<>();
first.add(2L);
Set<Long> second=new HashSet<>();
first.containsAll(second);
System.out.println(first.containsAll(second));
}
}
---------- END SOURCE ----------
FREQUENCY : always