Skip to content

Conversation

@vish-chan
Copy link

@vish-chan vish-chan commented Nov 10, 2025

Backporting:

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

  • Unclean backport due to conflicts in test/jdk/java/io/File/GetCanonicalPath.java.
  • The original changes depend on 8287843 which introduces Windows-specific modifications that are too risky to backport without proper testing setup.

Changes applied:

  • Cherry-picked goodPathsUnix test case from original commit.
  • Updated the existing testcase to use JUnit annotations for execution of both the test cases.

Testing:

  • Local run of jtreg1 is clean.
  • Sensitivity testing - goodPathsUnix test-case fails before the fix and passes after the fix.

Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8259637 needs maintainer approval

Issue

  • JDK-8259637: java.io.File.getCanonicalPath() returns different values for same path (Bug - P4 - Requested)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2457/head:pull/2457
$ git checkout pull/2457

Update a local copy of the PR:
$ git checkout pull/2457
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2457/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2457

View PR using the GUI difftool:
$ git pr show -t 2457

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2457.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 10, 2025

👋 Welcome back vish-chan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Nov 10, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@vish-chan vish-chan changed the title 8259637: java.io.File.getCanonicalPath() returns different values for same path Backport b98d13fc3c7f6747d9201eb884cf9d3181671ccb Nov 10, 2025
@vish-chan vish-chan changed the title Backport b98d13fc3c7f6747d9201eb884cf9d3181671ccb 8259637 - java.io.File.getCanonicalPath() returns different values for same path Nov 10, 2025
@vish-chan vish-chan changed the title 8259637 - java.io.File.getCanonicalPath() returns different values for same path Backport b98d13fc3c7f6747d9201eb884cf9d3181671ccb Nov 10, 2025
@openjdk openjdk bot changed the title Backport b98d13fc3c7f6747d9201eb884cf9d3181671ccb 8259637: java.io.File.getCanonicalPath() returns different values for same path Nov 10, 2025
@openjdk
Copy link

openjdk bot commented Nov 10, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport Port of a pull request already in a different code base label Nov 10, 2025
Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable. I agree there is no reason to backport Windows change.

@vish-chan vish-chan marked this pull request as ready for review November 11, 2025 19:56
@openjdk
Copy link

openjdk bot commented Nov 11, 2025

⚠️ @vish-chan This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 11, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 11, 2025

Webrevs

@vish-chan
Copy link
Author

/approval request for backport of JDK-8259637 which fixes a bug in java.io.File.getCanonicalPath() to no longer return a path that begins with “/../” when canonicalising a path containing redundant parent-directory references. Unclean backport for reasons mentioned in the PR body.

Risk is low: Ran GHA Sanity Checks and jtreg tier1 locally. The updated test fails without the fix and passes with it. The original fix has been in JDK23 since 2023-12-18.

@openjdk
Copy link

openjdk bot commented Nov 11, 2025

@vish-chan
8259637: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants