RFR: JDK-8326908: DecimalFormat::toPattern throws OutOfMemoryError when pattern is empty string

Guoxiong Li gli at openjdk.org
Sun Mar 3 05:02:51 UTC 2024


On Sat, 2 Mar 2024 00:34:32 GMT, Justin Lu <jlu at openjdk.org> wrote:

> When toPattern() is invoked, StringBuilder internally doubles capacity attempting to append Integer.MAX_VALUE digits until OOME occurs.

It seems a bug in `toPattern` or `StringBuilder`? May be better to investigate more about it.

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

PR Comment: https://git.openjdk.org/jdk/pull/18094#issuecomment-1975023075


More information about the core-libs-dev mailing list