RFR: 8350924: javax/swing/JMenu/4213634/bug4213634.java fails

Harshitha Onkar honkar at openjdk.org
Fri Feb 28 19:05:53 UTC 2025


On Fri, 28 Feb 2025 17:53:52 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Test fails in ubuntu OCI system..Made it more robust my adding waitForIdle/delay before commencing test..
>> OCI system is ok with the fix.
>
> test/jdk/javax/swing/JMenu/4213634/bug4213634.java line 88:
> 
>> 86:         SwingUtilities.invokeAndWait(() -> {
>> 87:             frame.dispose();
>> 88:             if (!menu.isSelected()) {
> 
> Previously, the condition `!menu.isSelected()` was verified before the frame was disposed of.
> 
> I think you should verify whether menu is select before disposing of the frame; once the frame is disposed of, the state of components is not well-defined.

I agree, frame.dispose() can be added within finally block instead of here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23837#discussion_r1975889962


More information about the client-libs-dev mailing list