From af9c1b3c566a02a8216beba07891936c642a826f Mon Sep 17 00:00:00 2001 From: nikhil-ctds Date: Fri, 13 Sep 2024 12:51:44 +0530 Subject: [PATCH] updated jackson version to 2.16.0 (cherry picked from commit 1eb6441f5edcc56d59869fde24a80c7a28ad92a1) --- pom.xml | 2 +- .../java/org/apache/pulsar/common/util/FieldParser.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index d06b80570f5cd..70cbe87778f12 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,7 @@ flexible messaging model and an intuitive client API. 2.18.0 1.69 1.0.2 - 2.14.2 + 2.16.0 0.9.11 1.6.10 8.37 diff --git a/pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java b/pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java index 40450584764a4..838f944b5d96d 100644 --- a/pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java +++ b/pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java @@ -21,8 +21,8 @@ import static com.google.common.base.Preconditions.checkArgument; import static java.lang.String.format; import static java.util.Objects.requireNonNull; -import com.fasterxml.jackson.databind.AnnotationIntrospector; -import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.DeserializationConfig; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.util.EnumResolver; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -58,7 +58,7 @@ public final class FieldParser { private static final Map CONVERTERS = new HashMap<>(); private static final Map, Class> WRAPPER_TYPES = new HashMap<>(); - private static final AnnotationIntrospector ANNOTATION_INTROSPECTOR = new JacksonAnnotationIntrospector(); + private static final DeserializationConfig DESERIALIZATION_CONFIG = new ObjectMapper().getDeserializationConfig(); static { // Preload converters and wrapperTypes. @@ -100,7 +100,7 @@ public static T convert(Object from, Class to) { if (to.isEnum()) { // Converting string to enum - EnumResolver r = EnumResolver.constructUsingToString((Class>) to, ANNOTATION_INTROSPECTOR); + EnumResolver r = EnumResolver.constructUsingToString(DESERIALIZATION_CONFIG, to); T value = (T) r.findEnum((String) from); if (value == null) { throw new RuntimeException("Invalid value '" + from + "' for enum " + to);