Closed
Description
Alireza Fattahi opened SPR-14001 and commented
As mentioned in http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/config/PropertyResourceConfigurer.html:
the convertPropertyValue method has been documented as:
Convert the given property value from the properties source to the value which should be applied.
The default implementation simply returns the original value. Can be overridden in subclasses, for example to detect encrypted values and decrypt them accordingly.
So instead of using:
<context:property-placeholder location="classpath:/configs/*.properties,classpath:/configs/bsi/*-config.properties" />
I used this:
<bean class="foo.bar.security.DecryptPropertyConfigurer">
<property name="locations">
<list>
<value>classpath:/configs/*.properties</value>
<value>classpath:/configs/bsi/*-config.properties</value>
</list>
</property>
</bean>
an the new PropertySourcesPlaceholderConfigurer is defined as:
public class DecryptPropertyConfigurer extends PropertySourcesPlaceholderConfigurer {
@Override
protected String convertPropertyValue(String originalValue){
//for some properties, do some conversions
}
}
The convert method is never called. Am I missing some thing our this is a bug?!
Affects: 4.2.4
Issue Links:
- PropertySourcesPlaceholderConfigurer never calls "convertProperties" on merged properties [SPR-8928] #13568 PropertySourcesPlaceholderConfigurer never calls "convertProperties" on merged properties ("duplicates")
- Allow the use of custom PropertySource annotations in @Configuration classes [SPR-8963] #13603 Allow the use of custom PropertySource annotations in
@Configuration
classes