On Thu, 30 Mar 2023 00:40:46 GMT, Mandy Chung <[email protected]> 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 (InvocationTargetException e) {
>>
>> The test should fail if invoke executes without throwing, same for below
>
> 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 `InvocationTargetException`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13233#discussion_r1152624889