8323710: (fc) FileChannel.lock creates a FileKey with a poor hashCode after JDK-8321429 (win)

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2024-01-17 16:34:48 +00:00
parent 19287eeeb2
commit 4e5323538c

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -47,10 +47,7 @@ public class FileKey {
@Override
public int hashCode() {
int h = dwVolumeSerialNumber;
h = h << 31 + nFileIndexHigh;
h = h << 31 + nFileIndexLow;
return h;
return dwVolumeSerialNumber + nFileIndexHigh + nFileIndexLow;
}
@Override