<AWT Dev> [11][JDK-8197810]RFR: Test java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.html fails on Windows

Krishna Addepalli krishna.addepalli at oracle.com
Tue May 8 09:59:14 UTC 2018

Hi All

Please review a fix for JDK-8197810: https://bugs.openjdk.java.net/browse/JDK-8197810 , 

Webrev: http://cr.openjdk.java.net/~kaddepalli/8197810/webrev00/


The basic problem is that, the Robot mouse move is moving to position where item 0 is located (which is already selected), and selecting it. Since this item is already selected, there is no new item selection event generated, which is why the test fails.

Fix is to move the mouse to a position where item1 is located, so that the event is triggered.


Along with this fix, I have also fixed these other problems:

1.       Removed the applet machinery around the test and made it simple.

2.       The test was not disposing the window in case of failure.

3.       Test was using lock to determine the success or failure, but it could lead to a deadlock/ failure of the test since the main thread would acquire the lock and wait for it to get notified. Instead, CountDownLatch is a cleaner solution for the same.

4.       Cleaned up the imports.


I have tested the fix on Windows 10, Mac 10.13.4, Ubuntu 16.10 and it works.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20180508/d03d473e/attachment.html>

More information about the awt-dev mailing list