Skip to content

Commit 8daddc0

Browse files
committed
Fix #1253
1 parent 2f80ebd commit 8daddc0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

release-notes/VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Project: jackson-databind
2020
(reported by Mark W)
2121
#1248: `Annotated` returns raw type in place of Generic Type in 2.7.x
2222
(reported by Andrew J, apjoseph@github)
23+
#1253: Problem with context handling for `TokenBuffer`, field name
2324

2425
2.7.4 (29-Apr-2016)
2526

src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ public void close() throws IOException {
621621
@Override
622622
public final void writeStartArray() throws IOException
623623
{
624+
_writeContext.writeValue();
624625
_append(JsonToken.START_ARRAY);
625626
_writeContext = _writeContext.createChildArrayContext();
626627
}
@@ -639,6 +640,7 @@ public final void writeEndArray() throws IOException
639640
@Override
640641
public final void writeStartObject() throws IOException
641642
{
643+
_writeContext.writeValue();
642644
_append(JsonToken.START_OBJECT);
643645
_writeContext = _writeContext.createChildObjectContext();
644646
}
@@ -657,15 +659,15 @@ public final void writeEndObject() throws IOException
657659
@Override
658660
public final void writeFieldName(String name) throws IOException
659661
{
660-
_append(JsonToken.FIELD_NAME, name);
661662
_writeContext.writeFieldName(name);
663+
_append(JsonToken.FIELD_NAME, name);
662664
}
663665

664666
@Override
665667
public void writeFieldName(SerializableString name) throws IOException
666668
{
667-
_append(JsonToken.FIELD_NAME, name);
668669
_writeContext.writeFieldName(name.getValue());
670+
_append(JsonToken.FIELD_NAME, name);
669671
}
670672

671673
/*

0 commit comments

Comments
 (0)