Merge branch '3.0.x'
Closes gh-35221
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,7 +40,9 @@ class MainMethod {
|
||||
}
|
||||
|
||||
private Method getMainMethod(Thread thread) {
|
||||
for (StackTraceElement element : thread.getStackTrace()) {
|
||||
StackTraceElement[] stackTrace = thread.getStackTrace();
|
||||
for (int i = stackTrace.length - 1; i >= 0; i--) {
|
||||
StackTraceElement element = stackTrace[i];
|
||||
if ("main".equals(element.getMethodName())) {
|
||||
Method method = getMainMethod(element);
|
||||
if (method != null) {
|
||||
|
||||
Reference in New Issue
Block a user