Skip to content

Commit c4414c6

Browse files
committed
remove problematic bigint optimisation (FasterXML#987)
1 parent b6ce6b0 commit c4414c6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/main/java/com/fasterxml/jackson/core/io/NumberInput.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
public final class NumberInput
1010
{
11-
// numbers with more than these characters are better parsed with BigDecimalParser
12-
// parsing numbers with many digits in Java is slower than O(n)
13-
private final static int LARGE_INT_SIZE = 1250;
14-
1511
/**
1612
* Formerly used constant for a value that was problematic on certain
1713
* pre-1.8 JDKs.
@@ -398,10 +394,7 @@ public static BigDecimal parseBigDecimal(char[] ch) throws NumberFormatException
398394
* @throws NumberFormatException if string cannot be represented by a BigInteger
399395
* @since v2.14
400396
*/
401-
public static BigInteger parseBigInteger(String s) throws NumberFormatException {
402-
if (s.length() > LARGE_INT_SIZE) {
403-
return BigDecimalParser.parse(s).toBigInteger();
404-
}
397+
public static BigInteger parseBigInteger(final String s) throws NumberFormatException {
405398
return new BigInteger(s);
406399
}
407400
}

0 commit comments

Comments
 (0)