tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Fwd: svn commit: r1569398 - in /tomcat/trunk/java/org/apache/catalina/loader: LocalStrings.properties WebappClassLoader.java
Date Sun, 23 Mar 2014 19:12:54 GMT
Hi

any planned date for a tomcat 7.0.53 with this fix?

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau




---------- Forwarded message ----------
From:  <markt@apache.org>
Date: 2014-02-18 17:00 GMT+01:00
Subject: svn commit: r1569398 - in
/tomcat/trunk/java/org/apache/catalina/loader: LocalStrings.properties
WebappClassLoader.java
To: dev@tomcat.apache.org


Author: markt
Date: Tue Feb 18 16:00:34 2014
New Revision: 1569398

URL: http://svn.apache.org/r1569398
Log:
Make it easier for TomEE to modify the j2seClassLoader

Modified:
    tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java

Modified: tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties?rev=1569398&r1=1569397&r2=1569398&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
Tue Feb 18 16:00:34 2014
@@ -37,6 +37,7 @@ webappClassLoader.loadedByThisOrChildFai
 webappClassLoader.jarsAdded=One or more JARs have been added to the
web application [{0}]
 webappClassLoader.jarsModified=One or more JARs have been modified in
the web application [{0}]
 webappClassLoader.jarsRemoved=One or more JARs have been removed from
the web application [{0}]
+webappClassLoader.j2seClassLoaderNull=The j2seClassLoader attribute
may not be null
 webappClassLoader.resourceModified=Resource [{0}] has been modified.
The last modified time was [{1}] and is now [{2}]
 webappClassLoader.stopThreadFail=Failed to terminate thread named
[{0}] for web application [{1}]
 webappClassLoader.stopTimerThreadFail=Failed to terminate TimerThread
named [{0}] for web application [{1}]

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1569398&r1=1569397&r2=1569398&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
Tue Feb 18 16:00:34 2014
@@ -339,7 +339,7 @@ public class WebappClassLoader extends U
      * those cases {@link ClassLoader#getParent()} will be called
recursively on
      * the system class loader and the last non-null result used.
      */
-    protected final ClassLoader j2seClassLoader;
+    private ClassLoader j2seClassLoader;


     /**
@@ -1240,9 +1240,10 @@ public class WebappClassLoader extends U
         // (0.2) Try loading the class with the system class loader, to prevent
         //       the webapp from overriding J2SE classes
         String resourceName = binaryNameToPath(name, false);
-        if (j2seClassLoader.getResource(resourceName) != null) {
+        ClassLoader j2seLoader = getJ2seClassLoader();
+        if (j2seLoader.getResource(resourceName) != null) {
             try {
-                clazz = j2seClassLoader.loadClass(name);
+                clazz = j2seLoader.loadClass(name);
                 if (clazz != null) {
                     if (resolve)
                         resolveClass(clazz);
@@ -1505,6 +1506,18 @@ public class WebappClassLoader extends U

     // ------------------------------------------------------ Protected Methods

+    protected ClassLoader getJ2seClassLoader() {
+        return j2seClassLoader;
+    }
+
+    protected void setJ2seClassLoader(ClassLoader classLoader) {
+        if (classLoader == null) {
+            throw new IllegalArgumentException(
+                    sm.getString("webappClassLoader.j2seClassLoaderNull"));
+        }
+        j2seClassLoader = classLoader;
+    }
+
     /**
      * Clear references.
      */



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

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


Mime
View raw message