JDK 16 RFR of JDK-5017980: Allow signed positive integer to be parsed instead of a NumerFormatException

Joe Darcy joe.darcy at oracle.com
Thu Aug 6 06:47:15 UTC 2020


Hello,

Please review the patch below and CSR for

     JDK-8249273: Documentation of BigInteger(String) constructor does 
not mention leading plus
     CSR: https://bugs.openjdk.java.net/browse/JDK-8251235

The fix for JDK-5017980 way back in JDK 7 omitted the spec update to one 
of the two BigInteger constructors that accept string arguments. The fix 
is to add the missing "or plus" text. The regression tests already probe 
for the kind of values in question.

Thanks,

-Joe

(I'll reflow the paragraph before pushing.)

diff -r 7a3522ab48b3 src/java.base/share/classes/java/math/BigInteger.java
--- a/src/java.base/share/classes/java/math/BigInteger.java    Wed Aug 
05 23:02:22 2020 -0700
+++ b/src/java.base/share/classes/java/math/BigInteger.java    Wed Aug 
05 23:18:11 2020 -0700
@@ -659,7 +659,7 @@

      /**
       * Translates the decimal String representation of a BigInteger into a
-     * BigInteger.  The String representation consists of an optional minus
+     * BigInteger.  The String representation consists of an optional 
minus or plus
       * sign followed by a sequence of one or more decimal digits.  The
       * character-to-digit mapping is provided by {@code Character.digit}.
       * The String may not contain any extraneous characters 
(whitespace, for



More information about the core-libs-dev mailing list