8268113: Re-use Long.hashCode() where possible

Reviewed-by: redestad
This commit is contained in:
Sergey Tsypanov 2021-08-02 12:49:41 +00:00 committed by Claes Redestad
parent 2536e4342e
commit 6a3f8343bc
6 changed files with 6 additions and 10 deletions

View file

@ -1596,8 +1596,7 @@ public final class LocalTime
*/
@Override
public int hashCode() {
long nod = toNanoOfDay();
return (int) (nod ^ (nod >>> 32));
return Long.hashCode(toNanoOfDay());
}
//-----------------------------------------------------------------------

View file

@ -410,7 +410,7 @@ public final class ValueRange implements Serializable {
long hash = minSmallest + (minLargest << 16) + (minLargest >> 48) +
(maxSmallest << 32) + (maxSmallest >> 32) + (maxLargest << 48) +
(maxLargest >> 16);
return (int) (hash ^ (hash >>> 32));
return Long.hashCode(hash);
}
//-----------------------------------------------------------------------