Skip to content

Commit 49ffb83

Browse files
committed
Sort methods to align with PropertySource declaration order
See gh-34861
1 parent 065e50a commit 49ffb83

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -233,25 +233,25 @@ private static class ConfigurableEnvironmentPropertySource extends PropertySourc
233233

234234

235235
@Override
236-
@Nullable
237-
public Object getProperty(String name) {
236+
public boolean containsProperty(String name) {
238237
for (PropertySource<?> propertySource : super.source.getPropertySources()) {
239-
Object candidate = propertySource.getProperty(name);
240-
if (candidate != null) {
241-
return candidate;
238+
if (propertySource.containsProperty(name)) {
239+
return true;
242240
}
243241
}
244-
return null;
242+
return false;
245243
}
246244

247245
@Override
248-
public boolean containsProperty(String name) {
246+
@Nullable
247+
public Object getProperty(String name) {
249248
for (PropertySource<?> propertySource : super.source.getPropertySources()) {
250-
if (propertySource.containsProperty(name)) {
251-
return true;
249+
Object candidate = propertySource.getProperty(name);
250+
if (candidate != null) {
251+
return candidate;
252252
}
253253
}
254-
return false;
254+
return null;
255255
}
256256

257257
@Override
@@ -274,14 +274,14 @@ private static class FallbackEnvironmentPropertySource extends PropertySource<En
274274

275275

276276
@Override
277-
@Nullable
278-
public Object getProperty(String name) {
279-
return super.source.getProperty(name);
277+
public boolean containsProperty(String name) {
278+
return super.source.containsProperty(name);
280279
}
281280

282281
@Override
283-
public boolean containsProperty(String name) {
284-
return super.source.containsProperty(name);
282+
@Nullable
283+
public Object getProperty(String name) {
284+
return super.source.getProperty(name);
285285
}
286286

287287
@Override

0 commit comments

Comments
 (0)