Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8367703

Unneeded cast in java.text.DigitList.append

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • 26
    • core-libs
    • Fix Understood
    • generic
    • generic

      DecimalFormat uses DigitList.append for parsing routines.

      During the append process:

      An int from range 0 to 9 is converted to a char of '0' to '9'. This char is then converted to a byte (the code points 48 - 57).

      Explicitly it is int -> char -> byte.

      This could be simplified (explicitly) to int -> byte w/o the need for the intermediate cast to char.

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: