This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 341e818b1f Don't call Thread.stop() as it now throws an Exception
341e818b1f is described below
commit 341e818b1f7fefaf1667a6730a2736d1431b99f0
Author: Mark Thomas <[email protected]>
AuthorDate: Thu May 11 20:03:16 2023 +0100
Don't call Thread.stop() as it now throws an Exception
---
java/org/apache/catalina/loader/WebappClassLoaderBase.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
index fede505739..d522f61618 100644
--- a/java/org/apache/catalina/loader/WebappClassLoaderBase.java
+++ b/java/org/apache/catalina/loader/WebappClassLoaderBase.java
@@ -1584,7 +1584,6 @@ public abstract class WebappClassLoaderBase extends
URLClassLoader
}
- @SuppressWarnings("deprecation") // thread.stop()
private void clearReferencesThreads() {
Thread[] threads = getThreads();
List<Thread> threadsToStop = new ArrayList<>();
@@ -1694,11 +1693,8 @@ public abstract class WebappClassLoaderBase extends
URLClassLoader
count++;
}
if (t.isAlive()) {
- // This method is deprecated and for good reason. This is
- // very risky code but is the only option at this point.
- // A *very* good reason for apps to do this clean-up
- // themselves.
- t.stop();
+ // Unable to stop the thread. Log an error.
+ log.error(sm.getString("webappClassLoader.stopThreadFail",
t.getName(), getContextName()));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]