You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java
-17
Original file line number
Diff line number
Diff line change
@@ -769,7 +769,6 @@ public final JsonToken nextToken() throws IOException
769
769
case'}':
770
770
// Error: } is not valid at this point; valid closers have
771
771
// been handled earlier
772
-
--_inputPtr; // for correct error reporting
773
772
_reportUnexpectedChar(i, "expected a value");
774
773
case't':
775
774
_matchTrue();
@@ -1456,7 +1455,6 @@ private final JsonToken _parseFloat(int ch, int startPtr, int ptr, boolean neg,
1456
1455
// must be followed by sequence of ints, one minimum
1457
1456
if (fractLen == 0) {
1458
1457
if (!isEnabled(JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS.mappedFeature())) {
1459
-
--_inputPtr; // for correct error reporting
1460
1458
_reportUnexpectedNumberChar(ch, "Decimal point not followed by a digit");
1461
1459
}
1462
1460
}
@@ -1486,7 +1484,6 @@ private final JsonToken _parseFloat(int ch, int startPtr, int ptr, boolean neg,
1486
1484
}
1487
1485
// must be followed by sequence of ints, one minimum
1488
1486
if (expLen == 0) {
1489
-
--_inputPtr; // for correct error reporting
1490
1487
_reportUnexpectedNumberChar(ch, "Exponent indicator not followed by a digit");
1491
1488
}
1492
1489
}
@@ -1647,7 +1644,6 @@ private final JsonToken _parseNumber2(boolean neg, int startPtr) throws IOExcept
1647
1644
// must be followed by sequence of ints, one minimum
1648
1645
if (fractLen == 0) {
1649
1646
if (!isEnabled(JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS.mappedFeature())) {
1650
-
--_inputPtr; // for correct error reporting
1651
1647
_reportUnexpectedNumberChar(c, "Decimal point not followed by a digit");
1652
1648
}
1653
1649
}
@@ -1692,7 +1688,6 @@ private final JsonToken _parseNumber2(boolean neg, int startPtr) throws IOExcept
1692
1688
}
1693
1689
// must be followed by sequence of ints, one minimum
1694
1690
if (expLen == 0) {
1695
-
--_inputPtr; // for correct error reporting
1696
1691
_reportUnexpectedNumberChar(c, "Exponent indicator not followed by a digit");
1697
1692
}
1698
1693
}
@@ -1793,13 +1788,11 @@ protected JsonToken _handleInvalidNumberStart(int ch, final boolean negative, fi
1793
1788
}
1794
1789
}
1795
1790
if (!isEnabled(JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS.mappedFeature()) && hasSign && !negative) {
1796
-
--_inputPtr; // for correct error reporting
1797
1791
_reportUnexpectedNumberChar('+', "JSON spec does not allow numbers to have plus signs: enable `JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS` to allow");
1798
1792
}
1799
1793
finalStringmessage = negative ?
1800
1794
"expected digit (0-9) to follow minus sign, for valid numeric value" :
_reportUnexpectedChar(c, "expected a valid value "+_validJsonValueList());
2804
2795
returnnull;
2805
2796
}
@@ -2932,13 +2923,11 @@ protected JsonToken _handleInvalidNumberStart(int ch, final boolean neg, final b
2932
2923
match);
2933
2924
}
2934
2925
if (!isEnabled(JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS.mappedFeature()) && hasSign && !neg) {
2935
-
--_inputPtr; // for correct error reporting
2936
2926
_reportUnexpectedNumberChar('+', "JSON spec does not allow numbers to have plus signs: enable `JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS` to allow");
2937
2927
}
2938
2928
finalStringmessage = neg ?
2939
2929
"expected digit (0-9) to follow minus sign, for valid numeric value" :
2940
2930
"expected digit (0-9) for valid numeric value";
2941
-
--_inputPtr; // for correct error reporting
2942
2931
_reportUnexpectedNumberChar(ch, message);
2943
2932
returnnull;
2944
2933
}
@@ -3264,7 +3253,6 @@ private final int _skipColon2(boolean gotColon) throws IOException
3264
3253
returni;
3265
3254
}
3266
3255
if (i != INT_COLON) {
3267
-
--_inputPtr; // for correct error reporting
3268
3256
_reportUnexpectedChar(i, "was expecting a colon to separate field name and value");
3269
3257
}
3270
3258
gotColon = true;
@@ -3287,7 +3275,6 @@ private final int _skipColon2(boolean gotColon) throws IOException
3287
3275
privatefinalvoid_skipComment() throwsIOException
3288
3276
{
3289
3277
if ((_features & FEAT_MASK_ALLOW_JAVA_COMMENTS) == 0) {
3290
-
--_inputPtr; // for correct error reporting
3291
3278
_reportUnexpectedChar('/', "maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)");
3292
3279
}
3293
3280
// First: check which comment (if either) it is:
@@ -3300,7 +3287,6 @@ private final void _skipComment() throws IOException
3300
3287
} elseif (c == INT_ASTERISK) {
3301
3288
_skipCComment();
3302
3289
} else {
3303
-
--_inputPtr; // for correct error reporting
3304
3290
_reportUnexpectedChar(c, "was expecting either '*' or '/' for a comment");
0 commit comments