Skip to content

Conversation

@mrserb
Copy link
Member

@mrserb mrserb commented Nov 11, 2025

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:

  * Adds the specified item listener to receive item events from
  * this list.  Item events are sent in response to user input, but not
  * in response to calls to {@code select} or {@code deselect}.

The new test checks most of the methods in the java.awt.List class. 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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8371657: [macosx] Programmatically selecting/deselecting List item triggers an ItemEvent (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28245/head:pull/28245
$ git checkout pull/28245

Update a local copy of the PR:
$ git checkout pull/28245
$ git pull https://git.openjdk.org/jdk.git pull/28245/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28245

View PR using the GUI difftool:
$ git pr show -t 28245

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28245.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 11, 2025

👋 Welcome back serb! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 11, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Nov 11, 2025

@mrserb The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mrserb mrserb marked this pull request as ready for review November 14, 2025 05:48
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 14, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 14, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client [email protected] rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant