tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001939 - in /tomcat/trunk/java/org/apache/tomcat: jni/ util/digester/ util/http/fileupload/ util/http/fileupload/util/ util/net/
Date Mon, 27 Sep 2010 22:29:31 GMT
Author: markt
Date: Mon Sep 27 22:29:30 2010
New Revision: 1001939

URL: http://svn.apache.org/viewvc?rev=1001939&view=rev
Log:
Remaining 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/tomcat/jni/Library.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java
    tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
    tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/jni/Library.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/Library.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/jni/Library.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/jni/Library.java Mon Sep 27 22:29:30 2010
@@ -17,6 +17,8 @@
 
 package org.apache.tomcat.jni;
 
+import org.apache.tomcat.util.ExceptionUtils;
+
 /** Library
  *
  * @author Mladen Turk
@@ -43,6 +45,7 @@ public final class Library {
                 loaded = true;
             }
             catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 String name = System.mapLibraryName(NAMES[i]);
                 String path = System.getProperty("java.library.path");
                 String sep = System.getProperty("path.separator");

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java Mon Sep 27 22:29:30 2010
@@ -37,6 +37,7 @@ import javax.xml.parsers.SAXParserFactor
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.EntityResolver;
@@ -100,6 +101,7 @@ public class Digester extends DefaultHan
                     sources[0] = src;
                     initialized = true;
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     LogFactory.getLog("org.apache.commons.digester.Digester").
                         error("Unable to load property source["+className+"].",t);
                 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Mon Sep 27
22:29:30 2010
@@ -340,7 +340,7 @@ public abstract class FileUploadBase {
                     FileItem fileItem = iterator.next();
                     try {
                         fileItem.delete();
-                    } catch (Throwable e) {
+                    } catch (Exception e) {
                         // ignore it
                     }
                 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java Mon Sep 27
22:29:30 2010
@@ -119,14 +119,14 @@ public final class Streams {
             if (in != null) {
                 try {
                     in.close();
-                } catch (Throwable t) {
+                } catch (IOException ioe) {
                     /* Ignore me */
                 }
             }
             if (pClose  &&  out != null) {
                 try {
                     out.close();
-                } catch (Throwable t) {
+                } catch (IOException ioe) {
                     /* Ignore me */
                 }
             }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Mon Sep 27 22:29:30 2010
@@ -39,6 +39,7 @@ import org.apache.tomcat.jni.SSLContext;
 import org.apache.tomcat.jni.SSLSocket;
 import org.apache.tomcat.jni.Socket;
 import org.apache.tomcat.jni.Status;
