RFR: 8367324: Avoid redundant parsing when formatting with DigitList

Raffaello Giulietti rgiulietti at openjdk.org
Wed Sep 10 14:03:52 UTC 2025


On Fri, 5 Sep 2025 14:18:19 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.

Please go ahead with your PR, regardless of mine.
I'll reintroduce the removed code with the next commit, sometimes next week.

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

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


More information about the core-libs-dev mailing list