RFR: 8259637: java.io.File.getCanonicalPath() returns different values for same path

Brian Burkhalter bpb at openjdk.org
Wed Dec 13 19:43:20 UTC 2023


On Wed, 13 Dec 2023 19:37:15 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Modify the `collapse()` function to remove each instance of ".." when the path is absolute and there is no preceding name.

Without this change the updated test fails as:

FAILED     GetCanonicalPath::goodPathsUnix '[3] /../../../../../a/../../b/c, /b/c'
org.opentest4j.AssertionFailedError: expected: </b/c> but was: </../b/c>

FAILED     GetCanonicalPath::goodPathsUnix '[5] /../../../../../a/../../../../b/c, /b/c'
org.opentest4j.AssertionFailedError: expected: </b/c> but was: </../b/c>

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

PR Comment: https://git.openjdk.org/jdk/pull/17089#issuecomment-1854591185


More information about the core-libs-dev mailing list