RFR: 8191963: Path.equals() and File.equals() return true for two different files on Windows [v3]

Roger Riggs rriggs at openjdk.org
Mon Oct 20 16:02:08 UTC 2025


On Tue, 14 Oct 2025 20:55:33 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Replace logic in `java.io.WinNTFileSystems.compare(File,File)` with that from `sun.nio.fs.WindowsPath.compareTo(Path)`.
>
> 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 five additional commits since the last revision:
> 
>  - 8191963: Make legacy behavior be the default
>  - Merge
>  - 8191963: Add system property to enable legacy behavior
>  - Merge
>  - 8191963: Path.equals() and File.equals() return true for two different files on Windows

Given the comment about the new property not being used and the long standing behavior I'd suggest NOT fixing File because it would be an incompatible change. It avoids adding new long term property and behavior that can't be removed. The workaround and recommendation is to use Path.

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

PR Comment: https://git.openjdk.org/jdk/pull/25788#issuecomment-3422727316


More information about the core-libs-dev mailing list