Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v3]

2024-07-24 Thread Justin Lu
On Wed, 24 Jul 2024 19:45:45 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v3]

2024-07-24 Thread Chen Liang
On Wed, 24 Jul 2024 19:45:45 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v3]

2024-07-24 Thread Naoto Sato
On Wed, 24 Jul 2024 19:45:45 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v3]

2024-07-24 Thread Justin Lu
> 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. (Tiers 1-3 and

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v2]

2024-07-24 Thread Andrey Turbanov
On Tue, 23 Jul 2024 20:54:08 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v2]

2024-07-24 Thread Naoto Sato
On Tue, 23 Jul 2024 20:54:08 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v2]

2024-07-24 Thread Chen Liang
On Tue, 23 Jul 2024 20:54:08 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes [v2]

2024-07-23 Thread Justin Lu
> 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. (Tiers 1-3 and

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Abdelhak Zaaim
On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu 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

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Naoto Sato
On Tue, 23 Jul 2024 18:33:47 GMT, Justin Lu wrote: >> 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, >

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Justin Lu
On Tue, 23 Jul 2024 18:04:54 GMT, Naoto Sato 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); >

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Naoto Sato
On Tue, 23 Jul 2024 17:29:10 GMT, Justin Lu 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 c

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Chen Liang
On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu 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

Re: RFR: 8336847: Use pattern match switch in NumberFormat classes

2024-07-23 Thread Justin Lu
On Tue, 23 Jul 2024 17:28:02 GMT, Justin Lu 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