Skip to content

Commit 8f2da17

Browse files
committed
Fix _updateToken() wrt NOT_AVAILABLE token/state
1 parent 7af6e97 commit 8f2da17

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

smile/src/main/java/com/fasterxml/jackson/dataformat/smile/async/NonBlockingByteArrayParser.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ protected JsonToken _finishHeader(int state) throws IOException
342342
case 0:
343343
if (_inputPtr >= _inputEnd) {
344344
_pending32 = state;
345-
return _updateToken(JsonToken.NOT_AVAILABLE);
345+
return _updateTokenToNA();
346346
}
347347
ch = _inputBuffer[_inputPtr++];
348348
if (ch!= SmileConstants.HEADER_BYTE_2) {
@@ -354,7 +354,7 @@ protected JsonToken _finishHeader(int state) throws IOException
354354
case 1:
355355
if (_inputPtr >= _inputEnd) {
356356
_pending32 = state;
357-
return _updateToken(JsonToken.NOT_AVAILABLE);
357+
return _updateTokenToNA();
358358
}
359359
ch = _inputBuffer[_inputPtr++];
360360
if (ch != SmileConstants.HEADER_BYTE_3) {
@@ -365,7 +365,7 @@ protected JsonToken _finishHeader(int state) throws IOException
365365
case 2:
366366
if (_inputPtr >= _inputEnd) {
367367
_pending32 = state;
368-
return _updateToken(JsonToken.NOT_AVAILABLE);
368+
return _updateTokenToNA();
369369
}
370370
ch = _inputBuffer[_inputPtr++];
371371
{
@@ -490,7 +490,7 @@ private final JsonToken _startValue(int ch) throws IOException
490490
// did not get it all; mark the state so we know where to return:
491491
_pending32 = ch;
492492
_minorState = MINOR_VALUE_STRING_SHARED_2BYTE;
493-
return _updateToken(JsonToken.NOT_AVAILABLE);
493+
return _updateTokenToNA();
494494
case 0x18: // START_ARRAY
495495
return _startArrayScope();
496496
case 0x19: // END_ARRAY
@@ -541,7 +541,7 @@ protected final JsonToken _startFieldName(int ch) throws IOException
541541
{
542542
_minorState = MINOR_FIELD_NAME_2BYTE;
543543
_pending32 = (ch & 0x3) << 8;
544-
return _updateToken(JsonToken.NOT_AVAILABLE);
544+
return _updateTokenToNA();
545545
}
546546
case 0x34: // long ASCII/Unicode name
547547
return _finishLongFieldName(0);
@@ -581,7 +581,7 @@ protected final JsonToken _startFieldName(int ch) throws IOException
581581
}
582582
}
583583
_minorState = MINOR_FIELD_NAME_SHORT_ASCII;
584-
return _updateToken(JsonToken.NOT_AVAILABLE);
584+
return _updateTokenToNA();
585585

586586
case 3: // short Unicode; possibly doable
587587
// all valid, except for 0xFF
@@ -622,7 +622,7 @@ protected final JsonToken _startFieldName(int ch) throws IOException
622622
System.arraycopy(_inputBuffer, inputPtr, _inputCopy, 0, left);
623623
}
624624
_minorState = MINOR_FIELD_NAME_SHORT_UNICODE;
625-
return _updateToken(JsonToken.NOT_AVAILABLE);
625+
return _updateTokenToNA();
626626
}
627627
}
628628
// Other byte values are illegal
@@ -653,7 +653,7 @@ private final JsonToken _finishLongFieldName(int outPtr) throws IOException
653653
_inputPtr = srcPtr;
654654
_minorState = MINOR_FIELD_NAME_LONG;
655655
_inputCopyLen = outPtr;
656-
return _updateToken(JsonToken.NOT_AVAILABLE);
656+
return _updateTokenToNA();
657657
}
658658
// otherwise increase copy buffer length
659659
int oldLen = copyBuffer.length;
@@ -733,7 +733,7 @@ private final JsonToken _startShortASCII(final int len) throws IOException
733733
System.arraycopy(_inputBuffer, inputPtr, _inputCopy, 0, left);
734734
}
735735
_minorState = MINOR_VALUE_STRING_SHORT_ASCII;
736-
return _updateToken(JsonToken.NOT_AVAILABLE);
736+
return _updateTokenToNA();
737737
}
738738

