Skip to content

Commit

Permalink
Revert "Merge pull request #31828 from quaff"
Browse files Browse the repository at this point in the history
This reverts commit 68fc87b.

See gh-31828
  • Loading branch information
snicoll committed Jul 25, 2022
1 parent 24cf5ff commit a0dd6ef
Showing 1 changed file with 1 addition and 5 deletions.
Expand Up @@ -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;
Expand Down Expand Up @@ -166,7 +165,6 @@
* @author Brian Clozel
* @author Ethan Rubinson
* @author Chris Bono
* @author Yanming Zhou
* @since 1.0.0
* @see #run(Class, String[])
* @see #run(Class[], String[])
Expand Down Expand Up @@ -285,9 +283,7 @@ private Class<?> deduceMainApplicationClass() {
}

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

Expand Down

0 comments on commit a0dd6ef

Please sign in to comment.