Skip to content

8191963: Path.equals() and File.equals() return true for two different files on Windows #25788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bplb
Copy link
Member

@bplb bplb commented Jun 12, 2025

Replace logic in java.io.WinNTFileSystems.compare(File,File) with that from sun.nio.fs.WindowsPath.compareTo(Path).


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

Issue

  • JDK-8191963: Path.equals() and File.equals() return true for two different files on Windows (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25788/head:pull/25788
$ git checkout pull/25788

Update a local copy of the PR:
$ git checkout pull/25788
$ git pull https://git.openjdk.org/jdk.git pull/25788/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25788

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25788.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 12, 2025

👋 Welcome back bpb! 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 Jun 12, 2025

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

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 12, 2025
@openjdk
Copy link

openjdk bot commented Jun 12, 2025

@bplb The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@mlbridge
Copy link

mlbridge bot commented Jun 12, 2025

Webrevs

@xuemingshen-oracle
Copy link

xuemingshen-oracle commented Jun 16, 2025

Just wondering how Windows implementation really behaves for its 'case-insensitive-comparing" for "\u0131 vs "I". I would assume they actually are 2 'distinguished" files?

@AlanBateman
Copy link
Contributor

Just wondering how Windows implementation really behaves for its 'case-insensitive-comparing" for "\u0131 vs "I". I would assume they actually are 2 'distinguished" files?

I think it depends on the locale. Also it is possible to configure NTFS, on a per directory basis, to disable the directory the case sensitivity. WindowsPath.compareTo is where we ended up for JDK 7, it would be good to validate this.

@bplb
Copy link
Member Author

bplb commented Jun 23, 2025

WindowsPath.compareTo is where we ended up for JDK 7, it would be good to validate this.

I assume that you intend here validating correctness with respect to the NTFS case sensitivity settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

3 participants