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

Damon Nguyen dnguyen at openjdk.org
Sat Mar 1 01:13:01 UTC 2025


On Fri, 28 Feb 2025 08:50:31 GMT, Prasanta Sadhukhan <psadhukhan 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.

Changes requested by dnguyen (Committer).

test/jdk/javax/swing/JMenu/4213634/bug4213634.java line 57:

> 55:         SwingUtilities.invokeAndWait(() -> {
> 56:             createAndShowGUI();
> 57:         });

Suggestion:

        SwingUtilities.invokeAndWait(() -> createAndShowGUI());

test/jdk/javax/swing/JMenu/4213634/bug4213634.java line 74:

> 72:         JButton button = new JButton("Test");
> 73:         frame.getContentPane().add("South", button);
> 74:         frame.setSize(400, 400);

Is this the best frame size? I see the text area has text to output, but the full sentence isn't even shown and there's no word wrap. Can change the text to anything else, especially since the TextArea text exceeds the line char limit. There's also a lot of empty space in this test frame. So, this can be changed in a variety of ways.

test/jdk/javax/swing/JMenu/4213634/bug4213634.java line 119:

> 117:                 }
> 118:             });
> 119:             if(bFlag)

Can also fix the for-loop above into:

for (int i = 0; i < 10; i++) {


And can make a lambda expression by using:

    menuitem.addActionListener(e -> {
                throw new RuntimeException(
                        "Failed: Mnemonic activated");
            });

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

PR Review: https://git.openjdk.org/jdk/pull/23837#pullrequestreview-2652064257
PR Review Comment: https://git.openjdk.org/jdk/pull/23837#discussion_r1976192726
PR Review Comment: https://git.openjdk.org/jdk/pull/23837#discussion_r1976193985
PR Review Comment: https://git.openjdk.org/jdk/pull/23837#discussion_r1976190116


More information about the client-libs-dev mailing list