Skip to content

Commit 35055fd

Browse files
committed
Refactor PropertyResolver impl for consistency
PropertySourcesPropertyResolver#containsProperty now calls #containsProperty on each underlying PropertySource instead of calling #getProperty and checking for null. Issue: SPR-9529
1 parent 027e49c commit 35055fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-core/src/main/java/org/springframework/core/env/PropertySourcesPropertyResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public PropertySourcesPropertyResolver(PropertySources propertySources) {
4545

4646
public boolean containsProperty(String key) {
4747
for (PropertySource<?> propertySource : this.propertySources) {
48-
if (propertySource.getProperty(key) != null) {
48+
if (propertySource.containsProperty(key)) {
4949
return true;
5050
}
5151
}

0 commit comments

Comments
 (0)