Skip to content

Commit 2b3539a

Browse files
committed
Merge pull request #26761 from 1zg12
* pr/26761: Polish "Restore customization of PropertyResolver" Restore customization of PropertyResolver Closes gh-26761
2 parents 89b7a6b + 2731d4f commit 2b3539a

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -170,10 +170,19 @@ public String getProperty(String key) {
170170
}
171171
}
172172

173-
processProperties(beanFactory, new PropertySourcesPropertyResolver(this.propertySources));
173+
processProperties(beanFactory, createPropertyResolver(this.propertySources));
174174
this.appliedPropertySources = this.propertySources;
175175
}
176176

177+
/**
178+
* Create a {@link ConfigurablePropertyResolver} for the specified property sources.
179+
* @param propertySources the property sources to use
180+
* @since 6.0.12
181+
*/
182+
protected ConfigurablePropertyResolver createPropertyResolver(MutablePropertySources propertySources){
183+
return new PropertySourcesPropertyResolver(propertySources);
184+
}
185+
177186
/**
178187
* Visit each bean definition in the given bean factory and attempt to replace ${...} property
179188
* placeholders with values from the given properties.

0 commit comments

Comments
 (0)