On Wed, 17 Jan 2024 12:55:52 GMT, Tejesh R <t...@openjdk.org> wrote:

> Suggested fix [JDK-8307091](https://bugs.openjdk.org/browse/JDK-8307091) also 
> created concurrent exception intermittently (monthly once/quarterly once) on 
> CI system. The issue was not able to be reproduced yet, hence proposing an 
> alternative fix which uses iterators to compare the List.
> CI testing shows green.

Instead of putting everything into  `synchronized(fileCache)`, I guess the 
better solution would be to wrap this line
https://github.com/openjdk/jdk/blob/c702dcabf8befc2db2baf53655f20391ee5d2d09/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L365
into `synchronized(fileCache)`. With this we can ensure that a local copy would 
be made before comparing two fileCache list, since we cannot/shouldn't depend 
on any addition/deletion from `fileCache`.

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

PR Comment: https://git.openjdk.org/jdk/pull/17462#issuecomment-1909345561

Reply via email to