RFR: 8283214: [macos] Screen magnifier does not show the magnified text for JcomboBox [v8]

Alexey Ivanov aivanov at openjdk.org
Thu Nov 9 17:43:10 UTC 2023


On Thu, 9 Nov 2023 04:36:08 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

> Observed a test failure (regression) while running the CI jobs with the fix.

The failed test is `javax/swing/JComboBox/6567433/UpdateUIRecursionTest.java`. It fails with `NullPointerException` because `PropertyChangeListener` in `AquaComboBoxUI` updates the accessible name of the arrow button. It does os before the accessible name is actually needed.

We should consider getting the accessible name lazily.

> Modified the test to fix the issue. Now, CI jobs are ok. Please review.

It looks fine to me.

But this change breaks backward compatibility: the failed test demonstrates it. If another application does something similar, it will throw NPE now.

You and I proved that adding `null`-checks in the listener or `updateAccessibleName` doesn't help. The only way to avoid it is to catch NPE.

This brings us to:

> Ideally, I'd like to make Aqua L&F classes work like Metal or Nimbus do. …

This way gets the accessible name *lazily*: it's requested only *when needed*. Therefore you should submit another bug to address the limitation of the current approach.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14497#issuecomment-1804275339


More information about the client-libs-dev mailing list