You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search for main methods from the bottom of the stack
Update `MainMethod` to search from the bottom of the stack rather than
the start. Prior to this commit, an incorrect `main` method would be
found if more than one `main` was in the stack.
Fixesgh-35214
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/MainMethod.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2019 the original author or authors.
2
+
* Copyright 2012-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -40,7 +40,9 @@ class MainMethod {
40
40
}
41
41
42
42
privateMethodgetMainMethod(Threadthread) {
43
-
for (StackTraceElementelement : thread.getStackTrace()) {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/restart/MainMethodTests.java
0 commit comments