739739
private final JsonToken _startShortUnicode(final int len) throws IOException
@@ -756,7 +756,7 @@ private final JsonToken _startShortUnicode(final int len) throws IOException
756756
_inputPtr = inPtr + left;
757757
}
758758
_minorState = MINOR_VALUE_STRING_SHORT_UNICODE;
759-
return _updateToken(JsonToken.NOT_AVAILABLE);
759+
return _updateTokenToNA();
760760
}
761761

762762
/*
@@ -792,7 +792,7 @@ private final JsonToken _startLongASCII() throws IOException
792792
// denote current length; no partial input to save
793793
_textBuffer.setCurrentLength(outPtr);
794794
_minorState = MINOR_VALUE_STRING_LONG_ASCII;
795-
return _updateToken(JsonToken.NOT_AVAILABLE);
795+
return _updateTokenToNA();
796796
}
797797

798798
private final JsonToken _finishLongASCII() throws IOException
@@ -932,7 +932,7 @@ protected final JsonToken _startLongUnicode() throws IOException
932932
}
933933
_textBuffer.setCurrentLength(outPtr);
934934
_minorState = MINOR_VALUE_STRING_LONG_UNICODE;
935-
return _updateToken(JsonToken.NOT_AVAILABLE);
935+
return _updateTokenToNA();
936936
}
937937

938938
private final JsonToken _finishLongUnicode() throws IOException
@@ -1199,7 +1199,7 @@ private final JsonToken _finishInt(int value, int bytesRead) throws IOException
11991199
_minorState = MINOR_VALUE_NUMBER_INT;
12001200
_pending32 = value;
12011201
_inputCopyLen = bytesRead;
1202-
return _updateToken(JsonToken.NOT_AVAILABLE);
1202+
return _updateTokenToNA();
12031203
}
12041204

12051205
private final JsonToken _startLong() throws IOException
@@ -1253,7 +1253,7 @@ private final JsonToken _finishLong(long value, int bytesRead) throws IOExceptio
12531253
_minorState = MINOR_VALUE_NUMBER_LONG;
12541254
_pending64 = value;
12551255
_inputCopyLen = bytesRead;
1256-
return _updateToken(JsonToken.NOT_AVAILABLE);
1256+
return _updateTokenToNA();
12571257
}
12581258

12591259
private final JsonToken _startBigInt() throws IOException
@@ -1285,7 +1285,7 @@ private final JsonToken _finishBigIntLen(int value, int bytesRead) throws IOExce
12851285
_minorState = MINOR_VALUE_NUMBER_BIGINT_LEN;
12861286
_pending32 = value;
12871287
_inputCopyLen = bytesRead;
1288-
return _updateToken(JsonToken.NOT_AVAILABLE);
1288+
return _updateTokenToNA();
12891289
}
12901290

12911291
private final JsonToken _finishBigIntBody() throws IOException
@@ -1299,7 +1299,7 @@ private final JsonToken _finishBigIntBody() throws IOException
12991299
return _valueComplete(JsonToken.VALUE_NUMBER_INT);
13001300
}
13011301
_minorState = MINOR_VALUE_NUMBER_BIGINT_BODY;
1302-
return _updateToken(JsonToken.NOT_AVAILABLE);
1302+
return _updateTokenToNA();
13031303
}
13041304

13051305
/*
@@ -1339,7 +1339,7 @@ protected final JsonToken _finishFloat(int value, int bytesRead) throws IOExcept
13391339
_minorState = MINOR_VALUE_NUMBER_FLOAT;
13401340
_pending32 = value;
13411341
_inputCopyLen = bytesRead;
1342-
return _updateToken(JsonToken.NOT_AVAILABLE);
1342+
return _updateTokenToNA();
13431343
}
13441344

13451345
protected final JsonToken _startDouble() throws IOException
@@ -1378,7 +1378,7 @@ protected final JsonToken _finishDouble(long value, int bytesRead) throws IOExce
13781378
_minorState = MINOR_VALUE_NUMBER_DOUBLE;
13791379
_pending64 = value;
13801380
_inputCopyLen = bytesRead;
1381-
return _updateToken(JsonToken.NOT_AVAILABLE);
1381+
return _updateTokenToNA();
13821382
}
13831383

13841384
private final JsonToken _startBigDecimal() throws IOException
@@ -1411,7 +1411,7 @@ private final JsonToken _finishBigDecimalScale(int value, int bytesRead) throws
14111411
// note! Scale stored here, need _pending32 for byte length
14121412
_pending64 = value;
14131413
_inputCopyLen = bytesRead;
1414-
return _updateToken(JsonToken.NOT_AVAILABLE);
1414+
return _updateTokenToNA();
14151415
}
14161416

14171417
private final JsonToken _finishBigDecimalLen(int value, int bytesRead) throws IOException
@@ -1432,7 +1432,7 @@ private final JsonToken _finishBigDecimalLen(int value, int bytesRead) throws IO
14321432
_minorState = MINOR_VALUE_NUMBER_BIGDEC_LEN;
14331433
_pending32 = value;
14341434
_inputCopyLen = bytesRead;
1435-
return _updateToken(JsonToken.NOT_AVAILABLE);
1435+
return _updateTokenToNA();
14361436
}
14371437

14381438
private final JsonToken _finishBigDecimalBody() throws IOException
@@ -1449,7 +1449,7 @@ private final JsonToken _finishBigDecimalBody() throws IOException
14491449
return _valueComplete(JsonToken.VALUE_NUMBER_FLOAT);
14501450
}
14511451
_minorState = MINOR_VALUE_NUMBER_BIGDEC_BODY;
1452-
return _updateToken(JsonToken.NOT_AVAILABLE);
1452+
return _updateTokenToNA();
14531453
}
14541454

14551455
/*
@@ -1490,7 +1490,7 @@ private final JsonToken _finishRawBinaryLen(int value, int bytesRead) throws IOE
14901490
_minorState = MINOR_VALUE_BINARY_RAW_LEN;
14911491
_pending32 = value;
14921492
_inputCopyLen = bytesRead;
1493-
return _updateToken(JsonToken.NOT_AVAILABLE);
1493+
return _updateTokenToNA();
14941494
}
14951495

14961496
private final JsonToken _finishRawBinaryBody() throws IOException
@@ -1512,7 +1512,7 @@ private final JsonToken _finishRawBinaryBody() throws IOException
15121512
_pending32 = totalLen;
15131513
_inputCopyLen = offset+avail;
15141514
_minorState = MINOR_VALUE_BINARY_RAW_BODY;
1515-
return _updateToken(JsonToken.NOT_AVAILABLE);
1515+
return _updateTokenToNA();
15161516
}
15171517

15181518
private final JsonToken _start7BitBinary() throws IOException
@@ -1544,7 +1544,7 @@ private final JsonToken _finish7BitBinaryLen(int value, int bytesRead) throws IO
15441544
_minorState = MINOR_VALUE_BINARY_7BIT_LEN;
15451545
_pending32 = value;
15461546
_inputCopyLen = bytesRead;
1547-
return _updateToken(JsonToken.NOT_AVAILABLE);
1547+
return _updateTokenToNA();
15481548
}
15491549

15501550
private final JsonToken _finish7BitBinaryBody() throws IOException
@@ -1554,7 +1554,7 @@ private final JsonToken _finish7BitBinaryBody() throws IOException
15541554
return _valueComplete(JsonToken.VALUE_EMBEDDED_OBJECT);
15551555
}
15561556
_minorState = MINOR_VALUE_BINARY_7BIT_BODY;
1557-
return _updateToken(JsonToken.NOT_AVAILABLE);
1557+
return _updateTokenToNA();
15581558
}
15591559

15601560
/*

0 commit comments

Comments
 (0)