File tree 1 file changed +18
-7
lines changed
src/main/java/com/fasterxml/jackson/databind/deser
1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ public final class DeserializerCache
53
53
protected final HashMap <JavaType , JsonDeserializer <Object >> _incompleteDeserializers
54
54
= new HashMap <JavaType , JsonDeserializer <Object >>(8 );
55
55
56
-
57
56
/**
58
57
* We hold an explicit lock while creating deserializers to avoid creating duplicates.
59
58
*/
@@ -253,14 +252,26 @@ protected JsonDeserializer<Object> _createAndCacheValueDeserializer(Deserializat
253
252
* limitations necessary to ensure that only completely initialized ones
254
253
* are visible and used.
255
254
*/
255
+ if (type == null ) {
256
+ throw new IllegalArgumentException ("Null JavaType passed" );
257
+ }
258
+ if (_hasCustomHandlers (type )) {
259
+ return null ;
260
+ }
261
+ final boolean isCustom = _hasCustomHandlers (type );
262
+ JsonDeserializer <Object > deser = isCustom ? null : _cachedDeserializers .get (type );
263
+ if (deser != null ) {
264
+ return deser ;
265
+ }
266
+ _incompleteDeserializersLock .lock ();
256
267
try {
257
- _incompleteDeserializersLock .lock ();
258
-
259
- // Ok, then: could it be that due to a race condition, deserializer can now be found?
260
- JsonDeserializer <Object > deser = _findCachedDeserializer (type );
261
- if (deser != null ) {
262
- return deser ;
268
+ if (!isCustom ) {
269
+ deser = _cachedDeserializers .get (type );
270
+ if (deser != null ) {
271
+ return deser ;
272
+ }
263
273
}
274
+ // Ok, then: could it be that due to a race condition, deserializer can now be found?
264
275
int count = _incompleteDeserializers .size ();
265
276
// Or perhaps being resolved right now?
266
277
if (count > 0 ) {
You can’t perform that action at this time.
0 commit comments