File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -285,10 +285,10 @@ private Class<?> deduceMainApplicationClass() {
285
285
}
286
286
287
287
private Optional <Class <?>> findMainClass (Stream <StackFrame > stack ) {
288
- return stack
289
- .filter ((frame ) -> Objects .equals (frame .getMethodName (), "main" )
290
- && Objects .equals (frame .getMethodType (), MethodType . methodType ( void . class , String []. class )) )
291
- .findFirst (). map (StackWalker .StackFrame ::getDeclaringClass );
288
+ MethodType mainMethodType = MethodType . methodType ( void . class , String []. class );
289
+ return stack .filter ((frame ) -> Objects .equals (frame .getMethodName (), "main" ) )
290
+ . filter (( frame ) -> Objects .equals (frame .getMethodType (), mainMethodType )). findFirst ( )
291
+ .map (StackWalker .StackFrame ::getDeclaringClass );
292
292
}
293
293
294
294
/**
You can’t perform that action at this time.
0 commit comments