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

Alan Bateman alanb at openjdk.org
Thu Feb 20 17:24:58 UTC 2025


On Thu, 20 Feb 2025 17:19:56 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/share/classes/java/io/File.java line 254:
>> 
>>> 252:     static File getCWD() {
>>> 253:         return CWD;
>>> 254:     }
>> 
>> This is a bit icky, have you looked at pushing this down to a holder class in UnixFileSystem and WinNTFileSystem so they they aren't dependent on this.
>
> Why not just down into `FileSystem`? It's not OS-dependent.

That would be okay too, just need to avoid circular initialization.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22821#discussion_r1964048936


More information about the core-libs-dev mailing list