On Tue, 5 Mar 2024 00:15:10 GMT, Justin Lu <j...@openjdk.org> wrote: > For clarification, this is entirely a bug with DecimalFormat, not > StringBuilder. An empty String pattern DecimalFormat sets the maximum > fraction digits to Integer.MAX_VALUE. When toPattern() is invoked, the local > StringBuilder will append until an OOME is thrown by the StringBuilder as > there is not enough memory, when internally, the buffer is doubled for a > value too large. But such an OOME would occur for any large enough value, so > the issue lies with DecimalFormat.
Got it. Thanks for your explanation. ------------- PR Comment: https://git.openjdk.org/jdk/pull/18094#issuecomment-1978591032