On Tue, 23 Jul 2024 18:04:54 GMT, Naoto Sato <na...@openjdk.org> wrote:
>> src/java.base/share/classes/java/text/DecimalFormat.java line 1797: >> >>> 1795: case Long l -> digitList.set(isNegative, l, maxDigits); >>> 1796: case BigInteger bi -> digitList.set(isNegative, bi, >>> maxDigits); >>> 1797: default -> {} // do nothing >> >> default case could also be thrown `AssertionError` if preferred. > > Or a simple `assert` statement, as throwing an Error could change the behavior Either of the 3 is fine with me. In this case, I think `AssertionError` is harmless, because AFAICT it is internally used by CompactNumberFormat only, and so throwing may prevent potential incorrect uses in the future. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20302#discussion_r1688523933