8249273: Documentation of BigInteger(String) constructor does not mention leading plus

Reviewed-by: bpb
This commit is contained in:
Joe Darcy 2020-08-06 09:58:57 -07:00
parent db4d59cc0c
commit 99c7b2b85b

View file

@ -464,9 +464,10 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
* specified radix into a BigInteger. The String representation * specified radix into a BigInteger. The String representation
* consists of an optional minus or plus sign followed by a * consists of an optional minus or plus sign followed by a
* sequence of one or more digits in the specified radix. The * sequence of one or more digits in the specified radix. The
* character-to-digit mapping is provided by {@code * character-to-digit mapping is provided by {@link
* Character.digit}. The String may not contain any extraneous * Character#digit(char, char) Character.digit}. The String may
* characters (whitespace, for example). * not contain any extraneous characters (whitespace, for
* example).
* *
* @param val String representation of BigInteger. * @param val String representation of BigInteger.
* @param radix radix to be used in interpreting {@code val}. * @param radix radix to be used in interpreting {@code val}.
@ -474,7 +475,6 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
* of a BigInteger in the specified radix, or {@code radix} is * of a BigInteger in the specified radix, or {@code radix} is
* outside the range from {@link Character#MIN_RADIX} to * outside the range from {@link Character#MIN_RADIX} to
* {@link Character#MAX_RADIX}, inclusive. * {@link Character#MAX_RADIX}, inclusive.
* @see Character#digit
*/ */
public BigInteger(String val, int radix) { public BigInteger(String val, int radix) {
int cursor = 0, numDigits; int cursor = 0, numDigits;
@ -658,17 +658,17 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
} }
/** /**
* Translates the decimal String representation of a BigInteger into a * Translates the decimal String representation of a BigInteger
* BigInteger. The String representation consists of an optional minus * into a BigInteger. The String representation consists of an
* sign followed by a sequence of one or more decimal digits. The * optional minus or plus sign followed by a sequence of one or
* character-to-digit mapping is provided by {@code Character.digit}. * more decimal digits. The character-to-digit mapping is
* The String may not contain any extraneous characters (whitespace, for * provided by {@link Character#digit(char, char)
* example). * Character.digit}. The String may not contain any extraneous
* characters (whitespace, for example).
* *
* @param val decimal String representation of BigInteger. * @param val decimal String representation of BigInteger.
* @throws NumberFormatException {@code val} is not a valid representation * @throws NumberFormatException {@code val} is not a valid representation
* of a BigInteger. * of a BigInteger.
* @see Character#digit
*/ */
public BigInteger(String val) { public BigInteger(String val) {
this(val, 10); this(val, 10);