On Wed, 14 Feb 2024 19:47:30 GMT, Alexander Zuev <[email protected]> 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