@@ -1269,8 +1269,11 @@ public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt,
1269
1269
{
1270
1270
final DeserializationConfig config = ctxt .getConfig ();
1271
1271
final BeanDescription beanDesc = config .introspectClassAnnotations (type );
1272
- KeyDeserializer deser = null ;
1273
- if (_factoryConfig .hasKeyDeserializers ()) {
1272
+
1273
+ // [databind#2452]: Support `@JsonDeserialize(keyUsing = ...)`
1274
+ KeyDeserializer deser = findKeyDeserializerFromAnnotation (ctxt , beanDesc .getClassInfo ());
1275
+
1276
+ if (deser == null && _factoryConfig .hasKeyDeserializers ()) {
1274
1277
for (KeyDeserializers d : _factoryConfig .keyDeserializers ()) {
1275
1278
deser = d .findKeyDeserializer (type , config , beanDesc );
1276
1279
if (deser != null ) {
@@ -1281,14 +1284,10 @@ public KeyDeserializer createKeyDeserializer(DeserializationContext ctxt,
1281
1284
1282
1285
// the only non-standard thing is this:
1283
1286
if (deser == null ) {
1284
- // [databind#2452]: Support `@JsonDeserialize(keyUsing = ...)`
1285
- deser = findKeyDeserializerFromAnnotation (ctxt , beanDesc .getClassInfo ());
1286
- if (deser == null ) {
1287
- if (type .isEnumType ()) {
1288
- deser = _createEnumKeyDeserializer (ctxt , type );
1289
- } else {
1290
- deser = StdKeyDeserializers .findStringBasedKeyDeserializer (config , type );
1291
- }
1287
+ if (type .isEnumType ()) {
1288
+ deser = _createEnumKeyDeserializer (ctxt , type );
1289
+ } else {
1290
+ deser = StdKeyDeserializers .findStringBasedKeyDeserializer (config , type );
1292
1291
}
1293
1292
}
1294
1293
// and then post-processing
0 commit comments