ASF Bugzilla – Attachment 25319 Details for
Bug 48644
Code should never ignore throwable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch for bug 48644
Bug48644.patch (text/plain), 30.45 KB, created by
CharlotteH
on 2010-04-17 12:25:26 UTC
(
hide
)
Description:
proposed patch for bug 48644
Filename:
MIME Type:
Creator:
CharlotteH
Created:
2010-04-17 12:25:26 UTC
Size:
30.45 KB
patch
obsolete
>Index: java/org/apache/catalina/ant/AbstractCatalinaTask.java >=================================================================== >--- java/org/apache/catalina/ant/AbstractCatalinaTask.java (revision 935160) >+++ java/org/apache/catalina/ant/AbstractCatalinaTask.java (working copy) >@@ -26,6 +26,7 @@ > import java.net.URL; > import java.net.URLConnection; > import org.apache.catalina.util.Base64; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tools.ant.BuildException; > import org.apache.tools.ant.Project; > >@@ -272,7 +273,7 @@ > try { > reader.close(); > } catch (Throwable u) { >- // Ignore >+ ExceptionUtils.handleThrowable(u); > } > reader = null; > } >@@ -280,7 +281,7 @@ > try { > istream.close(); > } catch (Throwable u) { >- // Ignore >+ ExceptionUtils.handleThrowable(u); > } > istream = null; > } >Index: java/org/apache/catalina/core/AprLifecycleListener.java >=================================================================== >--- java/org/apache/catalina/core/AprLifecycleListener.java (revision 935160) >+++ java/org/apache/catalina/core/AprLifecycleListener.java (working copy) >@@ -24,6 +24,7 @@ > import org.apache.catalina.Lifecycle; > import org.apache.catalina.LifecycleEvent; > import org.apache.catalina.LifecycleListener; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >@@ -162,7 +163,7 @@ > // is below required. > terminateAPR(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > return; > } >Index: java/org/apache/catalina/core/StandardPipeline.java >=================================================================== >--- java/org/apache/catalina/core/StandardPipeline.java (revision 935160) >+++ java/org/apache/catalina/core/StandardPipeline.java (working copy) >@@ -34,6 +34,7 @@ > import org.apache.catalina.valves.ValveBase; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.modeler.Registry; > > >@@ -315,7 +316,7 @@ > try { > ((Contained) oldBasic).setContainer(null); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >Index: java/org/apache/catalina/core/StandardWrapper.java >=================================================================== >--- java/org/apache/catalina/core/StandardWrapper.java (revision 935160) >+++ java/org/apache/catalina/core/StandardWrapper.java (working copy) >@@ -60,6 +60,7 @@ > import org.apache.catalina.util.LifecycleBase; > import org.apache.tomcat.InstanceManager; > import org.apache.tomcat.PeriodicEventListener; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.log.SystemLogHandler; > import org.apache.tomcat.util.modeler.Registry; > >@@ -585,7 +586,7 @@ > try { > loadServlet(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > return (singleThreadModel); > >Index: java/org/apache/catalina/ha/session/DeltaManager.java >=================================================================== >--- java/org/apache/catalina/ha/session/DeltaManager.java (revision 935160) >+++ java/org/apache/catalina/ha/session/DeltaManager.java (working copy) >@@ -43,6 +43,7 @@ > import org.apache.catalina.tribes.Member; > import org.apache.catalina.tribes.io.ReplicationStream; > import org.apache.catalina.util.LifecycleBase; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.catalina.ha.ClusterManager; > >@@ -979,7 +980,7 @@ > try { > session.expire(true, isExpireSessionsOnShutdown()); > } catch (Throwable ignore) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > >Index: java/org/apache/catalina/manager/ManagerServlet.java >=================================================================== >--- java/org/apache/catalina/manager/ManagerServlet.java (revision 935160) >+++ java/org/apache/catalina/manager/ManagerServlet.java (working copy) >@@ -56,6 +56,7 @@ > import org.apache.catalina.core.StandardServer; > import org.apache.catalina.util.RequestUtil; > import org.apache.catalina.util.ServerInfo; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.tomcat.util.modeler.Registry; > >@@ -442,7 +443,7 @@ > value = getServletConfig().getInitParameter("debug"); > debug = Integer.parseInt(value); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > > // Acquire global JNDI resources if available >@@ -1348,7 +1349,7 @@ > // Try to stop the context first to be nicer > context.stop(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > try { > if (path.lastIndexOf('/') > 0) { >@@ -1560,7 +1561,7 @@ > try { > ostream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > ostream = null; > } >@@ -1568,7 +1569,7 @@ > try { > istream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > istream = null; > } >Index: java/org/apache/catalina/manager/StatusTransformer.java >=================================================================== >--- java/org/apache/catalina/manager/StatusTransformer.java (revision 935160) >+++ java/org/apache/catalina/manager/StatusTransformer.java (working copy) >@@ -33,6 +33,7 @@ > import javax.servlet.http.HttpServletResponse; > > import org.apache.catalina.util.RequestUtil; >+import org.apache.tomcat.util.ExceptionUtils; > > /** > * This is a refactoring of the servlet to externalize >@@ -158,7 +159,7 @@ > method.invoke(null, paramValues); > ok = true; > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > > if (ok) { >Index: java/org/apache/catalina/manager/host/HostManagerServlet.java >=================================================================== >--- java/org/apache/catalina/manager/host/HostManagerServlet.java (revision 935160) >+++ java/org/apache/catalina/manager/host/HostManagerServlet.java (working copy) >@@ -42,6 +42,7 @@ > import org.apache.catalina.Wrapper; > import org.apache.catalina.core.StandardHost; > import org.apache.catalina.startup.HostConfig; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.tomcat.util.modeler.Registry; > import org.apache.catalina.core.ContainerBase; >@@ -316,7 +317,7 @@ > value = getServletConfig().getInitParameter("debug"); > debug = Integer.parseInt(value); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > > } >Index: java/org/apache/catalina/mbeans/MBeanUtils.java >=================================================================== >--- java/org/apache/catalina/mbeans/MBeanUtils.java (revision 935160) >+++ java/org/apache/catalina/mbeans/MBeanUtils.java (working copy) >@@ -54,6 +54,7 @@ > import org.apache.coyote.http11.Http11AprProtocol; > import org.apache.coyote.http11.Http11NioProtocol; > import org.apache.coyote.http11.Http11Protocol; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.IntrospectionUtils; > import org.apache.tomcat.util.modeler.ManagedBean; > import org.apache.tomcat.util.modeler.Registry; >@@ -1617,7 +1618,7 @@ > try { > ((Contained)valve).setContainer(null); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > if( mserver.isRegistered(oname) ) { > mserver.unregisterMBean(oname); >Index: java/org/apache/catalina/realm/JDBCRealm.java >=================================================================== >--- java/org/apache/catalina/realm/JDBCRealm.java (revision 935160) >+++ java/org/apache/catalina/realm/JDBCRealm.java (working copy) >@@ -30,6 +30,7 @@ > > import org.apache.catalina.LifecycleException; > import org.apache.catalina.util.LifecycleBase; >+import org.apache.tomcat.util.ExceptionUtils; > > > /** >@@ -450,7 +451,7 @@ > try { > preparedCredentials.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedCredentials = null; > >@@ -458,7 +459,7 @@ > try { > preparedRoles.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedRoles = null; > >Index: java/org/apache/catalina/session/JDBCStore.java >=================================================================== >--- java/org/apache/catalina/session/JDBCStore.java (revision 935160) >+++ java/org/apache/catalina/session/JDBCStore.java (working copy) >@@ -23,6 +23,7 @@ > import org.apache.catalina.Session; > import org.apache.catalina.util.CustomObjectInputStream; > import org.apache.catalina.util.LifecycleBase; >+import org.apache.tomcat.util.ExceptionUtils; > > import java.io.BufferedInputStream; > import java.io.BufferedOutputStream; >@@ -901,41 +902,41 @@ > try { > preparedSizeSql.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedSizeSql = null; > > try { > preparedKeysSql.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedKeysSql = null; > > try { > preparedSaveSql.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedSaveSql = null; > > try { > preparedClearSql.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > > try { > preparedRemoveSql.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedRemoveSql = null; > > try { > preparedLoadSql.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.preparedLoadSql = null; > >Index: java/org/apache/catalina/session/ManagerBase.java >=================================================================== >--- java/org/apache/catalina/session/ManagerBase.java (revision 935160) >+++ java/org/apache/catalina/session/ManagerBase.java (working copy) >@@ -50,6 +50,7 @@ > import org.apache.catalina.core.StandardContext; > import org.apache.catalina.core.StandardHost; > import org.apache.catalina.util.LifecycleBase; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >@@ -402,7 +403,7 @@ > method.invoke(null, paramValues); > apr = true; > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > if (apr) { > setEntropy(new String(result)); >Index: java/org/apache/catalina/session/StandardManager.java >=================================================================== >--- java/org/apache/catalina/session/StandardManager.java (revision 935160) >+++ java/org/apache/catalina/session/StandardManager.java (working copy) >@@ -47,6 +47,7 @@ > import org.apache.catalina.security.SecurityUtil; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >+import org.apache.tomcat.util.ExceptionUtils; > /** > * Standard implementation of the <b>Manager</b> interface that provides > * simple session persistence across restarts of this component (such as >@@ -547,7 +548,7 @@ > try { > session.expire(false); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } finally { > session.recycle(); > } >@@ -621,7 +622,7 @@ > session.expire(); > } > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } finally { > // Measure against memory leaking if references to the session > // object are kept in a shared field somewhere >Index: java/org/apache/catalina/ssi/ResponseIncludeWrapper.java >=================================================================== >--- java/org/apache/catalina/ssi/ResponseIncludeWrapper.java (revision 935160) >+++ java/org/apache/catalina/ssi/ResponseIncludeWrapper.java (working copy) >@@ -31,6 +31,8 @@ > import javax.servlet.http.HttpServletResponse; > import javax.servlet.http.HttpServletResponseWrapper; > >+import org.apache.tomcat.util.ExceptionUtils; >+ > /** > * A HttpServletResponseWrapper, used from > * <code>SSIServletExternalResolver</code> >@@ -228,7 +230,7 @@ > lastModified = RFC1123_FORMAT.parse(value).getTime(); > } > } catch (Throwable ignore) { >- // Ignore >+ ExceptionUtils.handleThrowable(ignore); > } > } else if (lname.equals(CONTENT_TYPE)) { > contentType = value; >@@ -254,7 +256,7 @@ > lastModified = RFC1123_FORMAT.parse(value).getTime(); > } > } catch (Throwable ignore) { >- // Ignore >+ ExceptionUtils.handleThrowable(ignore); > } > } > else if (lname.equals(CONTENT_TYPE)) >Index: java/org/apache/catalina/startup/CatalinaProperties.java >=================================================================== >--- java/org/apache/catalina/startup/CatalinaProperties.java (revision 935160) >+++ java/org/apache/catalina/startup/CatalinaProperties.java (working copy) >@@ -25,7 +25,9 @@ > import java.util.Enumeration; > import java.util.Properties; > >+import org.apache.tomcat.util.ExceptionUtils; > >+ > /** > * Utility class to read the bootstrap Catalina configuration. > * >@@ -91,7 +93,7 @@ > is = (new URL(configUrl)).openStream(); > } > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > > if (is == null) { >@@ -101,7 +103,7 @@ > File properties = new File(conf, "catalina.properties"); > is = new FileInputStream(properties); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > >@@ -110,7 +112,7 @@ > is = CatalinaProperties.class.getResourceAsStream > ("/org/apache/catalina/startup/catalina.properties"); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > >Index: java/org/apache/catalina/startup/ContextConfig.java >=================================================================== >--- java/org/apache/catalina/startup/ContextConfig.java (revision 935160) >+++ java/org/apache/catalina/startup/ContextConfig.java (working copy) >@@ -41,6 +41,7 @@ > > import javax.servlet.ServletContext; > >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.bcel.classfile.AnnotationElementValue; > import org.apache.tomcat.util.bcel.classfile.AnnotationEntry; > import org.apache.tomcat.util.bcel.classfile.ArrayElementValue; >@@ -1521,7 +1522,7 @@ > try { > is.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >@@ -1534,7 +1535,7 @@ > try { > jarFile.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >@@ -1579,7 +1580,7 @@ > try { > is.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >@@ -1611,7 +1612,7 @@ > try { > fis.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >@@ -1841,14 +1842,14 @@ > try { > jarFile.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > if (stream != null) { > try { > stream.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > fragment.setURL(urlConn.getURL()); >@@ -1880,7 +1881,7 @@ > try { > stream.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > if (fragment == null) { >Index: java/org/apache/catalina/startup/ExpandWar.java >=================================================================== >--- java/org/apache/catalina/startup/ExpandWar.java (revision 935160) >+++ java/org/apache/catalina/startup/ExpandWar.java (working copy) >@@ -32,6 +32,7 @@ > import java.util.jar.JarFile; > > import org.apache.catalina.Host; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >@@ -153,7 +154,7 @@ > try { > input.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > input = null; > } >@@ -161,7 +162,7 @@ > try { > jarFile.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > jarFile = null; > } >@@ -228,7 +229,7 @@ > try { > jarFile.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > jarFile = null; > } >Index: java/org/apache/catalina/startup/HostConfig.java >=================================================================== >--- java/org/apache/catalina/startup/HostConfig.java (revision 935160) >+++ java/org/apache/catalina/startup/HostConfig.java (working copy) >@@ -49,6 +49,7 @@ > import org.apache.catalina.util.IOTools; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.tomcat.util.digester.Digester; > import org.apache.tomcat.util.modeler.Registry; >@@ -872,7 +873,7 @@ > try { > ostream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > ostream = null; > } >@@ -880,7 +881,7 @@ > try { > istream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > istream = null; > } >@@ -890,7 +891,7 @@ > try { > jar.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > jar = null; > } >@@ -942,7 +943,7 @@ > try { > istream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > istream = null; > } >@@ -952,7 +953,7 @@ > try { > jar.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > jar = null; > } >Index: java/org/apache/catalina/startup/TldConfig.java >=================================================================== >--- java/org/apache/catalina/startup/TldConfig.java (revision 935160) >+++ java/org/apache/catalina/startup/TldConfig.java (working copy) >@@ -45,6 +45,7 @@ > import org.apache.catalina.core.StandardHost; > import org.apache.tomcat.JarScanner; > import org.apache.tomcat.JarScannerCallback; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.tomcat.util.digester.Digester; > import org.xml.sax.InputSource; >@@ -518,7 +519,7 @@ > try { > jarFile.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >Index: java/org/apache/catalina/users/MemoryUserDatabase.java >=================================================================== >--- java/org/apache/catalina/users/MemoryUserDatabase.java (revision 935160) >+++ java/org/apache/catalina/users/MemoryUserDatabase.java (working copy) >@@ -31,6 +31,7 @@ > import org.apache.catalina.Role; > import org.apache.catalina.User; > import org.apache.catalina.UserDatabase; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > import org.apache.juli.logging.Log; > import org.apache.juli.logging.LogFactory; >@@ -412,7 +413,7 @@ > try { > fis.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > throw e; > } >Index: java/org/apache/catalina/util/ExtensionValidator.java >=================================================================== >--- java/org/apache/catalina/util/ExtensionValidator.java (revision 935160) >+++ java/org/apache/catalina/util/ExtensionValidator.java (working copy) >@@ -35,6 +35,7 @@ > > import org.apache.catalina.Context; > import org.apache.naming.resources.Resource; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > > >@@ -167,7 +168,7 @@ > try { > inputStream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >@@ -206,7 +207,7 @@ > try { > inputStream.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >@@ -397,7 +398,7 @@ > try { > jin.close(); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >Index: java/org/apache/catalina/valves/ErrorReportValve.java >=================================================================== >--- java/org/apache/catalina/valves/ErrorReportValve.java (revision 935160) >+++ java/org/apache/catalina/valves/ErrorReportValve.java (working copy) >@@ -30,6 +30,7 @@ > import org.apache.catalina.connector.Response; > import org.apache.catalina.util.RequestUtil; > import org.apache.catalina.util.ServerInfo; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > > /** >@@ -139,7 +140,7 @@ > try { > report(request, response, throwable); > } catch (Throwable tt) { >- // Ignore >+ ExceptionUtils.handleThrowable(tt); > } > > } >@@ -176,7 +177,7 @@ > try { > report = sm.getString("http." + statusCode, message); > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > if (report == null) > return; >Index: java/org/apache/catalina/valves/JDBCAccessLogValve.java >=================================================================== >--- java/org/apache/catalina/valves/JDBCAccessLogValve.java (revision 935160) >+++ java/org/apache/catalina/valves/JDBCAccessLogValve.java (working copy) >@@ -34,6 +34,7 @@ > import org.apache.catalina.connector.Request; > import org.apache.catalina.connector.Response; > import org.apache.catalina.util.LifecycleBase; >+import org.apache.tomcat.util.ExceptionUtils; > import org.apache.tomcat.util.res.StringManager; > > /** >@@ -575,7 +576,7 @@ > try { > ps.close(); > } catch (Throwable f) { >- // Ignore >+ ExceptionUtils.handleThrowable(f); > } > this.ps = null; > >Index: java/org/apache/jasper/compiler/TldLocationsCache.java >=================================================================== >--- java/org/apache/jasper/compiler/TldLocationsCache.java (revision 935160) >+++ java/org/apache/jasper/compiler/TldLocationsCache.java (working copy) >@@ -38,6 +38,7 @@ > import org.apache.jasper.xmlparser.TreeNode; > import org.apache.tomcat.JarScanner; > import org.apache.tomcat.JarScannerCallback; >+import org.apache.tomcat.util.ExceptionUtils; > > /** > * A container for all tag libraries that are defined "globally" >@@ -388,7 +389,7 @@ > try { > jarFile.close(); > } catch (Throwable t) { >- // ignore >+ ExceptionUtils.handleThrowable(t); > } > } > } >Index: java/org/apache/jasper/servlet/JspCServletContext.java >=================================================================== >--- java/org/apache/jasper/servlet/JspCServletContext.java (revision 935160) >+++ java/org/apache/jasper/servlet/JspCServletContext.java (working copy) >@@ -44,7 +44,9 @@ > import javax.servlet.FilterRegistration.Dynamic; > import javax.servlet.descriptor.JspConfigDescriptor; > >+import org.apache.tomcat.util.ExceptionUtils; > >+ > /** > * Simple <code>ServletContext</code> implementation without > * HTTP-specific methods. >@@ -267,7 +269,7 @@ > try { > is.close(); > } catch (Throwable t2) { >- // Ignore >+ ExceptionUtils.handleThrowable(t2); > } > } > } >Index: java/org/apache/tomcat/util/ExceptionUtils.java >=================================================================== >--- java/org/apache/tomcat/util/ExceptionUtils.java (revision 0) >+++ java/org/apache/tomcat/util/ExceptionUtils.java (revision 0) >@@ -0,0 +1,38 @@ >+/* >+ * Licensed to the Apache Software Foundation (ASF) under one or more >+ * contributor license agreements. See the NOTICE file distributed with >+ * this work for additional information regarding copyright ownership. >+ * The ASF licenses this file to You under the Apache License, Version 2.0 >+ * (the "License"); you may not use this file except in compliance with >+ * the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+package org.apache.tomcat.util; >+ >+/** >+ * Utilities for handling Throwables and Exceptions. >+ */ >+public class ExceptionUtils { >+ >+ /** >+ * Checks whether the supplied Throwable is one that needs to be >+ * rethrown and swallows all others. >+ * @param t the Throwable to check >+ */ >+ public static void handleThrowable(Throwable t) { >+ if (t instanceof ThreadDeath) { >+ throw (ThreadDeath) t; >+ } >+ if (t instanceof VirtualMachineError) { >+ throw (VirtualMachineError) t; >+ } >+ // All other instances of Throwable will be silently swallowed >+ } >+} >Index: modules/tomcat-lite/java/org/apache/tomcat/servlets/session/RandomGenerator.java >=================================================================== >--- modules/tomcat-lite/java/org/apache/tomcat/servlets/session/RandomGenerator.java (revision 935160) >+++ modules/tomcat-lite/java/org/apache/tomcat/servlets/session/RandomGenerator.java (working copy) >@@ -28,6 +28,8 @@ > import java.util.logging.Level; > import java.util.logging.Logger; > >+import org.apache.tomcat.util.ExceptionUtils; >+ > /** > * Generates random IDs, useable as cookies. > * >@@ -252,7 +254,7 @@ > method.invoke(null, paramValues); > apr = true; > } catch (Throwable t) { >- // Ignore >+ ExceptionUtils.handleThrowable(t); > } > if (apr) { > setEntropy(new String(result));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48644
: 25319 |
26023