RFR: 8347753: VetoableListDecorator doesn't accept its own sublists for bulk operations [v2]
Michael Strauß
mstrauss at openjdk.org
Mon Jan 27 18:57:50 UTC 2025
On Mon, 27 Jan 2025 18:47:41 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> > Can you elaborate?
> > what does "save one extra pointer" mean?
>
> What I mean is simply get rid of the extra pointer like `VetoableListIteratorDecorator.parent` and the related logic, and simply create a copy of List/Collection each time.
Okay, I see. We can't do that, because a sublist is specified to be a live view onto the source list. After all, `list.subList(0, 3).clear()` is valid code, and the result is that three elements are removed from the source list.
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1679#issuecomment-2616640977
More information about the openjfx-dev
mailing list