Relates :
|
|
Relates :
|
|
Relates :
|
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 for JDK-8323670. https://github.com/openjdk/jdk/pull/17462#discussion_r1465414103
|