1
1
package tools .jackson .databind .deser ;
2
2
3
+ import java .lang .reflect .Modifier ;
3
4
import java .util .*;
4
5
5
6
import com .fasterxml .jackson .annotation .*;
@@ -938,19 +939,16 @@ protected SettableBeanProperty constructSettableProperty(DeserializationContext
938
939
JavaType type = resolveMemberAndTypeAnnotations (ctxt , mutator , propType0 );
939
940
// Does the Method specify the deserializer to use? If so, let's use it.
940
941
TypeDeserializer typeDeser = (TypeDeserializer ) type .getTypeHandler ();
941
- SettableBeanProperty prop ;
942
- if (mutator instanceof AnnotatedMethod ) {
943
- prop = new MethodProperty (propDef , type , typeDeser ,
944
- beanDescRef .getClassAnnotations (), (AnnotatedMethod ) mutator );
945
- } else {
946
- // 08-Sep-2016, tatu: wonder if we should verify it is `AnnotatedField` to be safe?
947
- prop = new FieldProperty (propDef , type , typeDeser ,
948
- beanDescRef .getClassAnnotations (), (AnnotatedField ) mutator );
942
+ // 05-May-2025, tatu: [databind#5090]/[databind#2083] Need to skip these for some reason
943
+ if (isFinalField (mutator )) {
944
+ return null ;
949
945
}
950
946
ValueDeserializer <?> deser = findDeserializerFromAnnotation (ctxt , mutator );
951
947
if (deser == null ) {
952
948
deser = (ValueDeserializer <?>) type .getValueHandler ();
953
949
}
950
+ SettableBeanProperty prop = new MethodProperty (propDef , type , typeDeser ,
951
+ beanDescRef .getClassAnnotations (), mutator );
954
952
if (deser != null ) {
955
953
deser = ctxt .handlePrimaryContextualization (deser , prop , type );
956
954
prop = prop .withValueDeserializer (deser );
@@ -967,6 +965,11 @@ protected SettableBeanProperty constructSettableProperty(DeserializationContext
967
965
return prop ;
968
966
}
969
967
968
+ private boolean isFinalField (AnnotatedMember am ) {
969
+ return am instanceof AnnotatedField
970
+ && Modifier .isFinal (am .getMember ().getModifiers ());
971
+ }
972
+
970
973
/**
971
974
* Method that will construct a regular bean property setter using
972
975
* the given setter method.
0 commit comments