mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE
Reviewed-by: darcy, jpai, alanb
This commit is contained in:
parent
9df2060059
commit
1d7bb1ffa0
2 changed files with 86 additions and 6 deletions
|
@ -174,12 +174,8 @@ class DirectMethodHandleAccessor extends MethodAccessorImpl {
|
|||
// caller-sensitive method is invoked through a per-caller invoker while
|
||||
// the target MH is always spreading the args
|
||||
var invoker = JLIA.reflectiveInvoker(caller);
|
||||
try {
|
||||
// invoke the target method handle via an invoker
|
||||
return invoker.invokeExact(target, obj, args);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new InvocationTargetException(e);
|
||||
}
|
||||
// invoke the target method handle via an invoker
|
||||
return invoker.invokeExact(target, obj, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue