Skip to content

Commit

Permalink
Fix ReflectionMHTests for -Djdk.reflect.useDirectMethodHandle=false
Browse files Browse the repository at this point in the history
Previously for JEP416, adjustments were made to ReflectionMHTests to
adapt the frames for method handles. This test was failing when
`-Djdk.reflect.useDirectMethodHandle=false` option is set. Adding an
additional check in the test to see if the property is set to true to
call for InjectedInvoker check.

Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
  • Loading branch information
r30shah committed Sep 17, 2024
1 parent 7789c85 commit 3fc532d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public static boolean test_getCallerClass_Helper_Reflection_fromBootExtWithAnnot
cls = (Class<?>) method.invoke(null, new Object[0]);

boolean isClassNameExpected;
if (VersionCheck.major() >= 18) {
if ((VersionCheck.major() >= 18)
&& (Boolean.getBoolean("jdk.reflect.useDirectMethodHandle") || (VersionCheck.major() != 21))
) {
isClassNameExpected = isSecurityFrameOrInjectedInvoker(cls);
} else {
isClassNameExpected = (cls == ReflectionMHTests.class);
Expand Down

0 comments on commit 3fc532d

Please sign in to comment.