|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|