diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 53ee3f82a3..c838c78339 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -8,6 +8,11 @@ Project: jackson-databind - +2.17.2 (not yet released) + +#4561: Issues using jackson-databind 2.17.1 with Reactor + (reported by @wdallastella) + 2.17.1 (04-May-2024) #4428: `ByteBuddy` scope went beyond `test` in version 2.17.0 diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerCache.java b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerCache.java index 0282af7213..1c633fde8a 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerCache.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerCache.java @@ -1,7 +1,6 @@ package com.fasterxml.jackson.databind.deser; import java.util.HashMap; -import java.util.concurrent.locks.ReentrantLock; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.*; @@ -53,12 +52,6 @@ public final class DeserializerCache protected final HashMap> _incompleteDeserializers = new HashMap>(8); - - /** - * We hold an explicit lock while creating deserializers to avoid creating duplicates. - */ - private final ReentrantLock _incompleteDeserializersLock = new ReentrantLock(); - /* /********************************************************** /* Life-cycle @@ -249,12 +242,10 @@ protected JsonDeserializer _createAndCacheValueDeserializer(Deserializat DeserializerFactory factory, JavaType type) throws JsonMappingException { - /* Only one thread to construct deserializers at any given point in time; - * limitations necessary to ensure that only completely initialized ones - * are visible and used. - */ - _incompleteDeserializersLock.lock(); - try { + // Only one thread to construct deserializers at any given point in time; + // limitations necessary to ensure that only completely initialized ones + // are visible and used. + synchronized (_incompleteDeserializers) { // Ok, then: could it be that due to a race condition, deserializer can now be found? JsonDeserializer deser = _findCachedDeserializer(type); if (deser != null) { @@ -277,8 +268,6 @@ protected JsonDeserializer _createAndCacheValueDeserializer(Deserializat _incompleteDeserializers.clear(); } } - } finally { - _incompleteDeserializersLock.unlock(); } }