Apply "instanceof pattern matching" in PropertySourcesPlaceholderConfigurer
See gh-27947
This commit is contained in:
parent
d72cf89ebf
commit
e565d2cabb
|
@ -137,8 +137,8 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS
|
||||||
// local PropertyResolver to enforce that setting, since the Environment is most
|
// local PropertyResolver to enforce that setting, since the Environment is most
|
||||||
// likely not configured with ignoreUnresolvablePlaceholders set to true.
|
// likely not configured with ignoreUnresolvablePlaceholders set to true.
|
||||||
// See https://github.com/spring-projects/spring-framework/issues/27947
|
// See https://github.com/spring-projects/spring-framework/issues/27947
|
||||||
if (this.ignoreUnresolvablePlaceholders && (this.environment instanceof ConfigurableEnvironment)) {
|
if (this.ignoreUnresolvablePlaceholders &&
|
||||||
ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) this.environment;
|
(this.environment instanceof ConfigurableEnvironment configurableEnvironment)) {
|
||||||
PropertySourcesPropertyResolver resolver =
|
PropertySourcesPropertyResolver resolver =
|
||||||
new PropertySourcesPropertyResolver(configurableEnvironment.getPropertySources());
|
new PropertySourcesPropertyResolver(configurableEnvironment.getPropertySources());
|
||||||
resolver.setIgnoreUnresolvableNestedPlaceholders(true);
|
resolver.setIgnoreUnresolvableNestedPlaceholders(true);
|
||||||
|
|
Loading…
Reference in New Issue