@@ -1114,7 +1114,7 @@ protected JsonToken _startFalseToken() throws IOException
1114
1114
&& (getByteFromBuffer (ptr ++) == 's' )
1115
1115
&& (getByteFromBuffer (ptr ++) == 'e' )) {
1116
1116
int ch = getByteFromBuffer (ptr ) & 0xFF ;
1117
- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1117
+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
1118
1118
_inputPtr = ptr ;
1119
1119
return _valueComplete (JsonToken .VALUE_FALSE );
1120
1120
}
@@ -1132,7 +1132,7 @@ protected JsonToken _startTrueToken() throws IOException
1132
1132
&& (getByteFromBuffer (ptr ++) == 'u' )
1133
1133
&& (getByteFromBuffer (ptr ++) == 'e' )) {
1134
1134
int ch = getByteFromBuffer (ptr ) & 0xFF ;
1135
- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1135
+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
1136
1136
_inputPtr = ptr ;
1137
1137
return _valueComplete (JsonToken .VALUE_TRUE );
1138
1138
}
@@ -1150,7 +1150,7 @@ protected JsonToken _startNullToken() throws IOException
1150
1150
&& (getByteFromBuffer (ptr ++) == 'l' )
1151
1151
&& (getByteFromBuffer (ptr ++) == 'l' )) {
1152
1152
int ch = getByteFromBuffer (ptr ) & 0xFF ;
1153
- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1153
+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
1154
1154
_inputPtr = ptr ;
1155
1155
return _valueComplete (JsonToken .VALUE_NULL );
1156
1156
}
@@ -1172,7 +1172,7 @@ protected JsonToken _finishKeywordToken(String expToken, int matched,
1172
1172
}
1173
1173
int ch = getByteFromBuffer (_inputPtr );
1174
1174
if (matched == end ) { // need to verify trailing separator
1175
- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1175
+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
1176
1176
return _valueComplete (result );
1177
1177
}
1178
1178
break ;
@@ -1212,7 +1212,7 @@ protected JsonToken _finishNonStdToken(int type, int matched) throws IOException
1212
1212
}
1213
1213
int ch = getByteFromBuffer (_inputPtr );
1214
1214
if (matched == end ) { // need to verify trailing separator
1215
- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1215
+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
1216
1216
return _valueNonStdNumberComplete (type );
1217
1217
}
1218
1218
break ;
@@ -1515,7 +1515,7 @@ protected JsonToken _startNumberLeadingZero() throws IOException
1515
1515
// Ok; unfortunately we have closing bracket/curly that are valid so need
1516
1516
// (colon not possible since this is within value, not after key)
1517
1517
//
1518
- if ((ch != INT_RBRACKET ) && ( ch != INT_RCURLY )) {
1518
+ if ((ch | 0x20 ) != INT_RCURLY ) { // ~ '}]'
1519
1519
--_inputPtr ; // for correct error reporting
1520
1520
_reportUnexpectedNumberChar (ch ,
1521
1521
"expected digit (0-9), decimal point (.) or exponent indicator (e/E) to follow '0'" );
@@ -1617,7 +1617,7 @@ protected JsonToken _finishNumberLeadingZeroes() throws IOException
1617
1617
// Ok; unfortunately we have closing bracket/curly that are valid so need
1618
1618
// (colon not possible since this is within value, not after key)
1619
1619
//
1620
- if ((ch != INT_RBRACKET ) && ( ch != INT_RCURLY )) {
1620
+ if ((ch | 0x20 ) != INT_RCURLY ) { // ~ '}]'
1621
1621
--_inputPtr ; // for correct error reporting
1622
1622
_reportUnexpectedNumberChar (ch ,
1623
1623
"expected digit (0-9), decimal point (.) or exponent indicator (e/E) to follow '0'" );
@@ -1678,7 +1678,7 @@ protected JsonToken _finishNumberLeadingPosNegZeroes(final boolean negative) thr
1678
1678
// Ok; unfortunately we have closing bracket/curly that are valid so need
1679
1679
// (colon not possible since this is within value, not after key)
1680
1680
//
1681
- if ((ch != INT_RBRACKET ) && ( ch != INT_RCURLY )) {
1681
+ if ((ch | 0x20 ) != INT_RCURLY ) { // ~ '}]'
1682
1682
--_inputPtr ; // for correct error reporting
1683
1683
_reportUnexpectedNumberChar (ch ,
1684
1684
"expected digit (0-9), decimal point (.) or exponent indicator (e/E) to follow '0'" );
0 commit comments