From 0262bbaca1f747ffe9d809402fd6439df47a3eed Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sun, 26 Jan 2025 12:20:02 -0800 Subject: [PATCH 1/2] Merge tiny clean up from #4929 before PR itself (#4930) --- .../jackson/databind/deser/BasicDeserializerFactory.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java index 25601f88c4..002a265b61 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java @@ -1244,10 +1244,9 @@ public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt, throws JsonMappingException { final DeserializationConfig config = ctxt.getConfig(); - BeanDescription beanDesc = null; + final BeanDescription beanDesc = config.introspectClassAnnotations(type); KeyDeserializer deser = null; if (_factoryConfig.hasKeyDeserializers()) { - beanDesc = config.introspectClassAnnotations(type); for (KeyDeserializers d : _factoryConfig.keyDeserializers()) { deser = d.findKeyDeserializer(type, config, beanDesc); if (deser != null) { @@ -1259,9 +1258,6 @@ public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt, // the only non-standard thing is this: if (deser == null) { // [databind#2452]: Support `@JsonDeserialize(keyUsing = ...)` - if (beanDesc == null) { - beanDesc = config.introspectClassAnnotations(type.getRawClass()); - } deser = findKeyDeserializerFromAnnotation(ctxt, beanDesc.getClassInfo()); if (deser == null) { if (type.isEnumType()) { From 603fd9bb3540e775ec5c150a8d11c76331c7d131 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Sun, 26 Jan 2025 12:20:02 -0800 Subject: [PATCH 2/2] Merge tiny clean up from #4929 before PR itself (#4930) --- .../jackson/databind/deser/BasicDeserializerFactory.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java index 50d6d03055..dfa60cf04e 100644 --- a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java +++ b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java @@ -1268,10 +1268,9 @@ public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt, throws JsonMappingException { final DeserializationConfig config = ctxt.getConfig(); - BeanDescription beanDesc = null; + final BeanDescription beanDesc = config.introspectClassAnnotations(type); KeyDeserializer deser = null; if (_factoryConfig.hasKeyDeserializers()) { - beanDesc = config.introspectClassAnnotations(type); for (KeyDeserializers d : _factoryConfig.keyDeserializers()) { deser = d.findKeyDeserializer(type, config, beanDesc); if (deser != null) { @@ -1283,9 +1282,6 @@ public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt, // the only non-standard thing is this: if (deser == null) { // [databind#2452]: Support `@JsonDeserialize(keyUsing = ...)` - if (beanDesc == null) { - beanDesc = config.introspectClassAnnotations(type.getRawClass()); - } deser = findKeyDeserializerFromAnnotation(ctxt, beanDesc.getClassInfo()); if (deser == null) { if (type.isEnumType()) {