-
Bug
-
Resolution: Unresolved
-
P4
-
6
---------------------------
import java.util.*;
public class Bug {
static void test(String... elts) {
Set<String> s = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
s.addAll(Arrays.asList("a", "b"));
s.removeAll(Arrays.asList(elts));
System.out.println(s);
}
public static void main(String[] args) {
test("A");
test("A", "C");
}
}
---------------------------
would print 2 identical lines, but in fact it prints
[b]
[a, b]
The results are dependent on the relative sizes of the two sets,
violating the Principle of Least Astonishment.
- duplicates
-
JDK-6396943 TreeSet, TreeMap removeAll() method uses Comparator inconsistently
- Closed
-
JDK-8180409 TreeSet removeAll inconsistent behaviour with String.CASE_INSENSITIVE_ORDER
- Closed
- relates to
-
JDK-4744966 (coll spec) Small AbstractSet documentation error
- Open
-
JDK-8244572 AbstractMap, HashMap, TreeMap, and unmodifiable Maps' equals() methods operate in the wrong direction
- Open
-
JDK-8218945 ConcurrentSkipListSet.removeAll() uses semantics of wrong collection
- In Progress
-
JDK-4266874 java.util.AbstractSet can speed up removeAll
- Resolved
-
JDK-4730113 TreeSet removeAll(), retainAll() don't use comparator; addAll() does
- Closed
-
JDK-6250140 (coll) AbstractSet.removeAll implementation may lead to incorrect NullPointerExceptions
- Open
-
JDK-6588783 (coll) IdentityHashMap.removeAll
- Open
-
JDK-6982173 (coll) Performance anomalies in AbstractSet.removeAll
- Open
-
JDK-8180348 AbstractSet.removeAll does not specify the case when collections are the same size
- Open
-
JDK-8181579 Inconsistency between API documentation and TreeSet.add(...) behaviour
- Open
-
JDK-8218945 ConcurrentSkipListSet.removeAll() uses semantics of wrong collection
- In Progress
-
JDK-8219069 ConcurrrentHashMap set views' removeAll() performance heuristic should be removed
- In Progress
-
JDK-8180409 TreeSet removeAll inconsistent behaviour with String.CASE_INSENSITIVE_ORDER
- Closed
-
JDK-5028425 (coll) Collection.retainAll(Collection) implementations are not optimized
- Open
-
JDK-8178425 The AbstractSet.removeAll() method can be more efficient when removing a large list
- Open
-
JDK-8179007 java.util.Collections::disjoint -- run-time improvement
- Open
-
JDK-7186403 (coll) AbstractCollection.retainAll(coll) is slow when collection "coll" is empty
- Open
-
JDK-6728865 (coll) Provide a better heuristics for Collections.disjoint method
- Closed
-
JDK-8337520 AbstractSet should specify default implementation using @implSpec
- New