RFR: 8373967: [macos] User interactions with List do not trigger ItemEvent after programmatic change
Alexander Zvegintsev
azvegint at openjdk.org
Mon Dec 22 18:53:51 UTC 2025
On Thu, 18 Dec 2025 08:25:37 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> The fix in LWListPeer introduced by [JDK-7125456](https://bugs.openjdk.org/browse/JDK-7125456) was intended to suppress ItemEvents for programmatic changes to a List, while still allowing events generated by user interaction.
>
> The implementation unconditionally bypasses the listener logic:
> https://hg.openjdk.org/jdk7u/jdk7u-osx/jdk/rev/dfa991721457
> Unfortunately that logic also updates the cached selection state. As a result, when the application select something programmatically, the cached state is not updated.
>
> The change move out the `oldSelectedIndices = source.getSelectedIndices();` from the `!isSkipStateChangedEvent()` condition, plus some cleanup.
LGTM.
I've also verified that CI testing looks good on all platforms.
-------------
Marked as reviewed by azvegint (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28890#pullrequestreview-3605316595
More information about the client-libs-dev
mailing list