From a0dd6ef3b14ca0cf6f35695ea2ba9cc746581997 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 25 Jul 2022 16:13:47 +0200 Subject: [PATCH] Revert "Merge pull request #31828 from quaff" This reverts commit 68fc87bc7fa74f5df34b814ebc157a65e263ca13. See gh-31828 --- .../java/org/springframework/boot/SpringApplication.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index f95b30320e5..d7adbea7696 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -17,7 +17,6 @@ package org.springframework.boot; import java.lang.StackWalker.StackFrame; -import java.lang.invoke.MethodType; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; @@ -166,7 +165,6 @@ import org.springframework.util.StringUtils; * @author Brian Clozel * @author Ethan Rubinson * @author Chris Bono - * @author Yanming Zhou * @since 1.0.0 * @see #run(Class, String[]) * @see #run(Class[], String[]) @@ -285,9 +283,7 @@ public class SpringApplication { } private Optional> findMainClass(Stream stack) { - MethodType mainMethodType = MethodType.methodType(void.class, String[].class); - return stack.filter((frame) -> Objects.equals(frame.getMethodName(), "main")) - .filter((frame) -> Objects.equals(frame.getMethodType(), mainMethodType)).findFirst() + return stack.filter((frame) -> Objects.equals(frame.getMethodName(), "main")).findFirst() .map(StackWalker.StackFrame::getDeclaringClass); }