@@ -1107,7 +1107,7 @@ protected JsonToken _startFalseToken() throws IOException
11071107 && (getByteFromBuffer (ptr ++) == 's' )
11081108 && (getByteFromBuffer (ptr ++) == 'e' )) {
11091109 int ch = getByteFromBuffer (ptr ) & 0xFF ;
1110- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1110+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
11111111 _inputPtr = ptr ;
11121112 return _valueComplete (JsonToken .VALUE_FALSE );
11131113 }
@@ -1125,7 +1125,7 @@ protected JsonToken _startTrueToken() throws IOException
11251125 && (getByteFromBuffer (ptr ++) == 'u' )
11261126 && (getByteFromBuffer (ptr ++) == 'e' )) {
11271127 int ch = getByteFromBuffer (ptr ) & 0xFF ;
1128- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1128+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
11291129 _inputPtr = ptr ;
11301130 return _valueComplete (JsonToken .VALUE_TRUE );
11311131 }
@@ -1143,7 +1143,7 @@ protected JsonToken _startNullToken() throws IOException
11431143 && (getByteFromBuffer (ptr ++) == 'l' )
11441144 && (getByteFromBuffer (ptr ++) == 'l' )) {
11451145 int ch = getByteFromBuffer (ptr ) & 0xFF ;
1146- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1146+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
11471147 _inputPtr = ptr ;
11481148 return _valueComplete (JsonToken .VALUE_NULL );
11491149 }
@@ -1165,7 +1165,7 @@ protected JsonToken _finishKeywordToken(String expToken, int matched,
11651165 }
11661166 int ch = getByteFromBuffer (_inputPtr );
11671167 if (matched == end ) { // need to verify trailing separator
1168- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1168+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
11691169 return _valueComplete (result );
11701170 }
11711171 break ;
@@ -1205,7 +1205,7 @@ protected JsonToken _finishNonStdToken(int type, int matched) throws IOException
12051205 }
12061206 int ch = getByteFromBuffer (_inputPtr );
12071207 if (matched == end ) { // need to verify trailing separator
1208- if (ch < INT_0 || (ch == INT_RBRACKET ) || ( ch == INT_RCURLY )) { // expected/allowed chars
1208+ if (ch < INT_0 || (ch | 0x20 ) == INT_RCURLY ) { // < '0' || ~ '}]' expected/allowed chars
12091209 return _valueNonStdNumberComplete (type );
12101210 }
12111211 break ;
@@ -1306,7 +1306,7 @@ protected JsonToken _startPositiveNumber(int ch) throws IOException
13061306 break ;
13071307 }
13081308 if (ch > INT_9 ) {
1309- if (ch == INT_e || ch == INT_E ) {
1309+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
13101310 _intLength = outPtr ;
13111311 ++_inputPtr ;
13121312 return _startFloat (outBuf , outPtr , ch );
@@ -1373,7 +1373,7 @@ protected JsonToken _startNegativeNumber() throws IOException
13731373 break ;
13741374 }
13751375 if (ch > INT_9 ) {
1376- if (ch == INT_e || ch == INT_E ) {
1376+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
13771377 _intLength = outPtr -1 ;
13781378 ++_inputPtr ;
13791379 return _startFloat (outBuf , outPtr , ch );
@@ -1445,7 +1445,7 @@ protected JsonToken _startPositiveNumber() throws IOException
14451445 break ;
14461446 }
14471447 if (ch > INT_9 ) {
1448- if (ch == INT_e || ch == INT_E ) {
1448+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
14491449 _intLength = outPtr -1 ;
14501450 ++_inputPtr ;
14511451 return _startFloat (outBuf , outPtr , ch );
@@ -1492,7 +1492,7 @@ protected JsonToken _startNumberLeadingZero() throws IOException
14921492 return _startFloat (outBuf , 1 , ch );
14931493 }
14941494 } else if (ch > INT_9 ) {
1495- if (ch == INT_e || ch == INT_E ) {
1495+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
14961496 _inputPtr = ptr ;
14971497 _intLength = 1 ;
14981498 char [] outBuf = _textBuffer .emptyAndGetCurrentSegment ();
@@ -1502,7 +1502,7 @@ protected JsonToken _startNumberLeadingZero() throws IOException
15021502 // Ok; unfortunately we have closing bracket/curly that are valid so need
15031503 // (colon not possible since this is within value, not after key)
15041504 //
1505- if ((ch != INT_RBRACKET ) && ( ch != INT_RCURLY )) {
1505+ if ((ch | 0x20 ) != INT_RCURLY ) { // ~ '}]'
15061506 _reportUnexpectedNumberChar (ch ,
15071507 "expected digit (0-9), decimal point (.) or exponent indicator (e/E) to follow '0'" );
15081508 }
@@ -1590,7 +1590,7 @@ protected JsonToken _finishNumberLeadingZeroes() throws IOException
15901590 return _startFloat (outBuf , 1 , ch );
15911591 }
15921592 } else if (ch > INT_9 ) {
1593- if (ch == INT_e || ch == INT_E ) {
1593+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
15941594 char [] outBuf = _textBuffer .emptyAndGetCurrentSegment ();
15951595 outBuf [0 ] = '0' ;
15961596 _intLength = 1 ;
@@ -1599,7 +1599,7 @@ protected JsonToken _finishNumberLeadingZeroes() throws IOException
15991599 // Ok; unfortunately we have closing bracket/curly that are valid so need
16001600 // (colon not possible since this is within value, not after key)
16011601 //
1602- if ((ch != INT_RBRACKET ) && ( ch != INT_RCURLY )) {
1602+ if ((ch | 0x20 ) != INT_RCURLY ) { // ~ '}]'
16031603 _reportUnexpectedNumberChar (ch ,
16041604 "expected digit (0-9), decimal point (.) or exponent indicator (e/E) to follow '0'" );
16051605 }
@@ -1649,7 +1649,7 @@ protected JsonToken _finishNumberLeadingPosNegZeroes(final boolean negative) thr
16491649 return _startFloat (outBuf , 2 , ch );
16501650 }
16511651 } else if (ch > INT_9 ) {
1652- if (ch == INT_e || ch == INT_E ) {
1652+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
16531653 char [] outBuf = _textBuffer .emptyAndGetCurrentSegment ();
16541654 outBuf [0 ] = negative ? '-' : '+' ;
16551655 outBuf [1 ] = '0' ;
@@ -1659,7 +1659,7 @@ protected JsonToken _finishNumberLeadingPosNegZeroes(final boolean negative) thr
16591659 // Ok; unfortunately we have closing bracket/curly that are valid so need
16601660 // (colon not possible since this is within value, not after key)
16611661 //
1662- if ((ch != INT_RBRACKET ) && ( ch != INT_RCURLY )) {
1662+ if ((ch | 0x20 ) != INT_RCURLY ) { // ~ '}]'
16631663 _reportUnexpectedNumberChar (ch ,
16641664 "expected digit (0-9), decimal point (.) or exponent indicator (e/E) to follow '0'" );
16651665 }
@@ -1703,7 +1703,7 @@ protected JsonToken _finishNumberIntegralPart(char[] outBuf, int outPtr) throws
17031703 break ;
17041704 }
17051705 if (ch > INT_9 ) {
1706- if (ch == INT_e || ch == INT_E ) {
1706+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE'
17071707 _intLength = outPtr +negMod ;
17081708 ++_inputPtr ;
17091709 return _startFloat (outBuf , outPtr , ch );
@@ -1758,7 +1758,7 @@ protected JsonToken _startFloat(char[] outBuf, int outPtr, int ch) throws IOExce
17581758 }
17591759 _fractLength = fractLen ;
17601760 int expLen = 0 ;
1761- if (ch == INT_e || ch == INT_E ) { // exponent?
1761+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE' exponent?
17621762 if (outPtr >= outBuf .length ) {
17631763 outBuf = _textBuffer .expandCurrentSegment ();
17641764 }
@@ -1833,7 +1833,7 @@ protected JsonToken _finishFloatFraction() throws IOException
18331833 return JsonToken .NOT_AVAILABLE ;
18341834 }
18351835 ch = getNextSignedByteFromBuffer ();
1836- } else if (ch == 'f' || ch == 'd' || ch == 'F' || ch == 'D' ) {
1836+ } else if (( ch | 0x22 ) == 'f' ) { // ~ fFdD
18371837 _reportUnexpectedNumberChar (ch , "JSON does not support parsing numbers that have 'f' or 'd' suffixes" );
18381838 } else if (ch == INT_PERIOD ) {
18391839 _reportUnexpectedNumberChar (ch , "Cannot parse number with more than one decimal point" );
@@ -1853,7 +1853,7 @@ protected JsonToken _finishFloatFraction() throws IOException
18531853 _textBuffer .setCurrentLength (outPtr );
18541854
18551855 // Ok: end of floating point number or exponent?
1856- if (ch == INT_e || ch == INT_E ) { // exponent?
1856+ if (( ch | 0x20 ) == INT_e ) { // ~ 'eE' exponent?
18571857 _textBuffer .append ((char ) ch );
18581858 _expLength = 0 ;
18591859 if (_inputPtr >= _inputEnd ) {
0 commit comments