RFR: 8307105: JFileChooser InvalidPathException when selecting some system folders on Windows [v3]

Alexey Ivanov aivanov at openjdk.org
Thu May 25 11:41:57 UTC 2023


On Thu, 25 May 2023 07:15:10 GMT, Tejesh R <tr at openjdk.org> wrote:

> Since `FileSystemView.isFileSystem` is used in many places for particular Look and Feel, there might be chances of regression. So how about checking for shell folder first and if yes then can combine the `shell.isFileSystem()` with `isSymbolicLink()` in BasicFileChooser class.......? If its not a shell folder then directly we can check for `isSymbolicLink()`.

I guess what I proposed is riskier but _it's better_. It resolves the problem why junctions and symbolic links aren't accepted. It will also handle junctions correctly, now, as I showed above, selecting a junction results in the selected file being set to `null` just like it was for symbolic links before your first fix.

Another thing to try is to modify `Win32ShellFolder2.isLink` so that it returns `true` only for Windows shortcuts that is for `.lnk` files. In this case, the behaviour will be the same as it was on previous versions of Windows where neither junctions nor symbolic links were considered a link.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13998#discussion_r1205388746



More information about the client-libs-dev mailing list