<i18n dev> RFR: 8367703: Unneeded cast in java.text.DigitList.append

Justin Lu jlu at openjdk.org
Mon Sep 15 21:25:00 UTC 2025


During parse routines, DecimalFormat uses DigitList to append digits from the parsed text.

Note that `digit` is always the int value 0 through 9 (and subsequently the code point 48 through 57) when passed to `append`.

Currently, `append` accepts a char which forces an int -> char -> byte conversion to be stored in `digits`. This can be simplified to int -> byte if the parameter type for the method is updated. The two call sites can safely make this swap.

Tiers 1-3 and java.text JCK tests continue to pass with this change.

-------------

Commit messages:
 - init

Changes: https://git.openjdk.org/jdk/pull/27300/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27300&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8367703
  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/27300.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27300/head:pull/27300

PR: https://git.openjdk.org/jdk/pull/27300


More information about the i18n-dev mailing list