RFR: 8233760: Result of BigDecimal.toString throws overflow exception on new BigDecimal(str)

Joe Darcy darcy at openjdk.java.net
Fri May 27 20:19:29 UTC 2022


On Thu, 26 May 2022 18:02:14 GMT, Raffaello Giulietti <duke at openjdk.java.net> wrote:

> BigDecimal(String) currently fails to accept some strings produced by BigDecimal.toString(). This PR removes this limitation.

test/jdk/java/math/BigDecimal/StringConstructor.java line 69:

> 67:         constructWithError("0.01e"+Integer.MIN_VALUE);
> 68:         constructWithError("1e"+((long)Integer.MIN_VALUE-1));
> 69: 

Please add some test cases to demonstrate that the round-tripping that previous did not work is functional after the fix.

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

PR: https://git.openjdk.java.net/jdk/pull/8905


More information about the core-libs-dev mailing list