-
Bug
-
Resolution: Unresolved
-
P4
-
8, 11, 17, 21
BasicDirectoryModel provides methods getDirectories() and getFiles(). These methods go through `fileCache` which contains both and adds files into `directories` if the file is traversable or into `files` otherwise.
https://github.com/openjdk/jdk/blob/f365d807e5552a6ad9a36afd82db8f0881d62cc3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L139-L146
The same is done in validateFileCache(), in particular in javax.swing.plaf.basic.BasicDirectoryModel.FilesLoader.run0(). There are two lists (vectors): `newFileCache` and `newFiles`. The files are added into these two lists based on filechooser.isTraversable(file) condition.
https://github.com/openjdk/jdk/blob/f365d807e5552a6ad9a36afd82db8f0881d62cc3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L318-L332
After this loop, `newFileCache` contains directories only and `newFiles` contains files only.
Later, `newFiles` are added into `newFileCache`. If a new variable is introduced, it will be possible to keep three lists: `newDirectories`, `newFiles` and `newFileCache`.
Store all of them in DoChangeContents object and, after `fileCache` is updated
https://github.com/openjdk/jdk/blob/f365d807e5552a6ad9a36afd82db8f0881d62cc3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L547-L556
store the values of `newDirectories` and `newFiles` as the new values for `directories` and `files` correspondingly. And add '..' to `directories`.
https://github.com/openjdk/jdk/blob/f365d807e5552a6ad9a36afd82db8f0881d62cc3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L139-L146
The same is done in validateFileCache(), in particular in javax.swing.plaf.basic.BasicDirectoryModel.FilesLoader.run0(). There are two lists (vectors): `newFileCache` and `newFiles`. The files are added into these two lists based on filechooser.isTraversable(file) condition.
https://github.com/openjdk/jdk/blob/f365d807e5552a6ad9a36afd82db8f0881d62cc3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L318-L332
After this loop, `newFileCache` contains directories only and `newFiles` contains files only.
Later, `newFiles` are added into `newFileCache`. If a new variable is introduced, it will be possible to keep three lists: `newDirectories`, `newFiles` and `newFileCache`.
Store all of them in DoChangeContents object and, after `fileCache` is updated
https://github.com/openjdk/jdk/blob/f365d807e5552a6ad9a36afd82db8f0881d62cc3/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java#L547-L556
store the values of `newDirectories` and `newFiles` as the new values for `directories` and `files` correspondingly. And add '..' to `directories`.
- relates to
-
JDK-6777156 GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea.
-
- Resolved
-