RFR: 8365626: (fs) Improve handling of broken links in Files.isSameFile() (win) [v8]
Brian Burkhalter
bpb at openjdk.org
Thu Sep 18 17:50:02 UTC 2025
On Thu, 18 Sep 2025 16:53:24 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Wait, I see. If `FileSystemLoopException` is thrown, then `h` could still be valid. Will change.
>
>> If `FileSystemLoopException` is thrown, then `h` could still be valid.
>
> This is true but it will not have been added to the `linkAttrs` set and so should be closed, so that is correct.
The variable `h` is set to a valid value by `openForReadAttributeAccess` and reset to invalid if `linkAttrs.add` succeeds. If `add` succeeds, then `h` is in a record added to `linkAttrs` and will be closed at line 507. If `add` fails, then `h` is not added to the set and is closed at line 502. I don't see how it can be closed twice.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27079#discussion_r2360504456
More information about the nio-dev
mailing list