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 7f66c8f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public static boolean test_getCallerClass_Helper_Reflection_fromBootExtWithAnnot
cls = (Class<?>) method.invoke(null, new Object[0]);

boolean isClassNameExpected;
if (VersionCheck.major() >= 18) {
String useDMHStr = System.getProperties().getProperty("jdk.reflect.useDirectMethodHandle");
if (VersionCheck.major() >= 18 && (useDMHStr != null && useDMHStr.equals("true"))) {
isClassNameExpected = isSecurityFrameOrInjectedInvoker(cls);
} else {
isClassNameExpected = (cls == ReflectionMHTests.class);
Expand Down

0 comments on commit 7f66c8f

Please sign in to comment.