On Wed, 15 Oct 2025 23:38:40 GMT, Brian Burkhalter <[email protected]> wrote:
>> `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. > > Brian Burkhalter has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains seven additional > commits since the last revision: > > - 8355342: Fall back to canonicalize0() result if drive letter converted to > a long / UNC prefix > - Merge > - Merge > - 8355342: Corrected a comment > - 8355342: Add missing space in constant declaration > - 8355342: Fix possible sneaky NullPointerException > - 8355342: File.getCanonicalPath on Java 24 resolves paths on network drives > to UNC format Commit ebe88f7 changes `WinNTFileSystem::canonicalize` to fall back to the result of `canonicalize0` if `getFinalPath` converts a drive letter + `:` to a path beginning with `\`. I have investigated and tested various Windows API functions and there does not appear to be a way to determine to exactly which path prefix a drive letter will be mapped by `GetFinalPathNameByHandleW`. No changes to the test are needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27324#issuecomment-3408658546
