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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user