From 30e3cf4c01cb754e300c07ba2aa15e757a727bfa Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Tue, 3 Apr 2018 16:12:24 -0700 Subject: [PATCH] Make sure property mapping exception are swallowed --- .../properties/source/SpringConfigurationPropertySource.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }