RFR: 8367324: Avoid redundant parsing when formatting with DigitList [v3]

Johannes Graham duke at openjdk.org
Wed Sep 24 14:43:40 UTC 2025


On Wed, 24 Sep 2025 08:21:33 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> Johannes Graham has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   VALUES_SIZE
>
> src/java.base/share/classes/java/text/DigitList.java line 326:
> 
>> 324:         boolean hasBeenRoundedUp = fdConverter.digitsRoundedUp();
>> 325:         boolean valueExactAsDecimal = fdConverter.decimalDigitsExact();
>> 326:         assert !fdConverter.isExceptional();
> 
> Maybe move this `assert` line at method entry.

I moved it up as high as it can go. Alternatively, could be replaced with an assertion against the `source` parameter - `assert Double.isFinite(source)` ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27118#discussion_r2376043188


More information about the core-libs-dev mailing list