You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2007/10/08 19:42:13 UTC

svn commit: r582908 - in /incubator/cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java

Author: dkulp
Date: Mon Oct  8 10:42:11 2007
New Revision: 582908

URL: http://svn.apache.org/viewvc?rev=582908&view=rev
Log:
Merged revisions 580269 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/cxf/trunk

........
  r580269 | ffang | 2007-09-28 05:39:08 -0400 (Fri, 28 Sep 2007) | 2 lines
  
  [CXF-1033] ensure we can catch MissingResourceException when we create Logger by reflection
........

Modified:
    incubator/cxf/branches/2.0.x-fixes/   (props changed)
    incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java

Propchange: incubator/cxf/branches/2.0.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=582908&r1=582907&r2=582908&view=diff
==============================================================================
--- incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java (original)
+++ incubator/cxf/branches/2.0.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Mon Oct  8 10:42:11 2007
@@ -20,6 +20,7 @@
 package org.apache.cxf.common.logging;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import java.text.MessageFormat;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
@@ -83,9 +84,13 @@
                 if (name == null) {
                     try {
                         return (Logger) cns.newInstance(cls.getName(), BundleUtils.getBundleName(cls));
-                    } catch (MissingResourceException rex) {
-                        return (Logger) cns.newInstance(cls.getName(), null);
-                    }
+                    } catch (InvocationTargetException ite) {
+                        if (ite.getTargetException() instanceof MissingResourceException) {
+                            return (Logger) cns.newInstance(cls.getName(), null);
+                        } else {
+                            throw ite;
+                        }
+                    } 
                 } else {
                     return (Logger) cns.newInstance(cls.getName(), BundleUtils.getBundleName(cls, name));
                 }