RFR: 8368156: java/nio/file/Files/IsSameFile.java failing (win)
Alan Bateman
alanb at openjdk.org
Tue Sep 23 07:56:33 UTC 2025
On Tue, 23 Sep 2025 07:04:25 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:
>> Use try-with-resources to ensure that the FileSystem `zipfs` is closed when no longer needed. This fixes the issue at hand. Other changes are to simplify cleanup of test files.
>
> test/jdk/java/nio/file/Files/IsSameFile.java line 72:
>
>> 70: @BeforeAll
>> 71: public void init() throws IOException {
>> 72: Path cwd = Path.of(System.getProperty("user.dir"));
>
> There are several places where this idiom is guarded against the absence of the `user.dir` property:
>
> Suggestion:
>
> Path cwd = Path.of(System.getProperty("user.dir", "."));
>
>
> I leave it up to you.
user.dir is a standard property and is required to be set. Defaulting to "." is okay, it just shouldn't happen.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27440#discussion_r2371484228
More information about the nio-dev
mailing list