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
commit a1afa1cddf848fc258ee7723dac40a49782b86cb Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu Mar 20 13:05:08 2025 +0000 Remove deprecated code --- java/org/apache/catalina/core/StandardContext.java | 16 ++------- .../org/apache/catalina/startup/FailedContext.java | 10 ------ java/org/apache/tomcat/ContextBind.java | 42 +--------------------- test/org/apache/tomcat/unittest/TesterContext.java | 10 ------ 4 files changed, 3 insertions(+), 75 deletions(-) diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index b93e000d7f..b1a46ca3f4 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -4971,7 +4971,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat */ protected ClassLoader bindThread() { - ClassLoader oldContextClassLoader = bind(false, null); + ClassLoader oldContextClassLoader = bind(null); if (isUseNaming()) { try { @@ -4997,13 +4997,7 @@ public class StandardContext extends ContainerBase implements Context, Notificat ContextBindings.unbindThread(this, getNamingToken()); } - unbind(false, oldContextClassLoader); - } - - - @Override - public ClassLoader bind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { - return bind(originalClassLoader); + unbind(oldContextClassLoader); } @@ -5042,12 +5036,6 @@ public class StandardContext extends ContainerBase implements Context, Notificat } - @Override - public void unbind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { - unbind(originalClassLoader); - } - - @Override public void unbind(ClassLoader originalClassLoader) { if (originalClassLoader == null) { diff --git a/java/org/apache/catalina/startup/FailedContext.java b/java/org/apache/catalina/startup/FailedContext.java index a0566b95f6..199b0ffe30 100644 --- a/java/org/apache/catalina/startup/FailedContext.java +++ b/java/org/apache/catalina/startup/FailedContext.java @@ -1263,21 +1263,11 @@ public class FailedContext extends LifecycleMBeanBase implements Context { // NO-OP } - @Override - public ClassLoader bind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { - return null; - } - @Override public ClassLoader bind(ClassLoader originalClassLoader) { return null; } - @Override - public void unbind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { - // NO-OP - } - @Override public void unbind(ClassLoader originalClassLoader) { // NO-OP diff --git a/java/org/apache/tomcat/ContextBind.java b/java/org/apache/tomcat/ContextBind.java index 2fb868a6f7..920c6dbfd5 100644 --- a/java/org/apache/tomcat/ContextBind.java +++ b/java/org/apache/tomcat/ContextBind.java @@ -38,7 +38,7 @@ public interface ContextBind { /** * Restore the current thread context class loader to the original class - * loader in used before {@link #bind(boolean, ClassLoader)} was called. If + * loader in use before {@link #bind(ClassLoader)} was called. If * no original class loader is passed to this method then no change will be * made. If the class loader is changed and a * {@link org.apache.catalina.ThreadBindingListener} is configured then @@ -49,44 +49,4 @@ public interface ContextBind { * The class loader to restore as the thread context class loader */ void unbind(ClassLoader originalClassLoader); - - /** - * Change the current thread context class loader to the web application - * class loader. If no web application class loader is defined, or if the - * current thread is already using the web application class loader then no - * change will be made. If the class loader is changed and a - * {@link org.apache.catalina.ThreadBindingListener} is configured then - * {@link org.apache.catalina.ThreadBindingListener#bind()} will be called - * after the change has been made. - * - * @param usePrivilegedAction Unused - * @param originalClassLoader The current class loader if known to save this - * method having to look it up - * - * @return If the class loader has been changed by the method it will return - * the thread context class loader in use when the method was called. If - * no change was made then this method returns null. - * - * @deprecated Unused. Will be removed in Tomcat 12 onwards. - */ - @Deprecated - ClassLoader bind(boolean usePrivilegedAction, ClassLoader originalClassLoader); - - /** - * Restore the current thread context class loader to the original class - * loader in used before {@link #bind(boolean, ClassLoader)} was called. If - * no original class loader is passed to this method then no change will be - * made. If the class loader is changed and a - * {@link org.apache.catalina.ThreadBindingListener} is configured then - * {@link org.apache.catalina.ThreadBindingListener#unbind()} will be called - * before the change is made. - * - * @param usePrivilegedAction Unused - * @param originalClassLoader The class loader to restore as the thread - * context class loader - * - * @deprecated Unused. Will be removed in Tomcat 12 onwards. - */ - @Deprecated - void unbind(boolean usePrivilegedAction, ClassLoader originalClassLoader); } diff --git a/test/org/apache/tomcat/unittest/TesterContext.java b/test/org/apache/tomcat/unittest/TesterContext.java index 926e48a8de..e54a0e04e8 100644 --- a/test/org/apache/tomcat/unittest/TesterContext.java +++ b/test/org/apache/tomcat/unittest/TesterContext.java @@ -1215,21 +1215,11 @@ public class TesterContext implements Context { @Override public void setThreadBindingListener(ThreadBindingListener threadBindingListener) { /* NO-OP */ } - @Override - public ClassLoader bind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { - return null; - } - @Override public ClassLoader bind(ClassLoader originalClassLoader) { return null; } - @Override - public void unbind(boolean usePrivilegedAction, ClassLoader originalClassLoader) { - // NO-OP - } - @Override public void unbind(ClassLoader originalClassLoader) { // NO-OP --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org