1
1
package com .fasterxml .jackson .databind .deser ;
2
2
3
+ import java .io .Serializable ;
3
4
import java .util .*;
4
5
import java .util .concurrent .*;
5
6
import java .util .concurrent .atomic .AtomicReference ;
8
9
import com .fasterxml .jackson .annotation .JsonCreator ;
9
10
import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
10
11
import com .fasterxml .jackson .annotation .JsonCreator .Mode ;
12
+
11
13
import com .fasterxml .jackson .core .JsonLocation ;
12
14
import com .fasterxml .jackson .core .JsonParser ;
15
+
13
16
import com .fasterxml .jackson .databind .*;
14
17
import com .fasterxml .jackson .databind .cfg .DeserializerFactoryConfig ;
15
18
import com .fasterxml .jackson .databind .cfg .HandlerInstantiator ;
@@ -46,6 +49,7 @@ public abstract class BasicDeserializerFactory
46
49
private final static Class <?> CLASS_CHAR_SEQUENCE = CharSequence .class ;
47
50
private final static Class <?> CLASS_ITERABLE = Iterable .class ;
48
51
private final static Class <?> CLASS_MAP_ENTRY = Map .Entry .class ;
52
+ private final static Class <?> CLASS_SERIALIZABLE = Serializable .class ;
49
53
50
54
/**
51
55
* We need a placeholder for creator properties that don't have name
@@ -1771,8 +1775,8 @@ public JsonDeserializer<?> findDefaultDeserializer(DeserializationContext ctxt,
1771
1775
throws JsonMappingException
1772
1776
{
1773
1777
Class <?> rawType = type .getRawClass ();
1774
- // Object ("untyped"), String equivalents:
1775
- if (rawType == CLASS_OBJECT ) {
1778
+ // Object ("untyped"), and as of 2.10 (see [databind#2115]), `java.io.Serializable`
1779
+ if (( rawType == CLASS_OBJECT ) || ( rawType == CLASS_SERIALIZABLE ) ) {
1776
1780
// 11-Feb-2015, tatu: As per [databind#700] need to be careful wrt non-default Map, List.
1777
1781
DeserializationConfig config = ctxt .getConfig ();
1778
1782
JavaType lt , mt ;
@@ -1785,6 +1789,7 @@ public JsonDeserializer<?> findDefaultDeserializer(DeserializationContext ctxt,
1785
1789
}
1786
1790
return new UntypedObjectDeserializer (lt , mt );
1787
1791
}
1792
+ // String and equivalents
1788
1793
if (rawType == CLASS_STRING || rawType == CLASS_CHAR_SEQUENCE ) {
1789
1794
return StringDeserializer .instance ;
1790
1795
}
0 commit comments