8265100: (fs) WindowsFileStore.hashCode() should read cached hash code once

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2021-04-13 18:43:33 +00:00
parent 8df8512bc8
commit 3b576ed99d

View File

@ -250,11 +250,13 @@ class WindowsFileStore
@Override
public int hashCode() {
if (hashCode == 0) { // Don't care about race
hashCode = (volType == DRIVE_FIXED) ?
int hc = hashCode;
if (hc == 0) {
hc = (volType == DRIVE_FIXED) ?
root.toLowerCase(Locale.ROOT).hashCode() : root.hashCode();
hashCode = hc;
}
return hashCode;
return hc;
}
@Override