RFR: 8301763: Adding children to wrong index leaves inconsistent state in Parent#childrenSet [v3]
John Hendrikx
jhendrikx at openjdk.org
Mon May 22 14:34:00 UTC 2023
On Mon, 22 May 2023 14:01:04 GMT, Lukasz Kostyra <lkostyra at openjdk.org> wrote:
>> This issue happened because `childSet` member of Parent was modified during `onProposedChange()` call - that call did not recognize negative indexes as invalid, which caused an exception when actually adding the Node to a List.
>>
>> This seemed like the simplest solution which doesn't rework a lot of code underneath. Exceptions coming from a backing list/collection technically are handled by `VetoableListDecorator`'s try-catch clauses, however `VetoableListDecorator` does not provide an interface to react when such an exception happens - without it we cannot revert `childSet` back to its original state.
>
> Lukasz Kostyra has updated the pull request incrementally with two additional commits since the last revision:
>
> - ParentTest: Add tests for NPE and *All calls
> - ObservableListWrapper: Add from-to index check to remove(int, int)
Marked as reviewed by jhendrikx (Committer).
-------------
PR Review: https://git.openjdk.org/jfx/pull/1136#pullrequestreview-1436772354
More information about the openjfx-dev
mailing list