@@ -240,9 +240,6 @@ private <T> T convert(Object value, Bindable<T> target) {
240
240
private <T > Object bindObject (ConfigurationPropertyName name , Bindable <T > target ,
241
241
BindHandler handler , Context context ) throws Exception {
242
242
ConfigurationProperty property = findProperty (name , context );
243
- if (property == null && containsNoDescendantOf (context .streamSources (), name )) {
244
- return null ;
245
- }
246
243
AggregateBinder <?> aggregateBinder = getAggregateBinder (target , context );
247
244
if (aggregateBinder != null ) {
248
245
return bindAggregate (name , target , handler , context , aggregateBinder );
@@ -295,8 +292,7 @@ private <T> Object bindProperty(ConfigurationPropertyName name, Bindable<T> targ
295
292
296
293
private Object bindBean (ConfigurationPropertyName name , Bindable <?> target ,
297
294
BindHandler handler , Context context ) {
298
- if (containsNoDescendantOf (context .streamSources (), name )
299
- || isUnbindableBean (name , target , context )) {
295
+ if (isUnbindableBean (name , target , context )) {
300
296
return null ;
301
297
}
302
298
BeanPropertyBinder propertyBinder = (propertyName , propertyTarget ) -> bind (
@@ -327,12 +323,6 @@ private boolean isUnbindableBean(ConfigurationPropertyName name, Bindable<?> tar
327
323
return packageName .startsWith ("java." );
328
324
}
329
325
330
- private boolean containsNoDescendantOf (Stream <ConfigurationPropertySource > sources ,
331
- ConfigurationPropertyName name ) {
332
- return sources .allMatch (
333
- (s ) -> s .containsDescendantOf (name ) == ConfigurationPropertyState .ABSENT );
334
- }
335
-
336
326
/**
337
327
* Create a new {@link Binder} instance from the specified environment.
338
328
* @param environment the environment source (must have attached
0 commit comments