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

2023-05-30 Thread Tejesh R
On Mon, 22 May 2023 15:55:41 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated based on review comments > > Changes requested by aivanov (Reviewer). As discuss with @aivanov-jdk , the fix vali

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

2023-05-26 Thread Tejesh R
On Fri, 26 May 2023 14:07:12 GMT, Alexey Ivanov 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 >> f

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

2023-05-26 Thread Alexey Ivanov
On Fri, 26 May 2023 14:38:54 GMT, Tejesh R wrote: >>> So now two modifications are required. >>> >>> 1. Modify `isLink` of win32ShellFolder class to return true only if its >>> `.lnk`. >> >> This should be enough to fix this bug. >> >> This should enable the support for Windows junctions too

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

2023-05-26 Thread Tejesh R
On Fri, 26 May 2023 14:30:29 GMT, Alexey Ivanov wrote: >> 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 a

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

2023-05-26 Thread Alexey Ivanov
On Fri, 26 May 2023 14:27:22 GMT, Tejesh R wrote: > So now two modifications are required. > > 1. Modify `isLink` of win32ShellFolder class to return true only if its > `.lnk`. This should be enough to fix this bug. And this should enable the support for Windows junctions too. -

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

2023-05-26 Thread Alexey Ivanov
On Fri, 26 May 2023 14:00:16 GMT, Alexey Ivanov wrote: > 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 retu

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

2023-05-26 Thread Alexey Ivanov
On Thu, 25 May 2023 13:58:17 GMT, Tejesh R wrote: >> As for other Look-and-Feels, `isFileSystem` is used for the same purpose >> that it's used in the code you're modifying: if a selected object in the >> list is a file system object (a directory), the text field to the path of >> the selected

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

2023-05-25 Thread Tejesh R
On Thu, 25 May 2023 13:42:29 GMT, Alexey Ivanov 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

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

2023-05-25 Thread Alexey Ivanov
On Thu, 25 May 2023 11:39:33 GMT, Alexey Ivanov wrote: >>> I understand that, virtual folders don't have a filesystem path, this is >>> why `fsv.isFileSystem(f)` should handle this situation. The implementation >>> of `FileSystemView.isFileSystem` explicitly excludes such files which are >>> b

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

2023-05-25 Thread Alexey Ivanov
On Thu, 25 May 2023 07:15:10 GMT, Tejesh R 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 `isS

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

2023-05-25 Thread Tejesh R
On Mon, 22 May 2023 15:55:41 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated based on review comments > > Changes requested by aivanov (Reviewer). @aivanov-jdk The alternative fix validates

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

2023-05-25 Thread Tejesh R
On Wed, 24 May 2023 15:48:34 GMT, Alexey Ivanov wrote: >> I understand that, virtual folders don't have a filesystem path, this is why >> `fsv.isFileSystem(f)` should handle this situation. The implementation of >> `FileSystemView.isFileSystem` explicitly excludes such files which are both >>

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

2023-05-24 Thread Alexey Ivanov
On Wed, 24 May 2023 14:18:02 GMT, Alexey Ivanov wrote: >> `Files.isSymbolicLink` takes path as argument to check if its a symbolic >> link. For certain windows specific files as explained the path won't be >> exact path, rather a hex values. So directly validating with path is causing >> an e

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

2023-05-24 Thread Alexey Ivanov
On Mon, 22 May 2023 16:07:30 GMT, Tejesh R wrote: >> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java >> line 725: >> >>> 723: || >>> (chooser.isDirectorySelectionEnabled() >>> 724: && (fsv

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

2023-05-22 Thread Tejesh R
On Mon, 22 May 2023 15:39:32 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updated based on review comments > > src/java.desktop/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java > line

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

2023-05-22 Thread Alexey Ivanov
On Wed, 17 May 2023 16:47:56 GMT, Tejesh R wrote: >> This is a regression from fix >> [JDK-8281966](https://bugs.openjdk.org/browse/JDK-8281966): Absolute path of >> symlink is null in JFileChooser. The fix checks whether the file path is a >> symbolic link using `Files.isSymbolicLink()` metho

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

2023-05-17 Thread Tejesh R
On Wed, 17 May 2023 16:25:59 GMT, Tejesh R wrote: >> I technically had 2 questions in the last comment. >> 1. Can't you just put the contents of `initialize()` in place of line 53? >> It's the only thing being run. >> 2. Why are we creating a `Runnable` instance instead of just calling >> `init

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

2023-05-17 Thread Tejesh R
> This is a regression from fix > [JDK-8281966](https://bugs.openjdk.org/browse/JDK-8281966): Absolute path of > symlink is null in JFileChooser. The fix checks whether the file path is a > symbolic link using `Files.isSymbolicLink()` method with path as input. In > windows for specific folders