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 838e250
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ public JsonSerializer<Object> getUnknownTypeSerializer(Class<?> unknownType) {
* @since 2.5
*/
public boolean isUnknownTypeSerializer(JsonSerializer<?> ser) {
if ((ser == _unknownTypeSerializer) || (ser == null)) {
if (ser == null) {
return true;
}
// 23-Apr-2015, tatu: "empty" serializer is trickier; needs to consider
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 838e250

Please sign in to comment.