Revert "Merge pull request #31828 from quaff"
This reverts commit 68fc87bc7f.
See gh-31828
This commit is contained in:
@@ -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<Class<?>> findMainClass(Stream<StackFrame> 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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user