@@ -791,16 +791,16 @@ public JsonToken nextToken() throws IOException
791
791
if (!_streamReadContext .expectMoreValues ()) {
792
792
_stringRefs .pop ();
793
793
_streamReadContext = _streamReadContext .getParent ();
794
- return ( _currToken = JsonToken .END_OBJECT );
794
+ return _updateToken ( JsonToken .END_OBJECT );
795
795
}
796
- return ( _currToken = _decodePropertyName ());
796
+ return _updateToken ( _decodePropertyName ());
797
797
}
798
798
} else {
799
799
if (!_streamReadContext .expectMoreValues ()) {
800
800
_stringRefs .pop ();
801
801
_tagValues .clear ();
802
802
_streamReadContext = _streamReadContext .getParent ();
803
- return ( _currToken = JsonToken .END_ARRAY );
803
+ return _updateToken ( JsonToken .END_ARRAY );
804
804
}
805
805
}
806
806
if (_inputPtr >= _inputEnd ) {
@@ -874,7 +874,7 @@ public JsonToken nextToken() throws IOException
874
874
if (!_tagValues .isEmpty ()) {
875
875
return _handleTaggedInt (_tagValues );
876
876
}
877
- return ( _currToken = JsonToken .VALUE_NUMBER_INT );
877
+ return _updateToken ( JsonToken .VALUE_NUMBER_INT );
878
878
case 1 : // negative int
879
879
_numTypesValid = NR_INT ;
880
880
if (lowBits <= 23 ) {
@@ -917,20 +917,20 @@ public JsonToken nextToken() throws IOException
917
917
_invalidToken (ch );
918
918
}
919
919
}
920
- return ( _currToken = JsonToken .VALUE_NUMBER_INT );
920
+ return _updateToken ( JsonToken .VALUE_NUMBER_INT );
921
921
922
922
case 2 : // byte[]
923
923
_typeByte = ch ;
924
924
_tokenIncomplete = true ;
925
925
if (!_tagValues .isEmpty ()) {
926
926
return _handleTaggedBinary (_tagValues );
927
927
}
928
- return ( _currToken = JsonToken .VALUE_EMBEDDED_OBJECT );
928
+ return _updateToken ( JsonToken .VALUE_EMBEDDED_OBJECT );
929
929
930
930
case 3 : // String
931
931
_typeByte = ch ;
932
932
_tokenIncomplete = true ;
933
- return ( _currToken = JsonToken .VALUE_STRING );
933
+ return _updateToken ( JsonToken .VALUE_STRING );
934
934
935
935
case 4 : // Array
936
936
_stringRefs .push (stringrefNamespace );
@@ -941,11 +941,11 @@ public JsonToken nextToken() throws IOException
941
941
}
942
942
createChildArrayContext (len );
943
943
}
944
- return ( _currToken = JsonToken .START_ARRAY );
944
+ return _updateToken ( JsonToken .START_ARRAY );
945
945
946
946
case 5 : // Object
947
947
_stringRefs .push (stringrefNamespace );
948
- _currToken = JsonToken .START_OBJECT ;
948
+ _updateToken ( JsonToken .START_OBJECT ) ;
949
949
{
950
950
int len = _decodeExplicitLength (lowBits );
951
951
createChildObjectContext (len );
@@ -956,43 +956,43 @@ public JsonToken nextToken() throws IOException
956
956
default : // misc: tokens, floats
957
957
switch (lowBits ) {
958
958
case 20 :
959
- return ( _currToken = JsonToken .VALUE_FALSE );
959
+ return _updateToken ( JsonToken .VALUE_FALSE );
960
960
case 21 :
961
- return ( _currToken = JsonToken .VALUE_TRUE );
961
+ return _updateToken ( JsonToken .VALUE_TRUE );
962
962
case 22 :
963
- return ( _currToken = JsonToken .VALUE_NULL );
963
+ return _updateToken ( JsonToken .VALUE_NULL );
964
964
case 23 :
965
- return ( _currToken = _decodeUndefinedValue ());
965
+ return _updateToken ( _decodeUndefinedValue ());
966
966
967
967
case 25 : // 16-bit float...
968
968
// As per [http://stackoverflow.com/questions/5678432/decompressing-half-precision-floats-in-javascript]
969
969
{
970
970
_numberFloat = (float ) _decodeHalfSizeFloat ();
971
971
_numTypesValid = NR_FLOAT ;
972
972
}
973
- return ( _currToken = JsonToken .VALUE_NUMBER_FLOAT );
973
+ return _updateToken ( JsonToken .VALUE_NUMBER_FLOAT );
974
974
case 26 : // Float32
975
975
{
976
976
_numberFloat = Float .intBitsToFloat (_decode32Bits ());
977
977
_numTypesValid = NR_FLOAT ;
978
978
}
979
- return ( _currToken = JsonToken .VALUE_NUMBER_FLOAT );
979
+ return _updateToken ( JsonToken .VALUE_NUMBER_FLOAT );
980
980
case 27 : // Float64
981
981
_numberDouble = Double .longBitsToDouble (_decode64Bits ());
982
982
_numTypesValid = NR_DOUBLE ;
983
- return ( _currToken = JsonToken .VALUE_NUMBER_FLOAT );
983
+ return _updateToken ( JsonToken .VALUE_NUMBER_FLOAT );
984
984
case 31 : // Break
985
985
if (_streamReadContext .inArray ()) {
986
986
if (!_streamReadContext .hasExpectedLength ()) {
987
987
_stringRefs .pop ();
988
988
_streamReadContext = _streamReadContext .getParent ();
989
- return ( _currToken = JsonToken .END_ARRAY );
989
+ return _updateToken ( JsonToken .END_ARRAY );
990
990
}
991
991
}
992
992
// Object end-marker can't occur here
993
993
_reportUnexpectedBreak ();
994
994
}
995
- return ( _currToken = _decodeSimpleValue (lowBits , ch ));
995
+ return _updateToken ( _decodeSimpleValue (lowBits , ch ));
996
996
}
997
997
}
998
998
@@ -1072,7 +1072,7 @@ protected String _numberToName(int ch, boolean neg, TagList tags) throws IOExcep
1072
1072
protected JsonToken _handleTaggedInt (TagList tags ) throws IOException {
1073
1073
// For now all we should get is stringref
1074
1074
if (!tags .contains (TAG_ID_STRINGREF )) {
1075
- return ( _currToken = JsonToken .VALUE_NUMBER_INT );
1075
+ return _updateToken ( JsonToken .VALUE_NUMBER_INT );
1076
1076
}
1077
1077
1078
1078
if (_stringRefs .empty ()) {
@@ -1090,7 +1090,7 @@ protected JsonToken _handleTaggedInt(TagList tags) throws IOException {
1090
1090
Object str = stringRefs .stringRefs .get (_numberInt );
1091
1091
if (str instanceof String ) {
1092
1092
_sharedString = (String ) str ;
1093
- return ( _currToken = JsonToken .VALUE_STRING );
1093
+ return _updateToken ( JsonToken .VALUE_STRING );
1094
1094
}
1095
1095
_binaryValue = (byte []) str ;
1096
1096
return _handleTaggedBinary (tags );
@@ -1110,7 +1110,7 @@ protected JsonToken _handleTaggedBinary(TagList tags) throws IOException
1110
1110
// 16-Jan-2024, tatu: Esoteric edge case where we have marked
1111
1111
// `int` as being tokenized
1112
1112
_numTypesValid = NR_UNKNOWN ;
1113
- return ( _currToken = JsonToken .VALUE_EMBEDDED_OBJECT );
1113
+ return _updateToken ( JsonToken .VALUE_EMBEDDED_OBJECT );
1114
1114
}
1115
1115
1116
1116
// First: get the data
@@ -1131,7 +1131,7 @@ protected JsonToken _handleTaggedBinary(TagList tags) throws IOException
1131
1131
}
1132
1132
_numTypesValid = NR_BIGINT ;
1133
1133
_tagValues .clear ();
1134
- return ( _currToken = JsonToken .VALUE_NUMBER_INT );
1134
+ return _updateToken ( JsonToken .VALUE_NUMBER_INT );
1135
1135
}
1136
1136
1137
1137
protected JsonToken _handleTaggedArray (TagList tags , int len ) throws IOException
@@ -1143,9 +1143,9 @@ protected JsonToken _handleTaggedArray(TagList tags, int len) throws IOException
1143
1143
1144
1144
// BigDecimal is the only thing we know for sure
1145
1145
if (!tags .contains (CBORConstants .TAG_DECIMAL_FRACTION )) {
1146
- return ( _currToken = JsonToken .START_ARRAY );
1146
+ return _updateToken ( JsonToken .START_ARRAY );
1147
1147
}
1148
- _currToken = JsonToken .START_ARRAY ;
1148
+ _updateToken ( JsonToken .START_ARRAY ) ;
1149
1149
1150
1150
// but has to have length of 2; otherwise we have a problem...
1151
1151
if (len != 2 ) {
@@ -1181,7 +1181,7 @@ protected JsonToken _handleTaggedArray(TagList tags, int len) throws IOException
1181
1181
// which needs to be reset here
1182
1182
_numberBigDecimal = dec ;
1183
1183
_numTypesValid = NR_BIGDECIMAL ;
1184
- return ( _currToken = JsonToken .VALUE_NUMBER_FLOAT );
1184
+ return _updateToken ( JsonToken .VALUE_NUMBER_FLOAT );
1185
1185
}
1186
1186
1187
1187
/**
@@ -1200,7 +1200,7 @@ protected final boolean _checkNextIsIntInArray(final String typeDesc) throws IOE
1200
1200
_tagValues .clear ();
1201
1201
_stringRefs .pop ();
1202
1202
_streamReadContext = _streamReadContext .getParent ();
1203
- _currToken = JsonToken .END_ARRAY ;
1203
+ _updateToken ( JsonToken .END_ARRAY ) ;
1204
1204
return false ;
1205
1205
}
1206
1206
@@ -1273,7 +1273,7 @@ protected final boolean _checkNextIsIntInArray(final String typeDesc) throws IOE
1273
1273
}
1274
1274
}
1275
1275
if (tagValues == null ) {
1276
- _currToken = JsonToken .VALUE_NUMBER_INT ;
1276
+ _updateToken ( JsonToken .VALUE_NUMBER_INT ) ;
1277
1277
} else {
1278
1278
_handleTaggedInt (tagValues );
1279
1279
}
@@ -1320,7 +1320,7 @@ protected final boolean _checkNextIsIntInArray(final String typeDesc) throws IOE
1320
1320
_invalidToken (ch );
1321
1321
}
1322
1322
}
1323
- _currToken = JsonToken .VALUE_NUMBER_INT ;
1323
+ _updateToken ( JsonToken .VALUE_NUMBER_INT ) ;
1324
1324
return true ;
1325
1325
1326
1326
case 2 : // byte[]
@@ -1330,7 +1330,7 @@ protected final boolean _checkNextIsIntInArray(final String typeDesc) throws IOE
1330
1330
}
1331
1331
_typeByte = ch ;
1332
1332
_tokenIncomplete = true ;
1333
- _currToken = _handleTaggedBinary (tagValues );
1333
+ _updateToken ( _handleTaggedBinary (tagValues ) );
1334
1334
return (_currToken == JsonToken .VALUE_NUMBER_INT );
1335
1335
}
1336
1336
@@ -1348,7 +1348,7 @@ protected final boolean _checkNextIsEndArray() throws IOException
1348
1348
_tagValues .clear ();
1349
1349
_stringRefs .pop ();
1350
1350
_streamReadContext = _streamReadContext .getParent ();
1351
- _currToken = JsonToken .END_ARRAY ;
1351
+ _updateToken ( JsonToken .END_ARRAY ) ;
1352
1352
return true ;
1353
1353
}
1354
1354
@@ -1411,7 +1411,7 @@ public boolean nextFieldName(SerializableString str) throws IOException
1411
1411
if (!_streamReadContext .expectMoreValues ()) {
1412
1412
_stringRefs .pop ();
1413
1413
_streamReadContext = _streamReadContext .getParent ();
1414
- _currToken = JsonToken .END_OBJECT ;
1414
+ _updateToken ( JsonToken .END_OBJECT ) ;
1415
1415
return false ;
1416
1416
}
1417
1417
byte [] nameBytes = str .asQuotedUTF8 ();
@@ -1439,7 +1439,7 @@ public boolean nextFieldName(SerializableString str) throws IOException
1439
1439
_stringRefs .peek ().stringRefs .add (strValue );
1440
1440
}
1441
1441
_streamReadContext .setCurrentName (strValue );
1442
- _currToken = JsonToken .FIELD_NAME ;
1442
+ _updateToken ( JsonToken .FIELD_NAME ) ;
1443
1443
return true ;
1444
1444
}
1445
1445
if (nameBytes [i ] != _inputBuffer [ptr + i ]) {
@@ -1471,7 +1471,7 @@ public String nextFieldName() throws IOException
1471
1471
if (!_streamReadContext .expectMoreValues ()) {
1472
1472
_stringRefs .pop ();
1473
1473
_streamReadContext = _streamReadContext .getParent ();
1474
- _currToken = JsonToken .END_OBJECT ;
1474
+ _updateToken ( JsonToken .END_OBJECT ) ;
1475
1475
return null ;
1476
1476
}
1477
1477
// inlined "_decodeFieldName()"
@@ -1505,13 +1505,13 @@ public String nextFieldName() throws IOException
1505
1505
if (!_streamReadContext .hasExpectedLength ()) {
1506
1506
_stringRefs .pop ();
1507
1507
_streamReadContext = _streamReadContext .getParent ();
1508
- _currToken = JsonToken .END_OBJECT ;
1508
+ _updateToken ( JsonToken .END_OBJECT ) ;
1509
1509
return null ;
1510
1510
}
1511
1511
_reportUnexpectedBreak ();
1512
1512
}
1513
1513
_decodeNonStringName (ch , _tagValues );
1514
- _currToken = JsonToken .FIELD_NAME ;
1514
+ _updateToken ( JsonToken .FIELD_NAME ) ;
1515
1515
return getText ();
1516
1516
}
1517
1517
final int lenMarker = ch & 0x1F ;
@@ -1552,7 +1552,7 @@ public String nextFieldName() throws IOException
1552
1552
_sharedString = name ;
1553
1553
}
1554
1554
_streamReadContext .setCurrentName (name );
1555
- _currToken = JsonToken .FIELD_NAME ;
1555
+ _updateToken ( JsonToken .FIELD_NAME ) ;
1556
1556
return name ;
1557
1557
}
1558
1558
// otherwise just fall back to default handling; should occur rarely
0 commit comments