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

Brian Burkhalter bpb at openjdk.org
Tue Sep 16 21:19:44 UTC 2025


`File.getCanonicalPath` invokes `GetFinalPathNameByHandle` on the result of `canonicalize0` which causes the drive letter of a mapped drive to be converted to a UNC prefix. If such a substitution is detected, this request proposes to revert the conversion of drive letter to UNC prefix before returning the canonical path.

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

Commit messages:
 - 8355342: File.getCanonicalPath on Java 24 resolves paths on network drives to UNC format

Changes: https://git.openjdk.org/jdk/pull/27324/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27324&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8355342
  Stats: 114 lines in 3 files changed: 112 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/27324.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27324/head:pull/27324

PR: https://git.openjdk.org/jdk/pull/27324


More information about the core-libs-dev mailing list