RFR: 8322239: [macos] a11y : java.lang.NullPointerException is thrown when focus is moved on the JTabbedPane [v3]
Alexey Ivanov
aivanov at openjdk.org
Wed Feb 14 20:10:04 UTC 2024
On Wed, 14 Feb 2024 19:47:30 GMT, Alexander Zuev <kizune at openjdk.org> wrote:
>> test/jdk/javax/swing/JTabbedPane/TabbedPaneNPECheck.java line 56:
>>
>>> 54: SwingUtilities.invokeAndWait(me::test);
>>> 55: } finally {
>>> 56: if (mainFrame != null) {
>>
>> should be disposed on EDT.
>
> done.
This is not thread-safe, the condition `if (mainFrame != null)` should also be inside `invokeAndWait`.
Maybe create a method to use method reference: `invokeAndWait(me::dispose)`? In this case, `mainFrame` could be made instance field.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17736#discussion_r1489994180
More information about the client-libs-dev
mailing list