@@ -1132,17 +1132,20 @@ private final JsonToken _nextTokenNotInObject(int i) throws IOException
1132
1132
return (_currToken = _parsePosNumber (i ));
1133
1133
/*
1134
1134
* This check proceeds only if the Feature.ALLOW_MISSING_VALUES is enabled
1135
- * The Check is for missing values. Incase of missing values in an array, the next token will be either ',' or ']'.
1135
+ * The Check is for missing values. In case of missing values in an array, the next token will be either ',' or ']'.
1136
1136
* This case, decrements the already incremented _inputPtr in the buffer in case of comma(,)
1137
1137
* so that the existing flow goes back to checking the next token which will be comma again and
1138
1138
* it continues the parsing.
1139
1139
* Also the case returns NULL as current token in case of ',' or ']'.
1140
1140
*/
1141
+ // case ']': // 11-May-2020, tatu: related to [core#616], this should never be reached
1141
1142
case ',' :
1142
- case ']' :
1143
- if ((_features & FEAT_MASK_ALLOW_MISSING ) != 0 ) {
1144
- --_inputPtr ;
1145
- return (_currToken = JsonToken .VALUE_NULL );
1143
+ // 11-May-2020, tatu: [core#616] No commas in root level
1144
+ if (!_parsingContext .inRoot ()) {
1145
+ if ((_features & FEAT_MASK_ALLOW_MISSING ) != 0 ) {
1146
+ --_inputPtr ;
1147
+ return (_currToken = JsonToken .VALUE_NULL );
1148
+ }
1146
1149
}
1147
1150
}
1148
1151
return (_currToken = _handleOddValue (i ));
@@ -1881,9 +1884,12 @@ protected JsonToken _handleOddValue(int i) throws IOException
1881
1884
}
1882
1885
// fall through
1883
1886
case ',' :
1884
- if ((_features & FEAT_MASK_ALLOW_MISSING ) != 0 ) {
1885
- --_inputPtr ;
1886
- return JsonToken .VALUE_NULL ;
1887
+ // 11-May-2020, tatu: [core#616] No commas in root level
1888
+ if (!_parsingContext .inRoot ()) {
1889
+ if ((_features & FEAT_MASK_ALLOW_MISSING ) != 0 ) {
1890
+ --_inputPtr ;
1891
+ return JsonToken .VALUE_NULL ;
1892
+ }
1887
1893
}
1888
1894
break ;
1889
1895
case 'N' :
0 commit comments