Skip to content

Commit

Permalink
updated jackson version to 2.16.0
Browse files Browse the repository at this point in the history
(cherry picked from commit 1eb6441)
  • Loading branch information
nikhil-ctds authored and dlg99 committed Sep 13, 2024
1 parent c161a83 commit af9c1b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ flexible messaging model and an intuitive client API.</description>
<log4j2.version>2.18.0</log4j2.version>
<bouncycastle.version>1.69</bouncycastle.version>
<bouncycastlefips.version>1.0.2</bouncycastlefips.version>
<jackson.version>2.14.2</jackson.version>
<jackson.version>2.16.0</jackson.version>
<reflections.version>0.9.11</reflections.version>
<swagger.version>1.6.10</swagger.version>
<puppycrawl.checkstyle.version>8.37</puppycrawl.checkstyle.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -58,7 +58,7 @@ public final class FieldParser {
private static final Map<String, Method> CONVERTERS = new HashMap<>();
private static final Map<Class<?>, 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.
Expand Down Expand Up @@ -100,7 +100,7 @@ public static <T> T convert(Object from, Class<T> to) {

if (to.isEnum()) {
// Converting string to enum
EnumResolver r = EnumResolver.constructUsingToString((Class<Enum<?>>) 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);
Expand Down

0 comments on commit af9c1b3

Please sign in to comment.