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

Brian Burkhalter bpb at openjdk.org
Wed Sep 10 17:00:44 UTC 2025


On Wed, 10 Sep 2025 16:33:55 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java line 424:
>> 
>>> 422:     // contains file attributes and its handle
>>> 423:     // the attributes' key is valid as long as the handle remains open
>>> 424:     private record LinkAttributes(WindowsFileAttributes attrs, long handle) {
>> 
>> Can you put a /** .. */ class description on this record.
>
> I am not completely comfortable with the name of this record as it can contain attributes from either a file or a link. Its purpose is to contain the open handle corresponding to the attributes object so it can be closed once the attributes are no longer needed.

Maybe `EntryAttributes`?

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

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


More information about the nio-dev mailing list