diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java index 2d4a14da33..6c095a6bfa 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringConfigurationPropertySource.java @@ -77,7 +77,8 @@ class SpringConfigurationPropertySource implements ConfigurationPropertySource { Assert.notNull(propertySource, "PropertySource must not be null"); Assert.notNull(mapper, "Mapper must not be null"); this.propertySource = propertySource; - this.mapper = mapper; + this.mapper = (mapper instanceof DelegatingPropertyMapper ? mapper + : new DelegatingPropertyMapper(mapper)); this.containsDescendantOf = (containsDescendantOf != null ? containsDescendantOf : (n) -> ConfigurationPropertyState.UNKNOWN); }