On Mon, 19 May 2025 08:15:29 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output 
> suggests that the mouse exit event is not triggered and thus the test fails.
> Increased number of list items and adjusted the X and Y offset for mouse move 
> events, so the mouse pointer will be within the frame and added robot delay 
> to stabilize the test.
> 
> Verified the updated test in CI on macOS 14.7 machine and there is no failure.

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/List/ListEnterExitTest.java line 1:

> 1: /*

I strongly suggest making `MouseEnterExitListener` a static nested class inside 
`ListEnterExitTest`. This prevents any duplicate class names from other classes 
when one works with tests in an IDE.

test/jdk/java/awt/List/ListEnterExitTest.java line 90:

> 88:             robot.waitForIdle();
> 89:             robot.delay(100);
> 90: 

I don't really understand why `waitForIdle` and `delay` are needed here at all.

Robot just moves mouse to generate mouse enter and exit events. It can do so 
without any delays, can't it?

test/jdk/java/awt/List/ListEnterExitTest.java line 92:

> 90: 
> 91:             robot.mousePress(InputEvent.BUTTON1_MASK);
> 92:             robot.mouseRelease(InputEvent.BUTTON1_MASK);

Is this mouse press needed only to release `mouseEnterExitListener.wait`?

I suggest using a `CountDownLatch` to replace `MouseEnterExitListener.passed_1` 
and `passed_2`. The code would need to time-await for both latches to be 
released.

Then `MouseEnterExitListener.mousePressed` can be removed completely together 
with the synchronized block above.

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

PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2850541693
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2095578628
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2095570577
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2095576436

Reply via email to