tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001899 - in /tomcat/trunk/java/org/apache/catalina/ant: AbstractCatalinaTask.java ValidatorTask.java jmx/JMXAccessorQueryTask.java jmx/JMXAccessorTask.java
Date Mon, 27 Sep 2010 20:24:18 GMT
Author: markt
Date: Mon Sep 27 20:24:18 2010
New Revision: 1001899

URL: http://svn.apache.org/viewvc?rev=1001899&view=rev
Log:
Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644
Don't catch Throwable

Modified:
    tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java
    tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java
    tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
    tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java

Modified: tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java Mon Sep 27 20:24:18
2010
@@ -20,6 +20,7 @@ package org.apache.catalina.ant;
 
 
 import java.io.BufferedOutputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.HttpURLConnection;
@@ -262,27 +263,27 @@ public abstract class AbstractCatalinaTa
                 // or error line will be logged twice
                 throw new BuildException(error);
             }
-        } catch (Throwable t) {
+        } catch (Exception e) {
             if (isFailOnError()) {
-                throw new BuildException(t);
+                throw new BuildException(e);
             } else {
-                handleErrorOutput(t.getMessage());
+                handleErrorOutput(e.getMessage());
             }
         } finally {
             closeRedirector();
             if (reader != null) {
                 try {
                     reader.close();
-                } catch (Throwable u) {
-                    ExceptionUtils.handleThrowable(u);
+                } catch (IOException ioe) {
+                    // Ignore
                 }
                 reader = null;
             }
             if (istream != null) {
                 try {
                     istream.close();
-                } catch (Throwable u) {
-                    ExceptionUtils.handleThrowable(u);
+                } catch (IOException ioe) {
+                    // Ignore
                 }
                 istream = null;
             }

Modified: tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java Mon Sep 27 20:24:18 2010
@@ -100,11 +100,11 @@ public class ValidatorTask extends BaseR
             is.setByteStream(stream);
             digester.parse(is);
             handleOutput("web.xml validated");
-        } catch (Throwable t) {
+        } catch (Exception e) {
             if (isFailOnError()) {
-                throw new BuildException("Validation failure", t);
+                throw new BuildException("Validation failure", e);
             } else {
-                handleErrorOutput("Validation failure: " + t);
+                handleErrorOutput("Validation failure: " + e);
             }
         } finally {
             Thread.currentThread().setContextClassLoader(oldCL);

Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java Mon Sep 27 20:24:18
2010
@@ -196,11 +196,11 @@ public class JMXAccessorQueryTask extend
                     try {
                         value = jmxServerConnection
                                 .getAttribute(oname, attName);
-                    } catch (Throwable t) {
+                    } catch (Exception e) {
                         if (isEcho())
                             handleErrorOutput("Error getting attribute "
                                     + oname + " " + pname + attName + " "
-                                    + t.toString());
+                                    + e.toString());
                         continue;
                     }
                     if (value == null)

Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java Mon Sep 27 20:24:18
2010
@@ -351,11 +351,11 @@ public class JMXAccessorTask extends Bas
                     // or error line will be logged twice
                     throw new BuildException(error);
                 }
-            } catch (Throwable t) {
+            } catch (Exception e) {
                 if (isFailOnError()) {
-                    throw new BuildException(t);
+                    throw new BuildException(e);
                 } else {
-                    handleErrorOutput(t.getMessage());
+                    handleErrorOutput(e.getMessage());
                 }
             } finally {
                 closeRedirector();



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


Mime
View raw message