RFR: 8355342: File.getCanonicalPath on Java 24 resolves paths on network drives to UNC format [v4]

Alan Bateman alanb at openjdk.org
Thu Sep 18 16:35:58 UTC 2025


On Wed, 17 Sep 2025 23:15:42 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> where `Z:` is mapped as `net use Z: \\localhost\c$\Temp`, in other words to `C:\Temp`, a similar problem happens with `toRealPath`:
> 
> ```
> jshell> Path.of("Z:\\target.txt").toRealPath()
> $7 ==> Z:\target.txt
> 
> jshell> Path.of("Z:\\link").toRealPath()
> $8 ==> \\localhost\c$\Temp\target.txt
> ```

Are you able to check how it behaves when mapped to a location on different host?

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

PR Comment: https://git.openjdk.org/jdk/pull/27324#issuecomment-3308451257


More information about the core-libs-dev mailing list