RFR: 8365626: (fs) Improve handling of broken links in Files.isSameFile() (win)

Francesco Andreuzzi duke at openjdk.org
Thu Sep 4 09:46:46 UTC 2025


On Thu, 4 Sep 2025 00:30:52 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Improve handling of broken symbolic links in `Files.isSameFile` on Windows as was done on Unix by the fix of [JDK-8154364](https://bugs.openjdk.org/browse/JDK-8154364).

src/java.base/windows/classes/sun/nio/fs/WindowsFileAttributes.java line 477:

> 475:     @Override
> 476:     public int hashCode() {
> 477:         return volSerialNumber + fileIndexHigh + fileIndexLow;

Should we combine these values with something more complex than a sum to reduce potential collisions?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27079#discussion_r2321461288


More information about the nio-dev mailing list