@@ -492,21 +492,22 @@ protected void _releaseBuffers()
492492    @Override 
493493    public JsonToken nextToken() throws JacksonException 
494494    { 
495+         System.out.println("nextToken(): state="+_state+", ptr="+_inputPtr); 
495496        JsonToken t = nextTokenX(); 
496497        if (t == JsonToken.PROPERTY_NAME) { 
497-             System.out.print("Field name: "+currentName()); 
498+             System.out.print("  Field name: "+currentName()); 
498499        } else if (t == JsonToken.VALUE_NUMBER_INT) { 
499-             System.out.print("Int: "+getIntValue()); 
500+             System.out.print("  Int: "+getIntValue()); 
500501        } else if (t == JsonToken.VALUE_STRING) { 
501-             System.out.print("String: '"+getText ()+"'"); 
502+             System.out.print("  String: '"+getString ()+"'"); 
502503        } else { 
503-             System.out.print("Next: "+t); 
504+             System.out.print("  Next: "+t); 
504505        } 
505506        System.out.println(" (state now: "+_state+", ptr "+_inputPtr+")"); 
506507        return t; 
507508    } 
508509
509-     public JsonToken nextTokenX() throws JacksonException {  
510+     public JsonToken nextTokenX() throws JacksonException 
510511    */ 
511512
512513    @ Override 
@@ -1041,6 +1042,7 @@ public String nextName() throws JacksonException
10411042            return  name ;
10421043        }
10431044        if  (_state  == STATE_MESSAGE_END ) {
1045+             close (); // sets state to STATE_CLOSED 
10441046            _updateToken (JsonToken .END_OBJECT );
10451047            return  null ;
10461048        }
@@ -1126,6 +1128,7 @@ public boolean nextName(SerializableString sstr) throws JacksonException
11261128            return  name .equals (sstr .getValue ());
11271129        }
11281130        if  (_state  == STATE_MESSAGE_END ) {
1131+             close (); // sets state to STATE_CLOSED 
11291132            _updateToken (JsonToken .END_OBJECT );
11301133            return  false ;
11311134        }
@@ -1215,6 +1218,7 @@ public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException
12151218            return  matcher .matchName (name );
12161219        }
12171220        if  (_state  == STATE_MESSAGE_END ) {
1221+             close (); // sets state to STATE_CLOSED 
12181222            _updateToken (JsonToken .END_OBJECT );
12191223            return  PropertyNameMatcher .MATCH_END_OBJECT ;
12201224        }
@@ -1236,7 +1240,7 @@ private int _nextNameMatch2(PropertyNameMatcher matcher) throws JacksonException
12361240
12371241    /* 
12381242    /********************************************************************** 
1239-     /* Public API, traversal, optimized: nextFieldName () 
1243+     /* Public API, traversal, optimized: nextName () 
12401244    /********************************************************************** 
12411245     */ 
12421246
0 commit comments