@@ -1054,33 +1054,38 @@ private void _addCreatorParams(Map<String, POJOPropertyBuilder> props,
10541054 final PropertyName explName = ctor .explicitName (i );
10551055 PropertyName implName = ctor .implicitName (i );
10561056 final boolean hasExplicit = (explName != null );
1057- final POJOPropertyBuilder prop ;
1058-
1059- // neither implicit nor explicit name?
1060- if (!hasExplicit && (implName == null )) {
1061- boolean isUnwrapping = _annotationIntrospector .findUnwrappingNameTransformer (_config , param ) != null ;
1057+ final boolean hasImplicit = (implName != null );
10621058
1063- if (isUnwrapping ) {
1059+ // First: check "Unwrapped" unless explicit name
1060+ if (!hasExplicit ) {
1061+ var unwrapper = _annotationIntrospector .findUnwrappingNameTransformer (_config , param );
1062+ if (unwrapper != null ) {
10641063 // If unwrapping, can use regardless of name; we will use a placeholder name
10651064 // anyway to try to avoid name conflicts.
10661065 PropertyName name = UnwrappedPropertyHandler .creatorParamName (param .getIndex ());
1067- prop = _property (props , name );
1066+ final POJOPropertyBuilder prop = _property (props , name );
10681067 prop .addCtor (param , name , false , true , false );
1069- } else {
1068+ creatorProps .add (prop );
1069+ continue ;
1070+ }
1071+ if (!hasImplicit ) {
10701072 // Without name, cannot make use of this creator parameter -- may or may not
10711073 // be a problem, verified at a later point.
1072- prop = null ;
1074+ creatorProps .add (null );
1075+ continue ;
10731076 }
1077+ }
1078+
1079+ // 27-Dec-2019, tatu: [databind#2527] may need to rename according to field
1080+ final POJOPropertyBuilder prop ;
1081+ if (hasImplicit ) {
1082+ String n = _checkRenameByField (implName .getSimpleName ());
1083+ implName = PropertyName .construct (n );
1084+ prop = _property (props , implName );
10741085 } else {
1075- // 27-Dec-2019, tatu: [databind#2527] may need to rename according to field
1076- if (implName != null ) {
1077- String n = _checkRenameByField (implName .getSimpleName ());
1078- implName = PropertyName .construct (n );
1079- }
1080- prop = (implName == null )
1081- ? _property (props , explName ) : _property (props , implName );
1082- prop .addCtor (param , hasExplicit ? explName : implName , hasExplicit , true , false );
1086+ prop = _property (props , explName );
10831087 }
1088+ prop .addCtor (param , hasExplicit ? explName : implName , hasExplicit , true , false );
10841089 creatorProps .add (prop );
10851090 }
10861091 ctor .assignPropertyDefs (creatorProps );
0 commit comments