ASF Bugzilla – Attachment 26023 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]
Sample patch to fix some of the instances
AntThrowables.patch (text/plain), 3.32 KB, created by
Sebb
on 2010-09-13 14:38:17 UTC
(
hide
)
Description:
Sample patch to fix some of the instances
Filename:
MIME Type:
Creator:
Sebb
Created:
2010-09-13 14:38:17 UTC
Size:
3.32 KB
patch
obsolete
>Index: java/org/apache/catalina/ant/AbstractCatalinaTask.java >=================================================================== >--- java/org/apache/catalina/ant/AbstractCatalinaTask.java (revision 993425) >+++ java/org/apache/catalina/ant/AbstractCatalinaTask.java (working copy) >@@ -20,6 +20,7 @@ > > > import java.io.BufferedOutputStream; >+import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; > import java.net.HttpURLConnection; >@@ -262,7 +263,7 @@ > // or error line will be logged twice > throw new BuildException(error); > } >- } catch (Throwable t) { >+ } catch (Exception t) { > if (isFailOnError()) { > throw new BuildException(t); > } else { >@@ -273,16 +274,14 @@ > if (reader != null) { > try { > reader.close(); >- } catch (Throwable u) { >- ExceptionUtils.handleThrowable(u); >+ } catch (IOException ignored) { > } > reader = null; > } > if (istream != null) { > try { > istream.close(); >- } catch (Throwable u) { >- ExceptionUtils.handleThrowable(u); >+ } catch (IOException ignored) { > } > istream = null; > } >Index: java/org/apache/catalina/ant/ValidatorTask.java >=================================================================== >--- java/org/apache/catalina/ant/ValidatorTask.java (revision 986046) >+++ java/org/apache/catalina/ant/ValidatorTask.java (working copy) >@@ -100,7 +100,7 @@ > is.setByteStream(stream); > digester.parse(is); > handleOutput("web.xml validated"); >- } catch (Throwable t) { >+ } catch (Exception t) { > if (isFailOnError()) { > throw new BuildException("Validation failure", t); > } else { >Index: java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java >=================================================================== >--- java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java (revision 986046) >+++ java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java (working copy) >@@ -196,7 +196,7 @@ > try { > value = jmxServerConnection > .getAttribute(oname, attName); >- } catch (Throwable t) { >+ } catch (Exception t) { > if (isEcho()) > handleErrorOutput("Error getting attribute " > + oname + " " + pname + attName + " " >Index: java/org/apache/catalina/ant/jmx/JMXAccessorTask.java >=================================================================== >--- java/org/apache/catalina/ant/jmx/JMXAccessorTask.java (revision 986046) >+++ java/org/apache/catalina/ant/jmx/JMXAccessorTask.java (working copy) >@@ -351,7 +351,7 @@ > // or error line will be logged twice > throw new BuildException(error); > } >- } catch (Throwable t) { >+ } catch (Exception t) { > if (isFailOnError()) { > throw new BuildException(t); > } else {
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