+import org.apache.tomcat.util.ExceptionUtils;
 
 
 /**
@@ -723,6 +724,7 @@ public class AprEndpoint extends Abstrac
             }
 
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             if (log.isDebugEnabled()) {
                 if (step == 2) {
                     log.debug(sm.getString("endpoint.err.handshake"), t);
@@ -770,6 +772,7 @@ public class AprEndpoint extends Abstrac
             log.warn("Socket processing request was rejected for:"+socket,x);
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
@@ -791,6 +794,7 @@ public class AprEndpoint extends Abstrac
             log.warn("Socket processing request was rejected for:"+socket,x);
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
@@ -834,6 +838,7 @@ public class AprEndpoint extends Abstrac
             log.warn("Socket processing request was rejected for:"+socket,x);
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
@@ -873,6 +878,7 @@ public class AprEndpoint extends Abstrac
             log.warn("Socket processing request was rejected for:"+socket,x);
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
@@ -945,6 +951,7 @@ public class AprEndpoint extends Abstrac
                         destroySocket(socket);
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     if (running) log.error(sm.getString("endpoint.accept.fail"), t);
                 }
 
@@ -1230,6 +1237,7 @@ public class AprEndpoint extends Abstrac
                         }
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("endpoint.poll.error"), t);
                 }
 
@@ -1560,6 +1568,7 @@ public class AprEndpoint extends Abstrac
                         }
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("endpoint.poll.error"), t);
                 }
             }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Mon Sep 27 22:29:30 2010
@@ -31,6 +31,7 @@ import java.util.concurrent.RejectedExec
 import org.apache.catalina.Globals;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 
 
@@ -226,6 +227,7 @@ public class JIoEndpoint extends Abstrac
                         log.error(sm.getString("endpoint.accept.fail"), npe);
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("endpoint.accept.fail"), t);
                 }
                 // The processor will recycle itself when it finishes
@@ -267,6 +269,7 @@ public class JIoEndpoint extends Abstrac
                         // SSL handshake
                         serverSocketFactory.handshake(socket.getSocket());
                     } catch (Throwable t) {
+                        ExceptionUtils.handleThrowable(t);
                         if (log.isDebugEnabled()) {
                             log.debug(sm.getString("endpoint.err.handshake"), t);
                         }
@@ -484,6 +487,7 @@ public class JIoEndpoint extends Abstrac
             // Close the socket
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             log.error(sm.getString("endpoint.err.unexpected"), t);
             // Close the socket
             return false;
@@ -519,6 +523,7 @@ public class JIoEndpoint extends Abstrac
             log.warn("Socket processing request was rejected for:"+socket,x);
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
@@ -572,6 +577,7 @@ public class JIoEndpoint extends Abstrac
                 }
             }
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Mon Sep 27 22:29:30
2010
@@ -33,6 +33,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.MutableInteger;
 import org.apache.tomcat.util.net.NioEndpoint.KeyAttachment;
 
@@ -328,6 +329,7 @@ public class NioBlockingSelector {
                         if ( log.isDebugEnabled() ) log.debug("Possibly encountered sun bug
5076772 on windows JDK 1.5",x);
                         continue;
                     } catch (Throwable x) {
+                        ExceptionUtils.handleThrowable(x);
                         log.error("",x);
                         continue;
                     }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1001939&r1=1001938&r2=1001939&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Mon Sep 27 22:29:30 2010
@@ -51,6 +51,7 @@ import javax.net.ssl.X509KeyManager;
 
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.SecureNioChannel.ApplicationBufferHandler;
@@ -408,6 +409,7 @@ public class NioEndpoint extends Abstrac
             try {
                 log.fatal(oomParachuteMsg);
             }catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 System.err.println(oomParachuteMsg);
             }
             lastParachuteCheck = System.currentTimeMillis();
@@ -702,9 +704,12 @@ public class NioEndpoint extends Abstrac
             }
             getPoller0().register(channel);
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             try {
                 log.error("",t);
-            }catch ( Throwable tt){}
+            } catch (Throwable tt) {
+                ExceptionUtils.handleThrowable(t);
+            }
             // Tell to close the socket
             return false;
         }
@@ -750,6 +755,7 @@ public class NioEndpoint extends Abstrac
             log.warn("Socket processing request was rejected for:"+socket,rx);
             return false;
         } catch (Throwable t) {
+            ExceptionUtils.handleThrowable(t);
             // This means we got an OOM or similar creating a thread, or that
             // the pool and its queue are full
             log.error(sm.getString("endpoint.process.fail"), t);
@@ -827,10 +833,15 @@ public class NioEndpoint extends Abstrac
                             try {
                                 System.err.println(oomParachuteMsg);
                                 oomt.printStackTrace();
-                            }catch (Throwable letsHopeWeDontGetHere){}
-                        }catch (Throwable letsHopeWeDontGetHere){}
+                            }catch (Throwable letsHopeWeDontGetHere){
+                                ExceptionUtils.handleThrowable(letsHopeWeDontGetHere);
+                            }
+                        }catch (Throwable letsHopeWeDontGetHere){
+                            ExceptionUtils.handleThrowable(letsHopeWeDontGetHere);
+                        }
                     }
                 } catch (Throwable t) {
+                    ExceptionUtils.handleThrowable(t);
                     log.error(sm.getString("endpoint.accept.fail"), t);
                 }
             }//while
@@ -1038,6 +1049,7 @@ public class NioEndpoint extends Abstrac
                 try {if (ka!=null && ka.getSendfileData()!=null && ka.getSendfileData().fchannel!=null
&& ka.getSendfileData().fchannel.isOpen()) ka.getSendfileData().fchannel.close();}catch
(Exception ignore){}
                 if (ka!=null) ka.reset();
             } catch (Throwable e) {
+                ExceptionUtils.handleThrowable(e);
                 if ( log.isDebugEnabled() ) log.error("",e);
                 // Ignore
             }
@@ -1097,6 +1109,7 @@ public class NioEndpoint extends Abstrac
                         if ( wakeupCounter == null || selector == null ) throw x;
                         continue;
                     } catch (Throwable x) {
+                        ExceptionUtils.handleThrowable(x);
                         log.error("",x);
                         continue;
                     }
@@ -1127,7 +1140,9 @@ public class NioEndpoint extends Abstrac
                         try {
                             System.err.println(oomParachuteMsg);
                             oomt.printStackTrace();
-                        }catch (Throwable letsHopeWeDontGetHere){}
+                        }catch (Throwable letsHopeWeDontGetHere){
+                            ExceptionUtils.handleThrowable(letsHopeWeDontGetHere);
+                        }
                     }
                 }
             }//while
@@ -1189,6 +1204,7 @@ public class NioEndpoint extends Abstrac
             } catch ( CancelledKeyException ckx ) {
                 cancelledKey(sk, SocketStatus.ERROR,false);
             } catch (Throwable t) {
+                ExceptionUtils.handleThrowable(t);
                 log.error("",t);
             }
             return result;
@@ -1557,7 +1573,9 @@ public class NioEndpoint extends Abstrac
                         try {
                             System.err.println(oomParachuteMsg);
                             oomt.printStackTrace();
-                        }catch (Throwable letsHopeWeDontGetHere){}
+                        }catch (Throwable letsHopeWeDontGetHere){
+                            ExceptionUtils.handleThrowable(letsHopeWeDontGetHere);
+                        }
                     }
                 }catch ( Throwable t ) {
                     log.error("",t);



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


Mime
View raw message