diff --git a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java index 8697df110b..b86e2baeef 100644 --- a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java +++ b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java @@ -854,7 +854,7 @@ public JsonSerializer 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 diff --git a/src/test/java/com/fasterxml/jackson/databind/TestObjectMapperBeanDeserializer.java b/src/test/java/com/fasterxml/jackson/databind/TestObjectMapperBeanDeserializer.java index 6778274965..3380811dd7 100644 --- a/src/test/java/com/fasterxml/jackson/databind/TestObjectMapperBeanDeserializer.java +++ b/src/test/java/com/fasterxml/jackson/databind/TestObjectMapperBeanDeserializer.java @@ -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())); + } }