[jboss-svn-commits] JBL Code SVN: r26402 - in labs/jbosstm/trunk/common/classes/com/arjuna/common: util and 1 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed May 6 13:29:53 EDT 2009


Author: jhalliday
Date: 2009-05-06 13:29:53 -0400 (Wed, 06 May 2009)
New Revision: 26402

Modified:
   labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/commonPropertyManager.java
   labs/jbosstm/trunk/common/classes/com/arjuna/common/util/FileLocator.java
   labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java
Log:
Improved exception handling. JBTM-534


Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/commonPropertyManager.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/commonPropertyManager.java	2009-05-06 17:21:56 UTC (rev 26401)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/commonPropertyManager.java	2009-05-06 17:29:53 UTC (rev 26402)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
  * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
+ * full listing of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -62,7 +62,9 @@
       }
       catch (Exception e)
       {
-         throw new ExceptionInInitializerError(e.toString());
+          ExceptionInInitializerError error = new ExceptionInInitializerError(e.toString());
+          error.initCause(e);
+          throw error;
       }
    }
 }

Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/util/FileLocator.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/util/FileLocator.java	2009-05-06 17:21:56 UTC (rev 26401)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/util/FileLocator.java	2009-05-06 17:29:53 UTC (rev 26402)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
  * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
+ * full listing of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -139,7 +139,9 @@
       catch (MalformedURLException e)
       {
          System.err.println("locateURL: URL creation problem");
-         throw new FileNotFoundException("locateURL: URL creation problem");
+         FileNotFoundException exception = new FileNotFoundException("locateURL: URL creation problem");
+         exception.initCause(e);
+         throw exception;
       }
       if ((url = locateByResource(findFile)) != null)
          return url;

Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java	2009-05-06 17:21:56 UTC (rev 26401)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java	2009-05-06 17:29:53 UTC (rev 26402)
@@ -371,8 +371,7 @@
             }
 
         } catch (LogConfigurationException e) {
-            //throw new ExceptionInInitializerError("An unexpected exception occurred while creating the logger factory:" + e);
-            throw new RuntimeException("An unexpected exception occurred while creating the logger factory: " + e.getMessage());
+            throw new RuntimeException("An unexpected exception occurred while creating the logger factory: " + e.getMessage(), e);
         }
         m_isInitialized = true;
     }




More information about the jboss-svn-commits mailing list