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.
-
Commit messages:
- 8304585: Method::invoke rewraps InvocationTargetException if a
caller-sensitive method throws IAE
Changes
On Wed, 29 Mar 2023 21:26:24 GMT, Mandy Chung 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.
Looks fine.
-
Marked as reviewed by darcy (Reviewer).
PR Review: h
On Wed, 29 Mar 2023 21:26:24 GMT, Mandy Chung 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
On Wed, 29 Mar 2023 23:58:59 GMT, Chen Liang 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:
On Thu, 30 Mar 2023 00:40:46 GMT, Mandy Chung wrote:
>> 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 (I
On Thu, 30 Mar 2023 00:50:11 GMT, Chen Liang wrote:
>> not following what you mean. Can you elaborate?
>
> Though very unlikely, I recommend adding a line of `Assertions.fail("Should
> not reach here");` after the `m.invoke` and before the catch to ensure the
> invocation always throw `Invocat
> 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.
Mandy Chung has updated the pull request incrementally with one additional
commit since the last revision:
the test should fail if M
On Thu, 30 Mar 2023 01:15:33 GMT, Mandy Chung 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.
>
> Mandy Chung has updated the pull request incrementally with one additional
On Thu, 30 Mar 2023 01:15:33 GMT, Mandy Chung 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.
>
> Mandy Chung has updated the pull request incrementally with one additional