RFR: 8295774 : Write a test to verify that List Item selection events. [v2]

ravi gupta duke at openjdk.org
Wed Nov 2 14:38:53 UTC 2022


On Wed, 2 Nov 2022 11:16:15 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> ravi gupta has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8295774 : Write a test to verify that List Item selection events.
>
> test/jdk/java/awt/event/ComponentEvent/ListItemEventsTest.java line 80:
> 
>> 78:         robot = new Robot();
>> 79:         try {
>> 80: 
> 
> I think this blank line in unnecessary.

Resolved. removed blank line.

> test/jdk/java/awt/event/ComponentEvent/ListItemEventsTest.java line 89:
> 
>> 87:             Point listAt = list.getLocationOnScreen();
>> 88: 
>> 89:             Dimension listDimension = list.getSize();
> 
> Would `size` or `listSize` be a better name?
> 
> I think the blank line between `listAt` and `listDimension` is not necessary, such as the one below before the `Robot.move` call.

Resolved . Renamed as listSize and blank line removed.

> test/jdk/java/awt/event/ComponentEvent/ListItemEventsTest.java line 118:
> 
>> 116:             EventQueue.invokeAndWait(() -> list.select(0));
>> 117: 
>> 118:             if (itemStateChanged) {
> 
> You may add `Robot.waitForIdle` to be 100% sure; even though the selection occurs on the EDT, by the time `invokeAndWait` returns the listeners will have been notified. So, it should be pretty safe without it.

Resolved . added robot.waitForIdle();

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

PR: https://git.openjdk.org/jdk/pull/10899



More information about the client-libs-dev mailing list