[8u] RFR 8240690: Race condition between EDT and BasicDirectoryModel.FilesLoader.run0()

Zhengyu Gu zgu at redhat.com
Thu May 13 16:55:17 UTC 2021


Hi,

I would like to backport this patch to 8u for parity with Oracle 8u301.

The original bug: https://bugs.openjdk.java.net/browse/JDK-8240690
The original patch: https://hg.openjdk.java.net/jdk/jdk/rev/aecc15fc9206

8u webrev: http://cr.openjdk.java.net/~zgu/JDK-8240690-8u/webrev.00/

Please note, this is *not* straight forward backport, due to several 
dependencies that are not backported to 8u, noticeable JDK-8027771.

To get around the dependencies:

1) I resurrected ManagedLocalsThread.java (from JDK-8153737). This class 
was removed by JDK-8147543, due to new API introduced in JDK9.

2) Applied BasicDirectoryModel.java specific patch from JDK-8027771.


There are regular merge conflicts afterward that are resolved manually. 
Also fixed bug4966171.java test, where it uses "var" language feature.

Test:
     bug4966171.java failed with unpatched JDK [1], passed with patched JDK.

Thanks,

-Zhengyu



[1] bug4966171.java with unpatched JDK

Exception in thread "Basic L&F File Loading Thread" 
java.lang.NullPointerException
	at javax.swing.JFileChooser.isTraversable(JFileChooser.java:1635)
	at 
javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run0(BasicDirectoryModel.java:253)
	at 
javax.swing.plaf.basic.BasicDirectoryModel$LoadFilesThread.run(BasicDirectoryModel.java:228)



More information about the jdk8u-dev mailing list