You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/02/26 18:44:04 UTC

[tomcat] branch master updated (235666f -> 51f96d1)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


    from 235666f  Fix AJP Connector when requests forwarded from IIS originally use TLS
     new f6e1482  BZ 64153. Ensure Context.getParentClassLoader() is consistent
     new 51f96d1  Remove deprecated code.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 java/org/apache/catalina/loader/WebappLoader.java  | 34 ++--------------------
 2 files changed, 3 insertions(+), 33 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: BZ 64153. Ensure Context.getParentClassLoader() is consistent

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit f6e1482d4c78f1fb459384dd87ef3dc4cad81008
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Feb 26 17:43:41 2020 +0000

    BZ 64153. Ensure Context.getParentClassLoader() is consistent
    
    Deprecate the setting of the parent class loader via the Loader and if
    it is set via the loader, keep it in sync with the Context.
    Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=64153
---
 java/org/apache/catalina/core/StandardContext.java |  2 +-
 java/org/apache/catalina/loader/WebappLoader.java  | 11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java
index 5f2e8b1..abb276c 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -4842,7 +4842,7 @@ public class StandardContext extends ContainerBase
         }
 
         if (getLoader() == null) {
-            WebappLoader webappLoader = new WebappLoader(getParentClassLoader());
+            WebappLoader webappLoader = new WebappLoader();
             webappLoader.setDelegate(getDelegate());
             setLoader(webappLoader);
         }
diff --git a/java/org/apache/catalina/loader/WebappLoader.java b/java/org/apache/catalina/loader/WebappLoader.java
index 455e657..d681baa 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -69,8 +69,8 @@ public class WebappLoader extends LifecycleMBeanBase
     // ----------------------------------------------------------- Constructors
 
     /**
-     * Construct a new WebappLoader with no defined parent class loader
-     * (so that the actual parent will be the system class loader).
+     * Construct a new WebappLoader. The parent class loader will be defined by
+     * {@link Context#getParentClassLoader()}.
      */
     public WebappLoader() {
         this(null);
@@ -82,7 +82,12 @@ public class WebappLoader extends LifecycleMBeanBase
      * to be defined as the parent of the ClassLoader we ultimately create.
      *
      * @param parent The parent class loader
+     *
+     * @deprecated Use {@link Context#setParentClassLoader(ClassLoader)} to
+     *             specify the required class loader. This method will be
+     *             removed in Tomcat 10 onwards.
      */
+    @Deprecated
     public WebappLoader(ClassLoader parent) {
         super();
         this.parentClassLoader = parent;
@@ -507,6 +512,8 @@ public class WebappLoader extends LifecycleMBeanBase
 
         if (parentClassLoader == null) {
             parentClassLoader = context.getParentClassLoader();
+        } else {
+            context.setParentClassLoader(parentClassLoader);
         }
         Class<?>[] argTypes = { ClassLoader.class };
         Object[] args = { parentClassLoader };


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Remove deprecated code.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 51f96d1c44f90ab3e71a10168b09866d61c21315
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Feb 26 17:45:22 2020 +0000

    Remove deprecated code.
---
 java/org/apache/catalina/loader/WebappLoader.java | 41 ++---------------------
 1 file changed, 2 insertions(+), 39 deletions(-)

diff --git a/java/org/apache/catalina/loader/WebappLoader.java b/java/org/apache/catalina/loader/WebappLoader.java
index d681baa..75bb589 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -66,34 +66,6 @@ public class WebappLoader extends LifecycleMBeanBase
 
     private static final Log log = LogFactory.getLog(WebappLoader.class);
 
-    // ----------------------------------------------------------- Constructors
-
-    /**
-     * Construct a new WebappLoader. The parent class loader will be defined by
-     * {@link Context#getParentClassLoader()}.
-     */
-    public WebappLoader() {
-        this(null);
-    }
-
-
-    /**
-     * Construct a new WebappLoader with the specified class loader
-     * to be defined as the parent of the ClassLoader we ultimately create.
-     *
-     * @param parent The parent class loader
-     *
-     * @deprecated Use {@link Context#setParentClassLoader(ClassLoader)} to
-     *             specify the required class loader. This method will be
-     *             removed in Tomcat 10 onwards.
-     */
-    @Deprecated
-    public WebappLoader(ClassLoader parent) {
-        super();
-        this.parentClassLoader = parent;
-    }
-
-
     // ----------------------------------------------------- Instance Variables
 
     /**
@@ -124,12 +96,6 @@ public class WebappLoader extends LifecycleMBeanBase
 
 
     /**
-     * The parent class loader of the class loader we will create.
-     */
-    private ClassLoader parentClassLoader = null;
-
-
-    /**
      * The reloadable flag for this Loader.
      */
     private boolean reloadable = false;
@@ -510,11 +476,8 @@ public class WebappLoader extends LifecycleMBeanBase
         Class<?> clazz = Class.forName(loaderClass);
         WebappClassLoaderBase classLoader = null;
 
-        if (parentClassLoader == null) {
-            parentClassLoader = context.getParentClassLoader();
-        } else {
-            context.setParentClassLoader(parentClassLoader);
-        }
+        ClassLoader parentClassLoader = context.getParentClassLoader();
+
         Class<?>[] argTypes = { ClassLoader.class };
         Object[] args = { parentClassLoader };
         Constructor<?> constr = clazz.getConstructor(argTypes);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org