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

Alan Bateman alanb at openjdk.org
Tue Sep 30 13:29:13 UTC 2025


On Thu, 12 Jun 2025 21:12:53 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)`.

I think it is risky to change behavior after 20+ years. I think we got it right with WindowsPath but changing File means working through the compatibility impact and probably a system property to restore long standing behavior.

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

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


More information about the core-libs-dev mailing list