tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1001938 - in /tomcat/trunk/java/org/apache/naming: NamingService.java factory/ResourceFactory.java factory/webservices/ServiceRefFactory.java
Date Mon, 27 Sep 2010 22:22:02 GMT
Author: markt
Date: Mon Sep 27 22:22:02 2010
New Revision: 1001938

URL: http://svn.apache.org/viewvc?rev=1001938&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/naming/NamingService.java
    tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java
    tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java

Modified: tomcat/trunk/java/org/apache/naming/NamingService.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingService.java?rev=1001938&r1=1001937&r2=1001938&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/NamingService.java (original)
+++ tomcat/trunk/java/org/apache/naming/NamingService.java Mon Sep 27 22:22:02 2010
@@ -156,7 +156,7 @@ public final class NamingService
                                    + ".java.javaURLContextFactory");
             }
             
-        } catch (Throwable t) {
+        } catch (Exception e) {
             state = STOPPED;
             notification = new AttributeChangeNotification
                 (this, sequenceNumber++, System.currentTimeMillis(), 
@@ -198,11 +198,9 @@ public final class NamingService
             System.setProperty(Context.URL_PKG_PREFIXES, oldUrlValue);
             System.setProperty(Context.INITIAL_CONTEXT_FACTORY, oldIcValue);
             
-        } catch (Throwable t) {
-            
+        } catch (Exception e) {
             // FIXME
-            t.printStackTrace();
-            
+            e.printStackTrace();
         }
         
         state = STOPPED;

Modified: tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java?rev=1001938&r1=1001937&r2=1001938&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java (original)
+++ tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java Mon Sep 27 22:22:02 2010
@@ -98,12 +98,12 @@ public class ResourceFactory
                 if (factoryClass != null) {
                     try {
                         factory = (ObjectFactory) factoryClass.newInstance();
-                    } catch (Throwable t) {
-                        if (t instanceof NamingException)
-                            throw (NamingException) t;
+                    } catch (Exception e) {
+                        if (e instanceof NamingException)
+                            throw (NamingException) e;
                         NamingException ex = new NamingException
                             ("Could not create resource factory instance");
-                        ex.initCause(t);
+                        ex.initCause(e);
                         throw ex;
                     }
                 }
@@ -116,10 +116,10 @@ public class ResourceFactory
                         factory = (ObjectFactory) 
                             Class.forName(javaxSqlDataSourceFactoryClassName)
                             .newInstance();
-                    } catch (Throwable t) {
+                    } catch (Exception e) {
                         NamingException ex = new NamingException
                             ("Could not create resource factory instance");
-                        ex.initCause(t);
+                        ex.initCause(e);
                         throw ex;
                     }
                 } else if (ref.getClassName().equals("javax.mail.Session")) {

Modified: tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java?rev=1001938&r1=1001937&r2=1001938&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java (original)
+++ tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java Mon Sep
27 22:22:02 2010
@@ -143,10 +143,10 @@ public class ServiceRefFactory
                         service = factory.createService( new URL(wsdlRefAddr),
                                 serviceQname );
                     }
-                } catch (Throwable t) {
+                } catch (Exception e) {
                     NamingException ex = new NamingException
                     ("Could not create service");
-                    ex.initCause(t);
+                    ex.initCause(e);
                     throw ex;
                 }
             } else {
@@ -175,10 +175,10 @@ public class ServiceRefFactory
                                 serviceInterfaceClass,
                                 new Properties() );
                     }
-                } catch (Throwable t) {
+                } catch (Exception e) {
                     NamingException ex = new NamingException
                     ("Could not create service");
-                    ex.initCause(t);
+                    ex.initCause(e);
                     throw ex;
                 }
             }
@@ -207,10 +207,10 @@ public class ServiceRefFactory
                         m.invoke(service, new Object[] {port.getName(), endpoint });
                         portComponentRef.put(endpoint, new QName(port.getName()));
                     }
-                } catch (Throwable t) {
+                } catch (Exception e) {
                     NamingException ex = new NamingException
                     ("Error while reading Wsdl File");
-                    ex.initCause(t);
+                    ex.initCause(e);
                     throw ex;
                 }
             }



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


Mime
View raw message