RFR: 8154364: (fs) Files.isSameFile() throws NoSuchFileException with broken symbolic links [v8]

Brian Burkhalter bpb at openjdk.org
Mon Aug 18 21:52:34 UTC 2025


On Mon, 18 Aug 2025 16:09:09 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8154364: Put changes to Misc.java in platform-specific blocks
>
> test/jdk/java/nio/file/Files/Misc.java line 118:
> 
>> 116:          * Test: Neither file exists
>> 117:          */
>> 118:         if (Platform.isWindows()) {
> 
> On second thought, I don't think the sections beginning here, at line 118, and below, at line 139, should differ between Unix and Windows. I think it would be better to change the Windows implementation in the context of this request to return false instead of throwing `IOException`, and investigate any more complicated link checking when addressing https://bugs.openjdk.org/browse/JDK-8365626.

b2bd8f2 updates the Windows implementation to return `false` instead of throwing an `IOException` in the event either file does not exist. The `Misc` test is updated accordingly, thereby eliminating two platform-specific blocks.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26736#discussion_r2283570390


More information about the nio-dev mailing list