RFR: 8024695: new File("").exists() returns false whereas it is the current working directory [v7]

Brian Burkhalter bpb at openjdk.org
Fri Feb 21 17:08:53 UTC 2025


On Fri, 21 Feb 2025 11:10:43 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

> Looks like the [description of the PR](https://github.com/openjdk/jdk/pull/22821#issue-2749006501) should be updated now

You are correct, thanks: I have updated it. Note that I still need to change the CSR similarly.

> src/java.base/unix/classes/java/io/UnixFileSystem.java line 37:
> 
>> 35: 
>> 36:     private String getPathForSysCalls(String path) {
>> 37:         return path.isEmpty() ? getCWD().getPath() : path;
> 
> The Windows implementation has a guard for path == null. Is it superfluous there, or should it be added here?
> 
>     private String getPathForWin32Calls(String path) {
>         return (path != null && path.isEmpty()) ? getCWD().getPath() : path;
>     }

Without the `null` check on Windows there were test failures which I do not see on Unix.

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

PR Comment: https://git.openjdk.org/jdk/pull/22821#issuecomment-2675093494
PR Review Comment: https://git.openjdk.org/jdk/pull/22821#discussion_r1965887504


More information about the core-libs-dev mailing list