RFR: 8365626: (fs) Improve handling of broken links in Files.isSameFile() (win) [v4]
Brian Burkhalter
bpb at openjdk.org
Fri Sep 12 17:56:28 UTC 2025
On Fri, 12 Sep 2025 17:31:26 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>>> Let's go back to L477. If the readAttributes throws, where is the handle closed?
>>
>> Oh, you're correct: that looks like a leak. The variable `h` should be closed in a catch block for `readAttributes`. Will fix. Thanks for the "catch".
>
> Same question with the code that follows where it checks !attrs.isSymbolicLink(). Does it leak for this case?
attrs.isSymbolicLink() does not throw nor does any other code before the handle is added to the linkAttrs set and all the handles in there are closed in either the catch or the finally block.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27079#discussion_r2345044374
More information about the nio-dev
mailing list