Avoid instantiation of BeanPropertyBinder in Binder

Closes gh-15181
This commit is contained in:
dreis2211 2018-11-15 14:54:52 +01:00 committed by Stephane Nicoll
parent c65b21124a
commit a1a8a8cef0
1 changed files with 2 additions and 2 deletions

View File

@ -333,12 +333,12 @@ public class Binder {
|| isUnbindableBean(name, target, context)) {
return null;
}
BeanPropertyBinder propertyBinder = (propertyName, propertyTarget) -> bind(
name.append(propertyName), propertyTarget, handler, context, false);
Class<?> type = target.getType().resolve(Object.class);
if (!allowRecursiveBinding && context.hasBoundBean(type)) {
return null;
}
BeanPropertyBinder propertyBinder = (propertyName, propertyTarget) -> bind(
name.append(propertyName), propertyTarget, handler, context, false);
return context.withBean(type, () -> {
Stream<?> boundBeans = BEAN_BINDERS.stream()
.map((b) -> b.bind(name, target, context, propertyBinder));