Use BeanUtils to instantiate target type

Use BeanUtils.instantiate(Class<?>) instead of a raw call to
type.newInstance() as the former has more checks.

Issue: SPR-12520
This commit is contained in:
Stephane Nicoll
2015-05-15 11:43:18 +02:00
parent 8dec8823fb
commit c0269770af

View File

@@ -648,7 +648,7 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
return CollectionFactory.createMap(type, (keyDesc != null ? keyDesc.getType() : null), 16);
}
else {
return type.newInstance();
return BeanUtils.instantiate(type);
}
}
catch (Exception ex) {