@@ -969,14 +969,18 @@ protected void _addExplicitAnyCreator(DeserializationContext ctxt,
969
969
paramName = candidate .explicitParamName (0 );
970
970
971
971
// If there's injection or explicit name, should be properties-based
972
- useProps = (paramName != null ) || (injectId != null );
973
- if (!useProps && (paramDef != null )) {
974
- // One more thing: if implicit name matches property with a getter
975
- // or field, we'll consider it property-based as well
976
-
977
- // 01-Dec-2022, tatu: [databind#3654] Consider `@JsonValue` to strongly
978
- // hint at delegation-based
979
- if (beanDesc .findJsonValueAccessor () == null ) {
972
+ useProps = (paramName != null );
973
+ if (!useProps ) {
974
+ // Otherwise, `@JsonValue` suggests delegation
975
+ if (beanDesc .findJsonValueAccessor () != null ) {
976
+ ;
977
+ } else if (injectId != null ) {
978
+ // But Injection suggests property-based (for legacy reasons?)
979
+ useProps = true ;
980
+ } else if (paramDef != null ) {
981
+ // One more thing: if implicit name matches property with a getter
982
+ // or field, we'll consider it property-based as well
983
+
980
984
// 25-May-2018, tatu: as per [databind#2051], looks like we have to get
981
985
// not implicit name, but name with possible strategy-based-rename
982
986
// paramName = candidate.findImplicitParamName(0);
@@ -1009,9 +1013,8 @@ private boolean _checkIfCreatorPropertyBased(BeanDescription beanDesc,
1009
1013
AnnotationIntrospector intr ,
1010
1014
AnnotatedWithParams creator , BeanPropertyDefinition propDef )
1011
1015
{
1012
- // If explicit name, or inject id, property-based
1013
- if (((propDef != null ) && propDef .isExplicitlyNamed ())
1014
- || (intr .findInjectableValue (creator .getParameter (0 )) != null )) {
1016
+ // If explicit name, property-based
1017
+ if ((propDef != null ) && propDef .isExplicitlyNamed ()) {
1015
1018
return true ;
1016
1019
}
1017
1020
// 01-Dec-2022, tatu: [databind#3654] Consider `@JsonValue` to strongly
@@ -1020,6 +1023,11 @@ private boolean _checkIfCreatorPropertyBased(BeanDescription beanDesc,
1020
1023
return false ;
1021
1024
}
1022
1025
1026
+ // Inject id considered property-based
1027
+ // 01-Dec-2022, tatu: ... but why?
1028
+ if (intr .findInjectableValue (creator .getParameter (0 )) != null ) {
1029
+ return true ;
1030
+ }
1023
1031
if (propDef != null ) {
1024
1032
// One more thing: if implicit name matches property with a getter
1025
1033
// or field, we'll consider it property-based as well
0 commit comments