RFR: JDK-8326908: DecimalFormat::toPattern throws OutOfMemoryError when pattern is empty string [v3]
Justin Lu
jlu at openjdk.org
Tue Mar 5 21:27:09 UTC 2024
> Please review this PR and corresponding CSR which prevents an OutOfMemoryError by restricting the initial maximum fraction digits for an empty pattern DecimalFormat.
>
> For an empty String pattern DecimalFormat, the maximum fraction digits is initialized to `Integer.MAX_VALUE`. When toPattern() is invoked, StringBuilder internally doubles capacity attempting to append Integer.MAX_VALUE digits until OOME occurs. CSR covers potential behavioral compatibility changes.
Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
reflect review
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/18094/files
- new: https://git.openjdk.org/jdk/pull/18094/files/7ca56500..7ee87fc2
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=18094&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=18094&range=01-02
Stats: 20 lines in 2 files changed: 8 ins; 4 del; 8 mod
Patch: https://git.openjdk.org/jdk/pull/18094.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/18094/head:pull/18094
PR: https://git.openjdk.org/jdk/pull/18094
More information about the core-libs-dev
mailing list