XStream
  1. XStream
  2. XSTR-382

hexadecimal and octal unsigned number values parsing

    Details

    • Type: Improvement Improvement
    • Status: Closed 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).

        People

        • Assignee:
          Unassigned
          Reporter:
          Nicolas Gros d'Aillon
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: