tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001933 - in /tomcat/trunk/java/org/apache/jasper: compiler/ runtime/ servlet/
Date Mon, 27 Sep 2010 22:16:27 GMT
Author: markt
Date: Mon Sep 27 22:16:26 2010
New Revision: 1001933

URL: http://svn.apache.org/viewvc?rev=1001933&view=rev
Log:
Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644
Some Throwables must always be re-thrown

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
    tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java
    tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java
    tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
    tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java Mon Sep 27 22:16:26
2010
@@ -31,6 +31,7 @@ import javax.servlet.jsp.tagext.TagLibra
 
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.jasper.xmlparser.ParserUtils;
 import org.apache.jasper.xmlparser.TreeNode;
 
@@ -164,6 +165,7 @@ class ImplicitTagLibraryInfo extends Tag
                             try {
                                 in.close();
                             } catch (Throwable t) {
+                                ExceptionUtils.handleThrowable(t);
                             }
                         }
                     }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Mon Sep 27 22:16:26 2010
@@ -27,6 +27,7 @@ import java.util.jar.JarFile;
 
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -570,6 +571,7 @@ class JspReader {
                                    longName, encoding);
             }
         } catch (Throwable ex) {
+            ExceptionUtils.handleThrowable(ex);
             log.error("Exception parsing file ", ex);
             // Pop state being constructed:
             popFile();

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Mon Sep 27 22:16:26
2010
@@ -40,6 +40,7 @@ import org.apache.jasper.Options;
 import org.apache.jasper.runtime.JspFactoryImpl;
 import org.apache.jasper.security.SecurityClassLoad;
 import org.apache.jasper.servlet.JspServletWrapper;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.jasper.util.JspQueue;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -338,6 +339,7 @@ public final class JspRuntimeContext {
                 } catch (FileNotFoundException ex) {
                     ctxt.incrementRemoved();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     jsw.getServletContext().log("Background compile failed",
                                                 t);
                 }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java Mon Sep 27 22:16:26 2010
@@ -21,6 +21,8 @@ import java.text.MessageFormat;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
+import org.apache.jasper.util.ExceptionUtils;
+
 /**
  * Class responsible for converting error codes to corresponding localized
  * error messages.
@@ -36,6 +38,7 @@ public class Localizer {
         bundle = ResourceBundle.getBundle(
             "org.apache.jasper.resources.LocalStrings");
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             t.printStackTrace();
         }
     }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java Mon Sep 27 22:16:26
2010
@@ -25,6 +25,7 @@ import java.util.jar.JarFile;
 
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.jasper.xmlparser.XMLEncodingDetector;
 import org.xml.sax.Attributes;
 
@@ -252,7 +253,9 @@ class ParserController implements TagCon
         if (jarFile != null) {
             try {
                 jarFile.close();
-            } catch (Throwable t) {}
+            } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
+            }
         }
 
         baseDirStack.pop();

Modified: tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java Mon Sep 27 22:16:26
2010
@@ -45,6 +45,7 @@ import javax.servlet.jsp.tagext.Variable
 
 import org.apache.jasper.JasperException;
 import org.apache.jasper.JspCompilationContext;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.jasper.xmlparser.ParserUtils;
 import org.apache.jasper.xmlparser.TreeNode;
 import org.apache.juli.logging.Log;
@@ -185,6 +186,7 @@ class TagLibraryInfoImpl extends TagLibr
                 try {
                     in.close();
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                 }
             }
         }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java Mon Sep 27 22:16:26
2010
@@ -315,7 +315,7 @@ public class TldLocationsCache {
                             try {
                                 stream.close();
                             } catch (Throwable t) {
-                                // do nothing
+                                ExceptionUtils.handleThrowable(t);
                             }
                         }
                     }
@@ -351,7 +351,7 @@ public class TldLocationsCache {
                             try {
                                 stream.close();
                             } catch (Throwable t) {
-                                // do nothing
+                                ExceptionUtils.handleThrowable(t);
                             }
                         }
                     }
@@ -440,7 +440,7 @@ public class TldLocationsCache {
                 try {
                     stream.close();
                 } catch (Throwable t) {
-                    // do nothing
+                    ExceptionUtils.handleThrowable(t);
                 }
             }
         }

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java Mon Sep 27 22:16:26 2010
@@ -29,6 +29,7 @@ import javax.servlet.jsp.JspFactory;
 import javax.servlet.jsp.PageContext;
 
 import org.apache.jasper.Constants;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 
@@ -112,7 +113,7 @@ public class JspFactoryImpl extends JspF
                     needsSession, bufferSize, autoflush);
             return pc;
         } catch (Throwable ex) {
-            /* FIXME: need to do something reasonable here!! */
+            ExceptionUtils.handleThrowable(ex);
             log.fatal("Exception initializing page context", ex);
             return null;
         }

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Mon Sep 27 22:16:26
2010
@@ -226,6 +226,7 @@ public class JspCServletContext implemen
             return
                 (getResource(path).getFile().replace('/', File.separatorChar));
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             return (null);
         }
 
@@ -263,6 +264,7 @@ public class JspCServletContext implemen
         try {
             is = url.openStream();
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             url = null;
         } finally {
             if (is != null) {
@@ -289,6 +291,7 @@ public class JspCServletContext implemen
         try {
             return (getResource(path).openStream());
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             return (null);
         }
 

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java Mon Sep 27 22:16:26 2010
@@ -34,6 +34,7 @@ import org.apache.jasper.Options;
 import org.apache.jasper.compiler.JspRuntimeContext;
 import org.apache.jasper.compiler.Localizer;
 import org.apache.jasper.security.SecurityUtil;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.PeriodicEventListener;
@@ -93,6 +94,7 @@ public class JspServlet extends HttpServ
                 Object[] args = { config, context };
                 options = (Options) ctor.newInstance(args);
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 // Need to localize this.
                 log.warn("Failed to load engineOptionsClass", e);
                 // Use the default Options implementation
@@ -269,6 +271,7 @@ public class JspServlet extends HttpServ
         } catch (IOException e) {
             throw e;
         } catch (Throwable e) {
+            ExceptionUtils.handleThrowable(e);
             throw new ServletException(e);
         }
 

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1001933&r1=1001932&r2=1001933&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Mon Sep 27 22:16:26
2010
@@ -42,6 +42,7 @@ import org.apache.jasper.compiler.Locali
 import org.apache.jasper.runtime.InstanceManagerFactory;
 import org.apache.jasper.runtime.JspSourceDependent;
 import org.apache.jasper.util.Entry;
+import org.apache.jasper.util.ExceptionUtils;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.InstanceManager;
@@ -261,6 +262,7 @@ public class JspServletWrapper {
                 return ((JspSourceDependent) target).getDependants();
             }
         } catch (Throwable ex) {
+            ExceptionUtils.handleThrowable(ex);
         }
         return null;
     }



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


Mime
View raw message