@@ -492,21 +492,22 @@ protected void _releaseBuffers()
492
492
@Override
493
493
public JsonToken nextToken() throws JacksonException
494
494
{
495
+ System.out.println("nextToken(): state="+_state+", ptr="+_inputPtr);
495
496
JsonToken t = nextTokenX();
496
497
if (t == JsonToken.PROPERTY_NAME) {
497
- System.out.print("Field name: "+currentName());
498
+ System.out.print(" Field name: "+currentName());
498
499
} else if (t == JsonToken.VALUE_NUMBER_INT) {
499
- System.out.print("Int: "+getIntValue());
500
+ System.out.print(" Int: "+getIntValue());
500
501
} else if (t == JsonToken.VALUE_STRING) {
501
- System.out.print("String: '"+getText ()+"'");
502
+ System.out.print(" String: '"+getString ()+"'");
502
503
} else {
503
- System.out.print("Next: "+t);
504
+ System.out.print(" Next: "+t);
504
505
}
505
506
System.out.println(" (state now: "+_state+", ptr "+_inputPtr+")");
506
507
return t;
507
508
}
508
509
509
- public JsonToken nextTokenX() throws JacksonException {
510
+ public JsonToken nextTokenX() throws JacksonException
510
511
*/
511
512
512
513
@ Override
@@ -1041,6 +1042,7 @@ public String nextName() throws JacksonException
1041
1042
return name ;
1042
1043
}
1043
1044
if (_state == STATE_MESSAGE_END ) {
1045
+ close (); // sets state to STATE_CLOSED
1044
1046
_updateToken (JsonToken .END_OBJECT );
1045
1047
return null ;
1046
1048
}
@@ -1126,6 +1128,7 @@ public boolean nextName(SerializableString sstr) throws JacksonException
1126
1128
return name .equals (sstr .getValue ());
1127
1129
}
1128
1130
if (_state == STATE_MESSAGE_END ) {
1131
+ close (); // sets state to STATE_CLOSED
1129
1132
_updateToken (JsonToken .END_OBJECT );
1130
1133
return false ;
1131
1134
}
@@ -1215,6 +1218,7 @@ public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException
1215
1218
return matcher .matchName (name );
1216
1219
}
1217
1220
if (_state == STATE_MESSAGE_END ) {
1221
+ close (); // sets state to STATE_CLOSED
1218
1222
_updateToken (JsonToken .END_OBJECT );
1219
1223
return PropertyNameMatcher .MATCH_END_OBJECT ;
1220
1224
}
@@ -1236,7 +1240,7 @@ private int _nextNameMatch2(PropertyNameMatcher matcher) throws JacksonException
1236
1240
1237
1241
/*
1238
1242
/**********************************************************************
1239
- /* Public API, traversal, optimized: nextFieldName ()
1243
+ /* Public API, traversal, optimized: nextName ()
1240
1244
/**********************************************************************
1241
1245
*/
1242
1246
0 commit comments