-
Enhancement
-
Resolution: Fixed
-
P3
-
None
-
None
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8204035 | 11.0.1 | Doug Lea | P3 | Resolved | Fixed | team |
ArrayList's subList implementation does not implement replaceAll, but it should, for better performance (most importantly, easier to inline).
ArrayList.replaceAll and Vector.replaceAll are the only implementations that increment modCount. But they should not, since replaceAll is not a structural modification. For both ArrayList and Vector, replaceAll has different behavior on the root list and a sublist. List.replaceAll calls ListIterator.set, which is not a structural modification.
Changing the modCount behavior of replaceAll was surprisingly contentious, so deferred to a future change. This change is retargeted as a pure optimization.
ArrayList.replaceAll and Vector.replaceAll are the only implementations that increment modCount. But they should not, since replaceAll is not a structural modification. For both ArrayList and Vector, replaceAll has different behavior on the root list and a sublist. List.replaceAll calls ListIterator.set, which is not a structural modification.
Changing the modCount behavior of replaceAll was surprisingly contentious, so deferred to a future change. This change is retargeted as a pure optimization.
- backported by
-
JDK-8204035 Optimize ArrayList subList replaceAll
-
- Resolved
-
- relates to
-
JDK-8203662 remove increment of modCount from ArrayList and Vector replaceAll()
-
- Open
-
-
JDK-8203663 adjust ConcurrentModificationException policies and specifications
-
- Open
-
-
JDK-8196340 (coll) Examine overriding inherited methods in ArrayList and ArrayList.SubList
-
- Resolved
-