fix Integer.toHexString to treat its argument as unsigned

This commit is contained in:
Joel Dice 2007-12-26 12:17:52 -07:00
parent 6ed28a13c3
commit be5600d79d

View File

@ -45,7 +45,7 @@ public final class Integer extends Number implements Comparable<Integer> {
}
public static String toHexString(int v) {
return toString(v, 16);
return Long.toString(((long) v) & 0xFFFFFFFFL, 16);
}
public byte byteValue() {