RFR: 8304585: Method::invoke rewraps InvocationTargetException if a caller-sensitive method throws IAE

Mandy Chung mchung at openjdk.org
Thu Mar 30 00:43:29 UTC 2023


On Wed, 29 Mar 2023 23:58:59 GMT, Chen Liang <liach at openjdk.org> wrote:

>> A simple fix to `Method::invoke` which wraps IAE with `InvocationTargetException` twice if it's thrown by a caller-sensitive method which has no adapter.
>
> test/jdk/java/lang/reflect/Method/CallerSensitiveMethodInvoke.java line 56:
> 
>> 54:             Method m = Field.class.getDeclaredMethod("get", Object.class);
>> 55:             m.invoke(f, new Object());
>> 56:         } catch (InvocationTargetException e) {
> 
> The test should fail if invoke executes without throwing, same for below

not following what you mean.  Can you elaborate?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13233#discussion_r1152621017


More information about the core-libs-dev mailing list