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

Alan Bateman alanb at openjdk.org
Fri Sep 19 11:11:44 UTC 2025


On Thu, 18 Sep 2025 21:29:59 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: Further cleanup

It's taken several rounds but I thin the current patch is quite good, just a confusing comment in one method.

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

> 449:     /**
> 450:      * Returns the attributes of the next symbolic link encountered in the
> 451:      * specified path. The handle contained in the returned value must be closed

I assume the first sentence was copied from lastLinkAttributes whereas it should say that it returns the attributes of the file located by the given path if it's a symbolid link.

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

Marked as reviewed by alanb (Reviewer).

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


More information about the nio-dev mailing list