SerializableTypeWrapper does not consistently catch InvocationTargetException #30764
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
The code is as follows:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (Type.class == method.getReturnType() && ObjectUtils.isEmpty(args)) {
return forTypeProvider(new MethodInvokeTypeProvider(this.provider, method, -1));
}
else if (Type[].class == method.getReturnType() && ObjectUtils.isEmpty(args)) {
Type[] result = new Type[((Type[]) method.invoke(this.provider.getType())).length];// also calls method.invoke()
for (int i = 0; i < result.length; i++) {
result[i] = forTypeProvider(new MethodInvokeTypeProvider(this.provider, method, i));
}
return result;
}
The following code line also calls invoke, but it is not inside the try statement:
Type[] result = new Type[((Type[]) method.invoke(this.provider.getType())).length];
The text was updated successfully, but these errors were encountered: