-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Dennis Mellert opened SPR-14737 and commented
When loading a Yaml resource (using YamlPropertiesFactoryBean) and passing it to a PropertyPlaceholderConfigurer (using <property name="properties" ref="yamlProperties" />) only String in the Yaml are replaced correctly.
The Problem seems to be that org.springframework.beans.factory.config.PropertyResourceConfigurer.convertProperties(Properties) only handles Strings (String propertyValue = props.getProperty(propertyName);). Since the propertyValue is not a String in this case (as parsed from YamlPropertiesFactoryBean, the method call returns null.
Workaround: Overriding convertProperties and dealing with propertyValues as Object: (Object propertyValue = props.get(propertyName);
Affects: 4.3.3
Issue Links:
- mergePropertiesIntoMap only works with String [SPR-5669] #10340 mergePropertiesIntoMap only works with String
- Allow YamlProcessor subclasses to build the flattened map [SPR-12499] #17104 Allow YamlProcessor subclasses to build the flattened map
- YamlPropertiesFactoryBean loses entries in the YAML document that have an empty array value [SPR-16769] #21310 YamlPropertiesFactoryBean loses entries in the YAML document that have an empty array value