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

Raffaello Giulietti rgiulietti at openjdk.org
Tue Sep 30 14:54:22 UTC 2025


On Wed, 24 Sep 2025 14:59:05 GMT, Johannes Graham <duke at openjdk.org> wrote:

>> When formatting doubles or BigDecimals, DigitList first formats them as a string and then parses the resultant string to extract the mantissa and the exponent. This can be done more directly. This allows removing some parsing code and removes a cached byte array.
>> 
>> This also facilitates potential cleanups in FloatingDecimal (removal of getChars method) but I've left that for later to minimize conflicts with other changes there.
>
> Johannes Graham has updated the pull request incrementally with one additional commit since the last revision:
> 
>   update assert

OK, then feel free to open a JBS issue and work on it.
My patch will take another couple of weeks, so chances for interference are unlikely.

BTW, beyond `getChars()`, I think that `isNegative()` and `isExceptional()` are unused as well, so might be removed in that same PR. Up to you, of course.

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

PR Comment: https://git.openjdk.org/jdk/pull/27118#issuecomment-3352581136


More information about the core-libs-dev mailing list