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

Alan Bateman alanb at openjdk.org
Tue Sep 9 13:30:58 UTC 2025


On Tue, 9 Sep 2025 00:30:43 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: Incorporate suggestions from review comments

Latest version looks quite good, just a few comments.

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

> 427:                 return true;
> 428:             if (obj instanceof LinkAttributes other)
> 429:                 return WindowsFileAttributes.isSameFile(attrs, other.attrs());

It's not obvious that this consistent with hashCode. It might be better to have this check the that the 3 values are equal.

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

PR Review: https://git.openjdk.org/jdk/pull/27079#pullrequestreview-3201604569
PR Review Comment: https://git.openjdk.org/jdk/pull/27079#discussion_r2333603276


More information about the nio-dev mailing list