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

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Fri Apr 9 22:27:27 UTC 2021


On Fri, 9 Apr 2021 15:34:44 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: Remove vestigial FileSystems.getDefault()

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

> 255:                 root.toLowerCase(Locale.ROOT).hashCode() : root.hashCode();
> 256:         }
> 257:         return hashCode;

As I know, to make data race benign, field should be read only once. But there is second read which can still return `0`

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

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


More information about the nio-dev mailing list