File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
src/main/java/com/fasterxml/jackson/databind/deser Expand file tree Collapse file tree 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
5353 protected final HashMap <JavaType , JsonDeserializer <Object >> _incompleteDeserializers
5454 = new HashMap <JavaType , JsonDeserializer <Object >>(8 );
5555
56-
5756 /**
5857 * We hold an explicit lock while creating deserializers to avoid creating duplicates.
5958 */
@@ -253,14 +252,26 @@ protected JsonDeserializer<Object> _createAndCacheValueDeserializer(Deserializat
253252 * limitations necessary to ensure that only completely initialized ones
254253 * are visible and used.
255254 */
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 ();
256267 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+ }
263273 }
274+ // Ok, then: could it be that due to a race condition, deserializer can now be found?
264275 int count = _incompleteDeserializers .size ();
265276 // Or perhaps being resolved right now?
266277 if (count > 0 ) {
You can’t perform that action at this time.
0 commit comments