diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java index 084e61f2bc..d1a9c4c2ba 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/PropertyDescriptorResolver.java @@ -58,23 +58,22 @@ class PropertyDescriptorResolver { if (factoryMethod != null) { return resolveJavaBeanProperties(type, factoryMethod, members); } - return resolve(ConfigurationPropertiesTypeElement.of(type, this.environment), factoryMethod, members); + return resolve(ConfigurationPropertiesTypeElement.of(type, this.environment), members); } - private Stream> resolve(ConfigurationPropertiesTypeElement type, - ExecutableElement factoryMethod, TypeElementMembers members) { + private Stream> resolve(ConfigurationPropertiesTypeElement type, TypeElementMembers members) { if (type.isConstructorBindingEnabled()) { ExecutableElement constructor = type.getBindConstructor(); if (constructor != null) { - return resolveConstructorProperties(type.getType(), factoryMethod, members, constructor); + return resolveConstructorProperties(type.getType(), members, constructor); } return Stream.empty(); } - return resolveJavaBeanProperties(type.getType(), factoryMethod, members); + return resolveJavaBeanProperties(type.getType(), null, members); } - Stream> resolveConstructorProperties(TypeElement type, ExecutableElement factoryMethod, - TypeElementMembers members, ExecutableElement constructor) { + Stream> resolveConstructorProperties(TypeElement type, TypeElementMembers members, + ExecutableElement constructor) { Map> candidates = new LinkedHashMap<>(); constructor.getParameters().forEach((parameter) -> { String name = getParameterName(parameter); @@ -82,8 +81,8 @@ class PropertyDescriptorResolver { ExecutableElement getter = members.getPublicGetter(name, propertyType); ExecutableElement setter = members.getPublicSetter(name, propertyType); VariableElement field = members.getFields().get(name); - register(candidates, new ConstructorParameterPropertyDescriptor(type, factoryMethod, parameter, name, - propertyType, field, getter, setter)); + register(candidates, new ConstructorParameterPropertyDescriptor(type, null, parameter, name, propertyType, + field, getter, setter)); }); return candidates.values().stream(); }