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

Alan Bateman alanb at openjdk.org
Wed Sep 20 18:45:40 UTC 2023


On Wed, 20 Sep 2023 18:10:17 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 incrementally with one additional commit since the last revision:
> 
>   8287843: Move \\?\ prefix stripping to resolve(File)

> So changed in [a8726fb](https://github.com/openjdk/jdk/commit/a8726fbb8a070388f2b9756ee88c746b12c18397) which also adds a couple of test cases. Perhaps some cases should be added to the `GetAbsolutePath` test as well.

Yes, I think it will need tests. The next thing is ask is the behavior of File::isAbsolute, it looks like it will return true for input like `\\\?\\foo` but it will be treated by toAbsolutePath as a relative path.

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

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


More information about the core-libs-dev mailing list