<Swing Dev> [12] RFR JDK-8198340: Test javax/swing/plaf/basic/Test6984643.java is unstable

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Fri Nov 9 08:48:58 UTC 2018


Hi All,

Please review this test fix for jdk12.

Bug: https://bugs.openjdk.java.net/browse/JDK-8198340
webrev: http://cr.openjdk.java.net/~psadhukhan/8198340/webrev.0/

The test fails citing
java.lang.ExceptionInInitializerError
at 
java.desktop/javax.swing.filechooser.FileSystemView.getDefaultDirectory(FileSystemView.java:449)
...
Caused by: java.lang.IllegalStateException: Shutdown in progress
at 
java.base/java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)

This is because test uses invokeLater() to call JFileChooser, which do 
not wait for runnable to complete and since
jtreg will assume completion of main() is end of test, so it will try to 
stop EDT but it fails to interrupt the EDT.
Although the test passes when run in standalone mode, it sometimes 
creates instability.

Proposed fix is to change invokeLater() to invokeAndWait().

Regards
Prasanta


More information about the swing-dev mailing list