From 60e69413eaefeb49add7972e394c04915446cb4f Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Fri, 15 Dec 2023 20:43:43 -0800 Subject: [PATCH] Fix #178: replace LRUMap with one from jackson-databind (#179) --- .../java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java | 2 +- .../main/java/com/fasterxml/jackson/jaxrs/util/LRUMap.java | 5 ++++- release-notes/VERSION-2.x | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java index 40203fac..cf8a9da1 100644 --- a/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java +++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/base/ProviderBase.java @@ -12,11 +12,11 @@ import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.util.LRUMap; import com.fasterxml.jackson.databind.type.TypeFactory; import com.fasterxml.jackson.jaxrs.cfg.*; import com.fasterxml.jackson.jaxrs.util.ClassKey; -import com.fasterxml.jackson.jaxrs.util.LRUMap; public abstract class ProviderBase< THIS extends ProviderBase, diff --git a/base/src/main/java/com/fasterxml/jackson/jaxrs/util/LRUMap.java b/base/src/main/java/com/fasterxml/jackson/jaxrs/util/LRUMap.java index 19985967..c6801715 100644 --- a/base/src/main/java/com/fasterxml/jackson/jaxrs/util/LRUMap.java +++ b/base/src/main/java/com/fasterxml/jackson/jaxrs/util/LRUMap.java @@ -3,11 +3,15 @@ import java.util.LinkedHashMap; import java.util.Map; +// TO BE REMOVED FROM JACKSON 2.18 or later /** * Helper for simple bounded LRU maps used for reusing lookup values. * * @since 2.2 + * + * @deprecated Since 2.16.1 Use one from {@code jackson-databind} instead. */ +@Deprecated // since 2.16.1 @SuppressWarnings("serial") public class LRUMap extends LinkedHashMap { @@ -24,5 +28,4 @@ protected boolean removeEldestEntry(Map.Entry eldest) { return size() > _maxEntries; } - } diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 28f7913d..601b0e9d 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -10,6 +10,10 @@ Sub-modules: === Releases === ------------------------------------------------------------------------ +2.16.1 (not yet released) + +#178: Deprecate local `LRUMap`, use `jackson-databind` provided one instead + 2.16.0 (15-Nov-2023) No changes since 2.15