RFR: 8307976: (fs) Files.createDirectories(dir) returns dir::toAbsolutePath instead of dir [v5]

Alan Bateman alanb at openjdk.org
Sun May 14 08:07:45 UTC 2023


On Fri, 12 May 2023 19:40:45 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Return `dir`, not `dir::toAbsolutePath`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8307976: Change assertEquals back to assertTrue

test/jdk/java/nio/file/Files/CreateDirectories.java line 130:

> 128:         temp.toFile().deleteOnExit();
> 129:         Path a = Files.createDirectories(temp);
> 130:         assertTrue(a == temp, a + " != " + temp);

The spec is that Files.createDirectories returns the dir parameter so I think we can change L94 to check that Files.createDirectories(tmpdir) returns tmpdir.

For the case where the dir is a relative path then probably no need for the Files.delete + deleteOnExit as they will be created in the test work directory where it's useful to leave behind crumbs.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13959#discussion_r1193096364


More information about the nio-dev mailing list