8268113: Re-use Long.hashCode() where possible
Reviewed-by: redestad
This commit is contained in:
parent
2536e4342e
commit
6a3f8343bc
@ -877,8 +877,7 @@ public final class Double extends Number
|
||||
* @since 1.8
|
||||
*/
|
||||
public static int hashCode(double value) {
|
||||
long bits = doubleToLongBits(value);
|
||||
return (int)(bits ^ (bits >>> 32));
|
||||
return Long.hashCode(doubleToLongBits(value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1596,8 +1596,7 @@ public final class LocalTime
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
long nod = toNanoOfDay();
|
||||
return (int) (nod ^ (nod >>> 32));
|
||||
return Long.hashCode(toNanoOfDay());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
@ -111,8 +111,7 @@ public final class JRSUIConstants {
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
final long bits = Double.doubleToLongBits(doubleValue);
|
||||
return (int)(bits ^ (bits >>> 32));
|
||||
return Double.hashCode(doubleValue);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
@ -123,8 +123,7 @@ public class DoubleDV extends TypeValidator {
|
||||
if (value == 0d) {
|
||||
return 0;
|
||||
}
|
||||
long v = Double.doubleToLongBits(value);
|
||||
return (int) (v ^ (v >>> 32));
|
||||
return Double.hashCode(value);
|
||||
}
|
||||
|
||||
// NOTE: 0.0 is equal but not identical to -0.0
|
||||
|
@ -276,7 +276,7 @@ class Selector {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (int) (asBits() ^ (asBits() >>> 32));
|
||||
return Long.hashCode(asBits());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user