Commit 66b69f43 authored by Phillip Webb's avatar Phillip Webb

Deprecate setProperties on ConfigurationFactory

Deprecate `PropertiesConfigurationFactory.setProperties()` since it was
only being used in tests.

Fixes gh-5930
parent c15c1460
...@@ -35,6 +35,7 @@ import org.springframework.beans.factory.InitializingBean; ...@@ -35,6 +35,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.MessageSource; import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware; import org.springframework.context.MessageSourceAware;
import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.ConversionService;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySources; import org.springframework.core.env.PropertySources;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
...@@ -161,7 +162,10 @@ public class PropertiesConfigurationFactory<T> ...@@ -161,7 +162,10 @@ public class PropertiesConfigurationFactory<T>
/** /**
* Set the properties. * Set the properties.
* @param properties the properties * @param properties the properties
* @deprecated as of 1.4 in favor of {@link #setPropertySources(PropertySources)
* setPropertySources} that contains a {@link PropertiesPropertySource}.
*/ */
@Deprecated
public void setProperties(Properties properties) { public void setProperties(Properties properties) {
this.properties = properties; this.properties = properties;
} }
......
...@@ -95,6 +95,7 @@ public class PropertiesConfigurationFactoryMapTests { ...@@ -95,6 +95,7 @@ public class PropertiesConfigurationFactoryMapTests {
return bindFoo(values); return bindFoo(values);
} }
@Deprecated
private Foo bindFoo(final String values) throws Exception { private Foo bindFoo(final String values) throws Exception {
this.factory.setProperties(PropertiesLoaderUtils this.factory.setProperties(PropertiesLoaderUtils
.loadProperties(new ByteArrayResource(values.getBytes()))); .loadProperties(new ByteArrayResource(values.getBytes())));
......
...@@ -102,6 +102,7 @@ public class PropertiesConfigurationFactoryParameterizedTests { ...@@ -102,6 +102,7 @@ public class PropertiesConfigurationFactoryParameterizedTests {
return bindFoo(values); return bindFoo(values);
} }
@Deprecated
private Foo bindFoo(final String values) throws Exception { private Foo bindFoo(final String values) throws Exception {
Properties properties = PropertiesLoaderUtils Properties properties = PropertiesLoaderUtils
.loadProperties(new ByteArrayResource(values.getBytes())); .loadProperties(new ByteArrayResource(values.getBytes()));
......
...@@ -169,6 +169,7 @@ public class PropertiesConfigurationFactoryTests { ...@@ -169,6 +169,7 @@ public class PropertiesConfigurationFactoryTests {
return bindFoo(values); return bindFoo(values);
} }
@Deprecated
private Foo bindFoo(final String values) throws Exception { private Foo bindFoo(final String values) throws Exception {
this.factory.setProperties(PropertiesLoaderUtils this.factory.setProperties(PropertiesLoaderUtils
.loadProperties(new ByteArrayResource(values.getBytes()))); .loadProperties(new ByteArrayResource(values.getBytes())));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment