8371657: [macosx] Programmatically selecting/deselecting List item triggers an ItemEvent #28245
+215
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I was working on JDK-8369327 I got a suggestion to update the code that disables unnecessary events:
#27682 (comment)
After checking that code more closely, I found that it does not work in all cases. The checks were first added in JDK-7125456. It looks like only the case for the select method was fixed. Other cases still cause unnecessary events, and even more events happen when trying to add multi selection mode: #27682 (comment)
So I made a new bug for this issue and fixed it separately.
The spec:
The new test checks most of the methods in the
java.awt.Listclass. It passes on linux/windows, confirming that the same behavior is implemented in other toolkits (unfortunately on linux it is not stable enough so I had to problemlist it due to JDK-8201307). The test only checks for programmatic changes to the list. I am sure that if I change it to test mix of programmatic/user changes it will fail. I will work on that in a follow up bug.@aivanov-jdk @azvegint please take a look
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28245/head:pull/28245$ git checkout pull/28245Update a local copy of the PR:
$ git checkout pull/28245$ git pull https://git.openjdk.org/jdk.git pull/28245/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28245View PR using the GUI difftool:
$ git pr show -t 28245Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28245.diff
Using Webrev
Link to Webrev Comment