Skip to content

Commit 47d4559

Browse files
committed
Removed checking for descendant properties.
The check has been removed so that fallback properties may come from a different namespace than the original property (spring-projects#7986).
1 parent 0a759da commit 47d4559

File tree

1 file changed

+1
-11
lines changed
  • spring-boot/src/main/java/org/springframework/boot/context/properties/bind

1 file changed

+1
-11
lines changed

spring-boot/src/main/java/org/springframework/boot/context/properties/bind/Binder.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,6 @@ private <T> T convert(Object value, Bindable<T> target) {
240240
private <T> Object bindObject(ConfigurationPropertyName name, Bindable<T> target,
241241
BindHandler handler, Context context) throws Exception {
242242
ConfigurationProperty property = findProperty(name, context);
243-
if (property == null && containsNoDescendantOf(context.streamSources(), name)) {
244-
return null;
245-
}
246243
AggregateBinder<?> aggregateBinder = getAggregateBinder(target, context);
247244
if (aggregateBinder != null) {
248245
return bindAggregate(name, target, handler, context, aggregateBinder);
@@ -295,8 +292,7 @@ private <T> Object bindProperty(ConfigurationPropertyName name, Bindable<T> targ
295292

296293
private Object bindBean(ConfigurationPropertyName name, Bindable<?> target,
297294
BindHandler handler, Context context) {
298-
if (containsNoDescendantOf(context.streamSources(), name)
299-
|| isUnbindableBean(name, target, context)) {
295+
if (isUnbindableBean(name, target, context)) {
300296
return null;
301297
}
302298
BeanPropertyBinder propertyBinder = (propertyName, propertyTarget) -> bind(
@@ -327,12 +323,6 @@ private boolean isUnbindableBean(ConfigurationPropertyName name, Bindable<?> tar
327323
return packageName.startsWith("java.");
328324
}
329325

330-
private boolean containsNoDescendantOf(Stream<ConfigurationPropertySource> sources,
331-
ConfigurationPropertyName name) {
332-
return sources.allMatch(
333-
(s) -> s.containsDescendantOf(name) == ConfigurationPropertyState.ABSENT);
334-
}
335-
336326
/**
337327
* Create a new {@link Binder} instance from the specified environment.
338328
* @param environment the environment source (must have attached

0 commit comments

Comments
 (0)