RFR: 8365626: (fs) Improve handling of broken links in Files.isSameFile() (win) [v8]

Alan Bateman alanb at openjdk.org
Thu Sep 18 14:27:25 UTC 2025


On Wed, 17 Sep 2025 21:26:35 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Improve handling of broken symbolic links in `Files.isSameFile` on Windows as was done on Unix by the fix of [JDK-8154364](https://bugs.openjdk.org/browse/JDK-8154364).
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8365626: Cleanup

src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 471:

> 469:                 try {
> 470:                     h = path.openForReadAttributeAccess(false);
> 471:                 } catch (WindowsException x) {

I think you'll need to init h to INVALID_HANDLE_VALUE here or when WindowsException is thrown, otherwise there is a risk that it will be closed twice, assuming I'm reading it correctly.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27079#discussion_r2359590218


More information about the nio-dev mailing list