Author: kkolinko
Date: Tue Nov 18 19:11:14 2014
New Revision: 1640411

URL: http://svn.apache.org/r1640411
Log:
Further fix for BZ 57172 - followup to r1640087 (r1640084 in trunk).
Be consistent with "webappClassLoader.stopped" message handling and throw an 
ISE from findResourceInternal

In all call chains (findClass() / findResource() public methods) there is a 
checkStateForResourceLoading()/checkStateForClassLoading() check at the start 
of that public method, so it is unlikely to hit an ISE here unless there is 
some kind of race.  Throwing an ISE is a more consistent behaviour, and calling 
a common method is better than a custom rarely used if() block.

Merged r1640410 from tomcat/trunk.

Modified:
    tomcat/tc8.0.x/trunk/   (props changed)
    
tomcat/tc8.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java
    tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc8.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1640410

Modified: 
tomcat/tc8.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java?rev=1640411&r1=1640410&r2=1640411&view=diff
==============================================================================
--- 
tomcat/tc8.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
(original)
+++ 
tomcat/tc8.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoaderBase.java 
Tue Nov 18 19:11:14 2014
@@ -2524,10 +2524,7 @@ public abstract class WebappClassLoaderB
      */
     protected ResourceEntry findResourceInternal(final String name, final 
String path) {
 
-        if (!state.isAvailable()) {
-            log.info(sm.getString("webappClassLoader.stopped", name));
-            return null;
-        }
+        checkStateForResourceLoading(name);
 
         if (name == null || path == null) {
             return null;

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1640411&r1=1640410&r2=1640411&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Tue Nov 18 19:11:14 2014
@@ -50,7 +50,7 @@
       <fix>
         <bug>57172</bug>: Provide a better error message if an attempt is made
         access a resource through a web application class loader that has been
-        stopped. (markt)
+        stopped. (markt/kkolinko)
       </fix>
       <fix>
         <bug>57187</bug>: Regression handling the special * URL. (remm)



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

Reply via email to