On Mon, 27 Jan 2025 18:34:30 GMT, Michael Strauß <mstra...@openjdk.org> wrote:
>> Passing a `VetoableListDecorator.subList()` to any of its bulk operations >> (`addAll`, `setAll`, `removeAll`, `retainAll`) throws >> `ConcurrentModificationException`. The reason is that the >> `VetoableListDecorator.modCount` field is incremented before the underlying >> list's bulk operation is invoked, which causes a mismatch when the sublist >> is interrogated by the bulk operation. >> >> However, simply updating the `modCount` field _after_ the underlying list >> was modified also doesn't work, as in this case listeners can't see the >> correct value for `modCount` in their callback. The fix is to make a >> defensive copy of the sublist before invoking the underlying list's bulk >> operation. > > Michael Strauß has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains six additional > commits since the last revision: > > - update tests > - update tests > - check list content in tests > - Merge branch 'master' into fixes/vetoable-list-decorator-sublist > - allow sublists to be used for bulk operations > - failing tests lgtm ------------- Marked as reviewed by angorya (Reviewer). PR Review: https://git.openjdk.org/jfx/pull/1679#pullrequestreview-2576318426