cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r582908 - in /incubator/cxf/branches/2.0.x-fixes: ./ common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java
Date Mon, 08 Oct 2007 17:42:13 GMT
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));
                 }



Mime
View raw message