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

Brian Burkhalter bpb at openjdk.org
Thu Jun 26 16:08:30 UTC 2025


On Thu, 26 Jun 2025 06:51:14 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> Exactly, so I think the first step here has to validate that where we ended up in WindowsPath.compareTo is correct.

`WindowsPath.compareTo` returns zero (equal) if and only if the path strings are the same length, and the two characters in each pair of corresponding characters in the strings are either already equal, or are equal after being converted to upper case. Unless case sensitivity or locale were to be admitted, it's not clear to me whether, using the strings alone, anything substantively different could be done.

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

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


More information about the core-libs-dev mailing list