On Mon, 18 May 2026 15:38:59 GMT, Roman Marchenko <[email protected]> 
wrote:

> This change fixes "JDK-8383867: File.getCanonicalPath drops backslash from 
> UNC path with directory junctions" when running Java in Windows from a 
> network shared folder, like "\\MyNetworkShare\jdk\bin\java.exe", JVM drops a 
> backslash when creating a canonical path if the path goes through a reparse 
> point - it turns to "\MyNetworkShare\jdk\bin\java.exe" (the only backslash in 
> the front).
> 
> I extended `test\jdk\java\io\File\GetCanonicalPath.java` test with the 
> reparse point scenario. The test fails before the fix, and passes with the 
> fix.
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

The change to getFinalPath looks okay.

For the test changes then I wonder if mklink /j can fail, and if it does then 
it will leave a mapped drive that will likely cause problems for tests that run 
subsequently. I think we'll need to run it through our CI and a range of 
Windows machines to make sure that it is stable.

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

PR Comment: https://git.openjdk.org/jdk/pull/31192#issuecomment-4499623540

Reply via email to