Details
-
Type: Improvement
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.2.2
-
Component/s: None
-
Labels:None
Description
The standard sun JDK doesn't handle the parsing of negative in hexadecimal or octal if there is not a minus sing in front. In this case, we can't parse 0xFFFF as a short with the value -1, the -0x1value must be used.
It seems that eventif in febuary 1999 someone complained about the problem with Integer.valueOf(Integer.toHexString(-1), 16), none of the java version 1.4, 1.5 and event 1.6 can handle unsigned values while parsing strings. The most effective way to parse the numbers would be to completly reimplement the decode()/valueOf()/parseXXX() of the numeric types, but I just used some work-around by using a bigger type of number (except for long).
Thanks for the patch, applied.