RFR: 8356678: (fs) Files.readAttributes should map ENOTDIR to NoSuchFileException where possible (unix) [v2]

Brian Burkhalter bpb at openjdk.org
Tue May 13 23:53:38 UTC 2025


On Tue, 13 May 2025 06:37:18 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8356678: Add more checks in copy and move; beef up test
>
> test/jdk/java/nio/file/Files/NotADirectory.java line 27:
> 
>> 25:  * @bug 8356678
>> 26:  * @requires (os.family != "windows")
>> 27:  * @summary Test behavior of Files methods for regular file "foo/bar"
> 
> I think the summary needs to say that it tests file operations when a component in the path is a regular rather than a directory.

Improved in fce26e5.

> test/jdk/java/nio/file/Files/NotADirectory.java line 69:
> 
>> 67:         try {
>> 68:             Files.copy(leaf, Path.of("junk"));
>> 69:         } catch (NoSuchFileException expected) {
> 
> FYI you can use assertThrows to avoid the try-catch.

Thanks. I know about that but didn't use it anyway. Fixed in fce26e5.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25191#discussion_r2087780124
PR Review Comment: https://git.openjdk.org/jdk/pull/25191#discussion_r2087779984


More information about the nio-dev mailing list