Skip to content

Commit

Permalink
Fix issue FasterXML#978
Browse files Browse the repository at this point in the history
  • Loading branch information
flexfrank committed Oct 21, 2015
1 parent b8b7fc3 commit c053322
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -838,11 +838,6 @@ public JsonSerializer<Object> findNullValueSerializer(BeanProperty property)
* @param unknownType Type for which no serializer is found
*/
public JsonSerializer<Object> getUnknownTypeSerializer(Class<?> unknownType) {
// 23-Apr-2015, tatu: Only return shared instance if nominal type is Object.class
if (unknownType == Object.class) {
return _unknownTypeSerializer;
}
// otherwise construct explicit instance with property handled type
return new UnknownSerializer(unknownType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,11 @@ public void testUnknownFields() throws Exception
;
}
}

public void testObject() throws Exception
{
MAPPER.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
assertEquals(true, MAPPER.canSerialize(Object.class));
assertEquals("{}", MAPPER.writeValueAsString(new Object()));
}
}

0 comments on commit c053322

Please sign in to comment.