Avoid package cycle through dedicated ResourcePropertiesPersister

See gh-25151
This commit is contained in:
Juergen Hoeller
2020-06-23 16:54:55 +02:00
parent 8eedd9d5cc
commit 56c661829b
7 changed files with 100 additions and 41 deletions

View File

@@ -35,8 +35,8 @@ import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.ResourcePropertiesPersister;
import org.springframework.lang.Nullable;
import org.springframework.util.DefaultPropertiesPersister;
import org.springframework.util.PropertiesPersister;
import org.springframework.util.StringUtils;
@@ -148,7 +148,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
@Nullable
private String defaultParentBean;
private PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
private PropertiesPersister propertiesPersister = ResourcePropertiesPersister.INSTANCE;
/**
@@ -187,12 +187,12 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
/**
* Set the PropertiesPersister to use for parsing properties files.
* The default is DefaultPropertiesPersister.
* @see org.springframework.util.DefaultPropertiesPersister
* The default is ResourcePropertiesPersister.
* @see ResourcePropertiesPersister#INSTANCE
*/
public void setPropertiesPersister(@Nullable PropertiesPersister propertiesPersister) {
this.propertiesPersister =
(propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
(propertiesPersister != null ? propertiesPersister : ResourcePropertiesPersister.INSTANCE);
}
/**