Skip to content

Commit 434ab5d

Browse files
committed
Deprecate setProperties on ConfigurationFactory
Deprecate `PropertiesConfigurationFactory.setProperties()` since it was only being used in tests. Fixes gh-5930
1 parent 8d6548e commit 434ab5d

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

spring-boot/src/main/java/org/springframework/boot/bind/PropertiesConfigurationFactory.java

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import org.springframework.context.MessageSource;
3636
import org.springframework.context.MessageSourceAware;
3737
import org.springframework.core.convert.ConversionService;
38+
import org.springframework.core.env.PropertiesPropertySource;
3839
import org.springframework.core.env.PropertySources;
3940
import org.springframework.util.Assert;
4041
import org.springframework.util.StringUtils;
@@ -161,7 +162,10 @@ public void setMessageSource(MessageSource messageSource) {
161162
/**
162163
* Set the properties.
163164
* @param properties the properties
165+
* @deprecated as of 1.4 in favor of {@link #setPropertySources(PropertySources)
166+
* setPropertySources} that contains a {@link PropertiesPropertySource}.
164167
*/
168+
@Deprecated
165169
public void setProperties(Properties properties) {
166170
this.properties = properties;
167171
}

spring-boot/src/test/java/org/springframework/boot/bind/PropertiesConfigurationFactoryMapTests.java

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private Foo createFoo(final String values) throws Exception {
9595
return bindFoo(values);
9696
}
9797

98+
@Deprecated
9899
private Foo bindFoo(final String values) throws Exception {
99100
this.factory.setProperties(PropertiesLoaderUtils
100101
.loadProperties(new ByteArrayResource(values.getBytes())));

spring-boot/src/test/java/org/springframework/boot/bind/PropertiesConfigurationFactoryParameterizedTests.java

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ private Foo createFoo(final String values) throws Exception {
102102
return bindFoo(values);
103103
}
104104

105+
@Deprecated
105106
private Foo bindFoo(final String values) throws Exception {
106107
Properties properties = PropertiesLoaderUtils
107108
.loadProperties(new ByteArrayResource(values.getBytes()));

spring-boot/src/test/java/org/springframework/boot/bind/PropertiesConfigurationFactoryTests.java

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ private Foo createFoo(final String values) throws Exception {
169169
return bindFoo(values);
170170
}
171171

172+
@Deprecated
172173
private Foo bindFoo(final String values) throws Exception {
173174
this.factory.setProperties(PropertiesLoaderUtils
174175
.loadProperties(new ByteArrayResource(values.getBytes())));

0 commit comments

Comments
 (0)