[jdk21u-dev] RFR: 8331485: Odd Results when Parsing Scientific Notation with Large Exponent [v2]

Roland Mesde duke at openjdk.org
Tue Nov 18 23:05:13 UTC 2025


> Backporting JDK-8331485: Odd Results when Parsing Scientific Notation with Large Exponent.
> 
> Problem: DecimalFormat incorrectly parses strings with very large exponents:
> 
> - Exponents > Integer.MAX_VALUE return 0.0
> - Exponents > Long.MAX_VALUE return the mantissa value
> 
> Fix: DecimalFormat.parse() now returns Double.POSITIVE_INFINITY for very large exponents, matching Double.parseDouble() behavior.
> 
> Impact: Eliminates edge case bug and provides consistent parsing behavior across Java's number parsing APIs.
> 
> Ran GHA Sanity Checks (passed) and related test (passed).

Roland Mesde has updated the pull request incrementally with one additional commit since the last revision:

  Removed LenientParseTest.java that is part of JDK-8327640 (Large and Required CSR)

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

Changes:
  - all: https://git.openjdk.org/jdk21u-dev/pull/2481/files
  - new: https://git.openjdk.org/jdk21u-dev/pull/2481/files/3595aa07..d8d611af

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=2481&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=2481&range=00-01

  Stats: 430 lines in 1 file changed: 0 ins; 430 del; 0 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/2481.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/2481/head:pull/2481

PR: https://git.openjdk.org/jdk21u-dev/pull/2481


More information about the jdk-updates-dev mailing list