You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spring-boot/spring-boot-project
Phillip Webb 84b13f0748 Refine constructor detection logic when binding to existing values
Update `DefaultBindConstructorProvider` so that deduced constructors
are not used if there is an existing value.

Prior to this commit, constructor detection logic was not compatible
with earlier versions of Spring Boot. With Spring Boot 3.0.1, given
a class of the following form:

	@ConfigurationProperties(prefix = "example")
	public class ExampleProperties {

	    @NestedConfigurationProperty
	    private final NestedProperty nested = new NestedProperty(
	    		"Default", "default");

	    public NestedProperty getNested() {
	        return nested;
	    }

	}

If `NestedProperty` has a single constructor with arguments, constructor
binding would be used. In Spring Boot 2.x, setter injection would have
been used.

The updated code now only uses constructor injection if an explicit
`@ConstructorBinding` annotation is present, or if there is no existing
value.

Fixes gh-33409
See gh-33710
2 years ago
..
spring-boot Refine constructor detection logic when binding to existing values 2 years ago
spring-boot-actuator Update copyright year of changed files 2 years ago
spring-boot-actuator-autoconfigure Update copyright year of changed files 2 years ago
spring-boot-autoconfigure Update copyright year of changed files 2 years ago
spring-boot-dependencies Upgrade to Undertow 2.3.2.Final 2 years ago
spring-boot-devtools Update copyright year of changed files 2 years ago
spring-boot-docs Add reference to Spring Authorization Server project 2 years ago
spring-boot-parent Allow spring properties to be used in logback <if> blocks 2 years ago
spring-boot-starters Make sure the 'native' profile can be used in a multi-modules project 2 years ago
spring-boot-test Update copyright year of changed files 2 years ago
spring-boot-test-autoconfigure Update copyright year of changed files 2 years ago
spring-boot-tools Update copyright year of changed files 2 years ago