RFR: 8342508: Use latch in BasicMenuUI/bug4983388.java instead of delay

Abhishek Kumar abhiscxk at openjdk.org
Mon Oct 21 10:04:43 UTC 2024


On Fri, 18 Oct 2024 15:12:06 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> Use a `CountDownLatch` in `javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java` instead of delay.
> 
> The latch provides a direct way to synchronise EDT and main thread, the test will finish quicker.
> 
> I ran the updated test a few times with `JTREG=REPEAT_COUNT=20`, the test always passed in the CI.

Looks ok to me except for a suggestion.

test/jdk/javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java line 89:

> 87:         }
> 88: 
> 89:         SwingUtilities.invokeAndWait(new Runnable() {

`createAndShowGUI` method is `static`, I suggest using method reference.

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

Marked as reviewed by abhiscxk (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/21585#pullrequestreview-2381538282
PR Review Comment: https://git.openjdk.org/jdk/pull/21585#discussion_r1808468420


More information about the client-libs-dev mailing list