On Fri, 26 May 2023 14:07:12 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

>> No, what I'm proposing is to modify `isLink` only so that it returns `true` 
>> if and only if the file is a Windows shortcut `.lnk` file.
>> 
>> ---
>> 
>> Another option is to modify `isFileSystem` so that it returns `true` for all 
>> filesystem objects, excluding the added condition that it should be not a 
>> link to directory.
>
>> Another option is to modify `isFileSystem` so that it returns `true` for all 
>> filesystem objects, excluding the added condition that it should be not a 
>> link to directory.
> 
> I assume this is required to ensure `JFileChooser` doesn't return `.lnk` file 
> when in directory-only selection mode, and probably doesn't report is 
> directory is selected when you select `.lnk` file. Double-clicking the `.lnk` 
> file resolves to its target, then the directory can be safely returned.

So now two modifications are required. 
1. Modify `isLink` of win32ShellFolder class to return true only if its  `.lnk`.
2. `isFileSystem` of FileSystemView to return true only if its valid 
fileSystem, except `isLink` which actually solves the problem of `isFileSystem 
` returning false for links (hard/soft).
Am I right?

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

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

Reply via email to