diff --git a/compiler/rt/libcore/luni/src/main/java/java/lang/Double.java b/compiler/rt/libcore/luni/src/main/java/java/lang/Double.java index 456529b15..b4a66ba35 100755 --- a/compiler/rt/libcore/luni/src/main/java/java/lang/Double.java +++ b/compiler/rt/libcore/luni/src/main/java/java/lang/Double.java @@ -221,6 +221,11 @@ public int hashCode() { return (int) (v ^ (v >>> 32)); } + public static int hashCode(double value) { + long v = doubleToLongBits(value); + return (int) (v ^ (v >>> 32)); + } + @Override public int intValue() { return (int) value; diff --git a/compiler/rt/libcore/luni/src/main/java/java/lang/Float.java b/compiler/rt/libcore/luni/src/main/java/java/lang/Float.java index 900b2a098..f6accba99 100755 --- a/compiler/rt/libcore/luni/src/main/java/java/lang/Float.java +++ b/compiler/rt/libcore/luni/src/main/java/java/lang/Float.java @@ -224,6 +224,10 @@ public int hashCode() { return floatToIntBits(value); } + public static int hashCode(float value) { + return floatToIntBits(value); + } + /** * Returns the IEEE 754 * single precision float corresponding to the given {@code bits}. diff --git a/compiler/rt/libcore/luni/src/main/java/java/lang/Integer.java b/compiler/rt/libcore/luni/src/main/java/java/lang/Integer.java index fc38b416e..6b6aac313 100755 --- a/compiler/rt/libcore/luni/src/main/java/java/lang/Integer.java +++ b/compiler/rt/libcore/luni/src/main/java/java/lang/Integer.java @@ -302,6 +302,10 @@ public int hashCode() { return value; } + public static int hashCode(int value) { + return value; + } + /** * Gets the primitive value of this int. * diff --git a/compiler/rt/libcore/luni/src/main/java/java/lang/Long.java b/compiler/rt/libcore/luni/src/main/java/java/lang/Long.java index 84169af0c..53e144ec5 100755 --- a/compiler/rt/libcore/luni/src/main/java/java/lang/Long.java +++ b/compiler/rt/libcore/luni/src/main/java/java/lang/Long.java @@ -289,6 +289,10 @@ public int hashCode() { return (int) (value ^ (value >>> 32)); } + public static int hashCode(long value) { + return (int) (value ^ (value >>> 32)); + } + @Override public int intValue() { return (int) value; diff --git a/compiler/rt/libcore/luni/src/main/java/java/lang/Short.java b/compiler/rt/libcore/luni/src/main/java/java/lang/Short.java index 4479c4c4f..ad601a1e0 100755 --- a/compiler/rt/libcore/luni/src/main/java/java/lang/Short.java +++ b/compiler/rt/libcore/luni/src/main/java/java/lang/Short.java @@ -169,6 +169,10 @@ public int hashCode() { return value; } + public static int hashCode(short value) { + return value; + } + @Override public int intValue() { return value;