Skip to content

Commit 432b26c

Browse files
committed
Actual fix... :)
1 parent 0980876 commit 432b26c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ private long _getLongValue() throws IOException {
413413
try {
414414
if (this.getNumberType() == NumberType.BIG_INTEGER) {
415415
BigInteger bigInteger = _reader.bigIntegerValue();
416-
if (BI_MIN_INT.compareTo(bigInteger) > 0 || BI_MAX_INT.compareTo(bigInteger) < 0) {
417-
this.reportOverflowLong();
416+
if (BI_MIN_LONG.compareTo(bigInteger) > 0 || BI_MAX_LONG.compareTo(bigInteger) < 0) {
417+
reportOverflowLong();
418418
}
419419
return bigInteger.longValue();
420420
} else {

ion/src/test/java/com/fasterxml/jackson/dataformat/ion/IonNumberOverflowTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private void _testLongCoercionFail(BigInteger input) throws Exception
7878
@Test
7979
public void testLongAsBigIntegerSize() throws Exception {
8080
// Note: Values: Long.MAX_VALUE through Long.MAX_VALUE -7 are considered LONG by Ion.
81-
BigInteger bigIntLongValue = new BigInteger(Long.MAX_VALUE + "").subtract(new BigInteger("10"));
81+
BigInteger bigIntLongValue = new BigInteger(Long.MAX_VALUE + "").subtract(BigInteger.TEN);
8282
IonParser bigIntLongParser = (IonParser) new IonFactory().createParser(bigIntLongValue.toString());
8383
assertEquals(JsonToken.VALUE_NUMBER_INT, bigIntLongParser.nextToken());
8484
assertEquals(JsonParser.NumberType.BIG_INTEGER, bigIntLongParser.getNumberType());

0 commit comments

Comments
 (0)