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

Brian Burkhalter bpb at openjdk.java.net
Thu Apr 8 17:01:10 UTC 2021


On Thu, 8 Apr 2021 16:53:30 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8264400: Clean up equals() and hashCode()
>
> src/java.base/windows/classes/sun/nio/fs/WindowsFileStore.java line 56:
> 
>> 54: 
>> 55:     private int hashCode = 0;
>> 56: 
> 
> Good, I think this is safe and equals/hashCode are consistent. I suspect we can extend this to other (maybe all) volume type but it needs a bit more exploration. Minor nit is that you can't need to initialise hashCode to 0.

I think this issue was specific to the `DRIVE_FIXED` case so further enhancement can be done under another issue once the information becomes knowd.

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

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


More information about the nio-dev mailing list