• Phillip Webb's avatar
    Support `.` and `_` binder prefix joins · b0d9a832
    Phillip Webb authored
    Update RelaxedDataBinder so that both `.` and `_` are considered in
    getPropertyValuesForNamePrefix(...).
    
    With Spring Boot 1.2.5 binding environment variables of the form
    `FOO_BAR_BAZ` to `@ConfigurationProperties(prefix="foo-bar")` objects
    worked thanks to a happy accident. When `PropertySourcesPropertyValues`
    processed a non enumerable `PropertySource` it called the resolver
    with a property name `FOO_BAR.BAZ`. A `SystemEnvironmentPropertySource`
    will replace `.` with `_` and hence find a value.
    
    Commit 1abd0879 updated non enumerable processing such that the resolver
    was never called.
    
    Replicating the problem is quite involved as you need to ensure that you
    have both a SystemEnvironmentPropertySource and a non-enumerable
    property source (e.g. RandomPropertySource). A test has been added to
    PropertiesConfigurationFactoryTests which passes on 1.2.5, fails on
    1.2.6 and passes again following this commit.
    
    Fixes gh-4045
    b0d9a832
Name
Last commit
Last update
docs Loading commit data...
eclipse Loading commit data...
spring-boot Loading commit data...
spring-boot-actuator Loading commit data...
spring-boot-autoconfigure Loading commit data...
spring-boot-cli Loading commit data...
spring-boot-dependencies Loading commit data...
spring-boot-deployment-tests Loading commit data...
spring-boot-docs Loading commit data...
spring-boot-full-build Loading commit data...
spring-boot-integration-tests Loading commit data...
spring-boot-parent Loading commit data...
spring-boot-samples Loading commit data...
spring-boot-starters Loading commit data...
spring-boot-tools Loading commit data...
spring-boot-versions Loading commit data...
.gitignore Loading commit data...
.settings-template.xml Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.adoc Loading commit data...
LICENSE.txt Loading commit data...
README.adoc Loading commit data...
pom.xml Loading commit data...