diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TInteger.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TInteger.java index b407aaaf0..8f781ad3d 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TInteger.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TInteger.java @@ -42,6 +42,10 @@ public class TInteger extends TNumber implements TComparable { return new TAbstractStringBuilder(20).append(i, radix).toString(); } + public static int hashCode(int value) { + return (value >>> 4) ^ (value << 28) ^ (value << 8) ^ (value >>> 24); + } + public static String toHexString(int i) { return toUnsignedLogRadixString(i, 4); } @@ -156,7 +160,7 @@ public class TInteger extends TNumber implements TComparable { @Override public int hashCode() { - return (value >>> 4) ^ (value << 28) ^ (value << 8) ^ (value >>> 24); + return TInteger.hashCode(value); } @Override