File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
core/test/com/google/inject Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ protected void configure() {
305305 StackTraceElement [] stackTraceElement = t .getStackTrace ();
306306 int frame = 0 ;
307307 assertEquals ("explode" , stackTraceElement [frame ++].getMethodName ());
308- while (stackTraceElement [frame ]. getClassName (). startsWith ( "java.lang.invoke.LambdaForm" )) {
308+ while (isLambdaFrame ( stackTraceElement [frame ])) {
309309 frame ++; // ignore lambda frames when running tests with ShowHiddenFrames
310310 }
311311 assertEquals ("invoke" , stackTraceElement [frame ++].getMethodName ());
@@ -315,6 +315,12 @@ protected void configure() {
315315 }
316316 }
317317
318+ private static boolean isLambdaFrame (StackTraceElement element ) {
319+ var name = element .getClassName ();
320+ return name .startsWith ("java.lang.invoke.LambdaForm" )
321+ || name .startsWith ("java.lang.invoke.DirectMethodHandle" );
322+ }
323+
318324 @ Test
319325 public void testNotInterceptedMethodsInInterceptedClassDontAddFrames () {
320326 Injector injector =
You can’t perform that action at this time.
0 commit comments