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

Brian Burkhalter bpb at openjdk.org
Wed Oct 22 15:21:11 UTC 2025


On Wed, 22 Oct 2025 15:04:39 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> One alternative to try is to use canonicalize0 as before, then test if the sym is a sym link. If the file is a sym link use getFinalPath and return that if it succeeds.

I can give it a try. As previously mentioned, I think the root problem is the behavior of `GetFinalPathNameByHandle`. `WindowsLinkSupport.resolveAllLinks` appears to give the correct answer, but it is slow.

What do you think of the device path prefix `\.` not being stripped in `WinNTFileSystem`? Should it be?

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

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


More information about the core-libs-dev mailing list