On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu <j...@openjdk.org> wrote:

> As discussed in 
> https://github.com/openjdk/jdk/pull/19513#discussion_r1684957942, there is 
> code within java.text.NumberFormat (and subclasses) that can use the pattern 
> match switch to improve readability.
> 
> As this is simply cleanup, there is no regression test added.

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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20302#discussion_r1688449249

Reply via email to