@@ -757,6 +757,9 @@ public final JsonToken nextToken() throws IOException
757
757
*/
758
758
t = _parseNegNumber ();
759
759
break ;
760
+ case '.' : // [core#61]]
761
+ t = _parseFloatThatStartsWithPeriod ();
762
+ break ;
760
763
case '0' :
761
764
case '1' :
762
765
case '2' :
@@ -950,6 +953,9 @@ public String nextFieldName() throws IOException
950
953
case '-' :
951
954
t = _parseNegNumber ();
952
955
break ;
956
+ case '.' : // [core#61]]
957
+ t = _parseFloatThatStartsWithPeriod ();
958
+ break ;
953
959
case '0' :
954
960
case '1' :
955
961
case '2' :
@@ -1019,6 +1025,9 @@ private final void _isNextTokenNameYes(int i) throws IOException
1019
1025
case '-' :
1020
1026
_nextToken = _parseNegNumber ();
1021
1027
return ;
1028
+ case '.' : // [core#61]]
1029
+ _nextToken = _parseFloatThatStartsWithPeriod ();
1030
+ return ;
1022
1031
case '0' :
1023
1032
case '1' :
1024
1033
case '2' :
@@ -1054,6 +1063,9 @@ protected boolean _isNextTokenNameMaybe(int i, String nameToMatch) throws IOExce
1054
1063
case '-' :
1055
1064
t = _parseNegNumber ();
1056
1065
break ;
1066
+ case '.' : // [core#61]]
1067
+ t = _parseFloatThatStartsWithPeriod ();
1068
+ break ;
1057
1069
case '0' :
1058
1070
case '1' :
1059
1071
case '2' :
@@ -1120,6 +1132,8 @@ private final JsonToken _nextTokenNotInObject(int i) throws IOException
1120
1132
* it is not allowed per se, it may be erroneously used,
1121
1133
* and could be indicated by a more specific error message.
1122
1134
*/
1135
+ case '.' : // [core#61]]
1136
+ return (_currToken = _parseFloatThatStartsWithPeriod ());
1123
1137
case '0' :
1124
1138
case '1' :
1125
1139
case '2' :
@@ -1258,6 +1272,16 @@ public final Boolean nextBooleanValue() throws IOException
1258
1272
/**********************************************************
1259
1273
*/
1260
1274
1275
+ // @since 2.11, [core#611]
1276
+ protected final JsonToken _parseFloatThatStartsWithPeriod () throws IOException
1277
+ {
1278
+ // [core#611]: allow optionally leading decimal point
1279
+ if (!isEnabled (JsonReadFeature .ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS .mappedFeature ())) {
1280
+ return _handleOddValue ('.' );
1281
+ }
1282
+ return _parseFloat (INT_PERIOD , _inputPtr -1 , _inputPtr , false , 0 );
1283
+ }
1284
+
1261
1285
/**
1262
1286
* Initial parsing method for number values. It needs to be able
1263
1287
* to parse enough input to be able to determine whether the
0 commit comments