On Tue, 20 May 2025 19:40:04 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> Abhishek Kumar has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains three commits:
>> 
>>  - File merge
>>  - Review comment fix, latch and other changes
>>  - Test Stabilization
>
> test/jdk/java/awt/List/ListEnterExitTest.java line 40:
> 
>> 38: 
>> 39: import java.awt.event.InputEvent;
>> 40: import java.awt.event.MouseAdapter;
> 
> `InputEvent` isn't used in the class.

Updated.

> test/jdk/java/awt/List/ListEnterExitTest.java line 97:
> 
>> 95: 
>> 96:             if (!mouseEnterLatch.await(LATCH_TIMEOUT, TimeUnit.SECONDS)) 
>> {
>> 97:                 System.out.println("mouseEnterLatch count is : " + 
>> mouseEnterLatch.getCount());
> 
> This print is redundant: if `mouseEnterLatch` isn't released yet, its count 
> is 1 — it can't have any other value. At the same, the count could change 
> right after the timeout occurred which would lead to a very confusing output.
> 
> Thus, I recommend removing printing the count of a latch.

Updated.

> test/jdk/java/awt/List/ListEnterExitTest.java line 114:
> 
>> 112:     }
>> 113: 
>> 114:     static class MouseEnterExitListener extends MouseAdapter {
> 
> Suggestion:
> 
>     private class MouseEnterExitListener extends MouseAdapter {
> 
> Removing `static` allows removing `static` modifier from the latches.
> 
> In fact, the `MouseEnterExitListener` class can be eliminated altogether… Yet 
> the code could be clearer this way.

I thought of removing the class but then found it ok to have.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2099282323
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2099282467
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2099282739

Reply via email to