Skip to content

Commit

Permalink
Fix #1361
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 2, 2016
1 parent ee10eec commit 8fa9cb7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.2</version>
<version>2.8.3-SNAPSHOT</version>
</dependency>

<!-- and for testing we need a few libraries
Expand Down
1 change: 1 addition & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Project: jackson-databind
2.8.3 (not yet released)

#1353: Improve error-handling for `java.net.URL` deserialization
#1361: Change `TokenBuffer` to use new `writeEmbeddedObject()` if possible

2.8.2 (30-Aug-2016)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,9 @@ protected Object _convertObjectId(JsonParser p, DeserializationContext ctxt,
} else {
// should we worry about UUIDs? They should be fine, right?
// 07-Aug-2014, tatu: Maybe, but not necessarily; had issues with
// Smile format; [Smile#19], possibly related.
// Smile format; [dataformat-smile#19], possibly related.
// 01-Sep-2016, tatu: For non-JSON, might want to consider `writeEmbeddedObject`
// but that won't work for default impl (JSON and most dataformats)
buf.writeObject(rawId);
}
JsonParser bufParser = buf.asParser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,15 @@ public void serialize(JsonGenerator gen) throws IOException
case VALUE_EMBEDDED_OBJECT:
{
Object value = segment.get(ptr);
// 01-Sep-2016, tatu: as per [databind#1361], should use `writeEmbeddedObject()`;
// however, may need to consider alternatives for some well-known types
// first
if (value instanceof RawValue) {
((RawValue) value).serialize(gen);
} else {
} else if (value instanceof JsonSerializable) {
gen.writeObject(value);
} else {
gen.writeEmbeddedObject(value);
}
}
break;
Expand Down

0 comments on commit 8fa9cb7

Please sign in to comment.