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

Brian Burkhalter bpb at openjdk.org
Wed Sep 10 16:45:02 UTC 2025


On Wed, 10 Sep 2025 12:57:29 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8365626: Address reviewer comments since previous commit
>
> src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 490:
> 
>> 488: 
>> 489:     // find the key by following links
>> 490:     private LinkAttributes fileAttrs(WindowsPath file) throws WindowsException {
> 
> The comment doesn't work for this method. Can we find a better name for this method and put a more complete method description?

This method in effect attempts to provide the attributes of the path which would be returned by `file.toRealPath()`, returning `null` where that method would throw `NoSuchFileException`. So maybe something like `realPathAttrs`?

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

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


More information about the nio-dev mailing list