Skip to content

Commit d737866

Browse files
committed
Minor fix to leading dot, reader-based parser
1 parent d0ef665 commit d737866

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/fasterxml/jackson/core/json/ReaderBasedJsonParser.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -1600,7 +1600,10 @@ private final JsonToken _parseNumber2(boolean neg, int startPtr) throws IOExcept
16001600
}
16011601
// Also, integer part is not optional
16021602
if (intLen == 0) {
1603-
return _handleInvalidNumberStart(c, neg);
1603+
// [core#611]: allow optionally leading decimal point
1604+
if (!isEnabled(JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS.mappedFeature())) {
1605+
return _handleInvalidNumberStart(c, neg);
1606+
}
16041607
}
16051608

16061609
int fractLen = 0;

src/test/java/com/fasterxml/jackson/core/read/NonStandardNumberParsingTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void testLeadingDotInDecimalAllowedBytes() throws Exception {
8383

8484
public void testLeadingDotInDecimalAllowedReader() throws Exception {
8585
_testLeadingDotInDecimalAllowed(jsonFactory(), MODE_READER);
86-
// _testLeadingDotInDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
86+
_testLeadingDotInDecimalAllowed(jsonFactory(), MODE_READER_THROTTLED);
8787
}
8888

8989
public void testTrailingDotInDecimalAllowedDataInput() throws Exception {

0 commit comments

Comments
 (0)