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 16, 2024
1 parent f30df47 commit 3ca1654
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ 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() >= 23 || (VersionCheck.major() >=18 && Boolean.getBoolean("jdk.reflect.useDirectMethodHandle"))) {
isClassNameExpected = isSecurityFrameOrInjectedInvoker(cls);
} else {
isClassNameExpected = (cls == ReflectionMHTests.class);
Expand Down

0 comments on commit 3ca1654

Please sign in to comment.