Summary
Correct the BigInteger​(String val)
to state its long-standing acceptance of a leading +
as valid input.
Problem
The spec changes for JDK-5017980 omitted the update for one of the two BigInteger
constructors taking a string as input.
Solution
Update the spec of BigInteger​(String val)
to match its long-standing behavior of accepting a leading +
.
Specification
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
- csr of
-
JDK-8249273 Documentation of BigInteger(String) constructor does not mention leading plus
-
- Closed
-