Deprecate setProperties on ConfigurationFactory

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

Fixes gh-5930
pull/5972/head
Phillip Webb 9 years ago
parent c15c146021
commit 66b69f4346

@ -35,6 +35,7 @@ import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySources;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@ -161,7 +162,10 @@ public class PropertiesConfigurationFactory<T>
/**
* Set 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) {
this.properties = properties;
}

@ -95,6 +95,7 @@ public class PropertiesConfigurationFactoryMapTests {
return bindFoo(values);
}
@Deprecated
private Foo bindFoo(final String values) throws Exception {
this.factory.setProperties(PropertiesLoaderUtils
.loadProperties(new ByteArrayResource(values.getBytes())));

@ -102,6 +102,7 @@ public class PropertiesConfigurationFactoryParameterizedTests {
return bindFoo(values);
}
@Deprecated
private Foo bindFoo(final String values) throws Exception {
Properties properties = PropertiesLoaderUtils
.loadProperties(new ByteArrayResource(values.getBytes()));

@ -169,6 +169,7 @@ public class PropertiesConfigurationFactoryTests {
return bindFoo(values);
}
@Deprecated
private Foo bindFoo(final String values) throws Exception {
this.factory.setProperties(PropertiesLoaderUtils
.loadProperties(new ByteArrayResource(values.getBytes())));

Loading…
Cancel
Save