File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
test/functional/cmdline_options_testresources/src_80/com/ibm/j9/getcallerclass Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 33
33
*/
34
34
public class ReflectionMHTests {
35
35
36
+ private static boolean isSecurityFrameOrInjectedInvoker (Class <?> cls ) {
37
+ return ("java.lang.invoke.SecurityFrame" == cls .getName ()
38
+ || cls .getName ().startsWith ("java.lang.invoke.MethodHandleImpl$BindCaller$T/" ));
39
+ }
40
+
36
41
/**
37
42
* Call getCallerClass() with a helper method via reflection from the bootstrap/extension
38
43
* classloader
@@ -108,7 +113,7 @@ public static boolean test_getCallerClass_Helper_MethodHandle_fromBootExtWithAnn
108
113
methodHandle = lookup .findStatic (GetCallerClassTests .class , "test_getCallerClass_MethodHandle" , methodType );
109
114
cls = (Class <?>) methodHandle .invoke ();
110
115
111
- if ("java.lang.invoke.SecurityFrame" == cls . getName ( )) {
116
+ if (isSecurityFrameOrInjectedInvoker ( cls )) {
112
117
System .out .println (TESTCASE_NAME + ": PASSED: return " + cls .getName ());
113
118
return true ;
114
119
} else {
@@ -174,7 +179,7 @@ public static boolean test_getCallerClass_MethodHandle_ArgumentHelper() {
174
179
MethodHandle mhResult = MethodHandles .foldArguments (mhTarget , mhCombiner );
175
180
cls = (Class <?>) mhResult .invoke ();
176
181
177
- if ("java.lang.invoke.SecurityFrame" == cls . getName ( )) {
182
+ if (isSecurityFrameOrInjectedInvoker ( cls )) {
178
183
System .out .println (TESTCASE_NAME + ": PASSED: return " + cls .getName ());
179
184
return true ;
180
185
} else {
You can’t perform that action at this time.
0 commit comments