RFR: 8264400: (fs) WindowsFileStore equality depends on how the FileStore was constructed [v2]

Alan Bateman alanb at openjdk.java.net
Thu Apr 8 08:46:28 UTC 2021


On Wed, 7 Apr 2021 21:54:24 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Please consider this change to make `sun.nio.fs.WindowsFileStore.equals()` return `true` if the root strings of the two objects are equal under case insensitive comparison, and the two `WindowsFileStore`s have the same volume information.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8264400: Constrain to DRIVE_LOCAL case

src/java.base/windows/classes/sun/nio/fs/WindowsFileStore.java line 55:

> 53:     private final String displayName;   // returned by toString
> 54: 
> 55:     private boolean hasHashCode = false; // as hashCode can be any int

This is buggy. It would be simpler to drop hasHashCode and just race when hash is 0.

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

PR: https://git.openjdk.java.net/jdk/pull/3279


More information about the nio-dev mailing list