RFR: 8287843: File::getCanonicalFile doesn't work for \\?\C:\ style paths DOS device paths [v8]

Brian Burkhalter bpb at openjdk.org
Tue Nov 14 02:27:38 UTC 2023


On Mon, 13 Nov 2023 19:41:48 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> In the Windows implementation of java.io.File.getCanonicalPath, strip any long path or UNC prefix before canonicalizing the remainder of the pathname.
>
> 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 11 additional commits since the last revision:
> 
>  - 8287843: Change tests as suggested in review
>  - Merge
>  - 8287843: Remove unused constant and method from WindowsPrefixes test
>  - 8287843: remove stripLongOrUNCPrefix() except in normalize()
>  - 8287843: Strip prefix in more methods; remove bad test case
>  - 8287843: Add WindowsPrefixes test
>  - 8287843: Convert GetAbsolutePath and IsAbsolute tests to JUnit and add some test cases
>  - 8287843: Move prefix stripping to separate method; add to isAbsolute
>  - 8287843: Move \\?\ prefix stripping to resolve(File)
>  - 8287843: Handle "\\?\UNC"; add bad paths to test
>  - ... and 1 more: https://git.openjdk.org/jdk/compare/472762f7...2f313185

Tiers 1-3 tests passed on Windows. The tests in this PR passed 150 repeats and the other jdk_io tests 50 repeats on Windows. The tests which are not Windows-specific were verified to still succeed on Linux.

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

PR Comment: https://git.openjdk.org/jdk/pull/15603#issuecomment-1809440896


More information about the core-libs-dev mailing list