diff --git a/release-notes/VERSION b/release-notes/VERSION index 3a422bf75c..fe27ea4450 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -20,6 +20,7 @@ Project: jackson-databind (reported by Mark W) #1248: `Annotated` returns raw type in place of Generic Type in 2.7.x (reported by Andrew J, apjoseph@github) +#1253: Problem with context handling for `TokenBuffer`, field name 2.7.4 (29-Apr-2016) diff --git a/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java b/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java index 0c98e87774..9a375e9c9c 100644 --- a/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java +++ b/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java @@ -621,6 +621,7 @@ public void close() throws IOException { @Override public final void writeStartArray() throws IOException { + _writeContext.writeValue(); _append(JsonToken.START_ARRAY); _writeContext = _writeContext.createChildArrayContext(); } @@ -639,6 +640,7 @@ public final void writeEndArray() throws IOException @Override public final void writeStartObject() throws IOException { + _writeContext.writeValue(); _append(JsonToken.START_OBJECT); _writeContext = _writeContext.createChildObjectContext(); } @@ -657,15 +659,15 @@ public final void writeEndObject() throws IOException @Override public final void writeFieldName(String name) throws IOException { - _append(JsonToken.FIELD_NAME, name); _writeContext.writeFieldName(name); + _append(JsonToken.FIELD_NAME, name); } @Override public void writeFieldName(SerializableString name) throws IOException { - _append(JsonToken.FIELD_NAME, name); _writeContext.writeFieldName(name.getValue()); + _append(JsonToken.FIELD_NAME, name); } /*