Loading... (original) (raw)

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.