-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
7, 8, 11, 17, 21, 22, 23
-
b60
javax.swing.plaf.basic.BasicDirectoryModel.FilesLoader.run0() stores its temporary lists in Vector objects:
Vector<File> newFileCache;
Vector<File> newFiles;
These are local variables, they aren't accessed concurrently. Therefore, the collections could be replaced with ArrayList which has no synchronisation overhead.
newFileCache is used from another thread.
On Linux and macOS, ShellFolder.invoke runs the Callable on the same thread, using sun.awt.shell.ShellFolderManager.DirectInvoker.
On Windows ShellFolder.invoke executes the code on the COM thread, using sun.awt.shell.Win32ShellFolderManager2.ComInvoker. In this case, the Callable is wrapped into a Future object.
In either case, no additional synchronisation is needed for newFileCache.
I noticed this issue during code review forJDK-8323670.
https://github.com/openjdk/jdk/pull/17462#discussion_r1465414103
Vector<File> newFileCache;
Vector<File> newFiles;
These are local variables, they aren't accessed concurrently. Therefore, the collections could be replaced with ArrayList which has no synchronisation overhead.
newFileCache is used from another thread.
On Linux and macOS, ShellFolder.invoke runs the Callable on the same thread, using sun.awt.shell.ShellFolderManager.DirectInvoker.
On Windows ShellFolder.invoke executes the code on the COM thread, using sun.awt.shell.Win32ShellFolderManager2.ComInvoker. In this case, the Callable is wrapped into a Future object.
In either case, no additional synchronisation is needed for newFileCache.
I noticed this issue during code review for
https://github.com/openjdk/jdk/pull/17462#discussion_r1465414103
- relates to
-
JDK-8240690 Race condition between EDT and BasicDirectoryModel.FilesLoader.run0()
- Resolved
-
JDK-8323670 A few client tests intermittently throw ConcurrentModificationException
- Resolved
-
JDK-6713352 Deadlock in JFileChooser with synchronized custom FileSystemView
- Closed