cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1407122 - /cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/logging/LogUtils.java
Date Thu, 08 Nov 2012 15:21:20 GMT
Author: dkulp
Date: Thu Nov  8 15:21:20 2012
New Revision: 1407122

URL: http://svn.apache.org/viewvc?rev=1407122&view=rev
Log:
Merged revisions 1406710 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1406710 | asoldano | 2012-11-07 11:34:55 -0500 (Wed, 07 Nov 2012) | 2 lines

  Fix regression cause by commit 1404620 causing Log4J logger not being used

........

Modified:
    cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/logging/LogUtils.java

Modified: cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/logging/LogUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=1407122&r1=1407121&r2=1407122&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/logging/LogUtils.java
(original)
+++ cxf/branches/2.6.x-fixes/api/src/main/java/org/apache/cxf/common/logging/LogUtils.java
Thu Nov  8 15:21:20 2012
@@ -237,22 +237,23 @@ public final class LogUtils {
         if (n != null) {
             Thread.currentThread().setContextClassLoader(n);
         }
+        String bundleName = name;
         try {
             Logger logger = null;
             ResourceBundle b = null;
-            if (name == null) {
+            if (bundleName == null) {
                 //grab the bundle prior to the call to Logger.getLogger(...) so the 
                 //ResourceBundle can be loaded outside the big sync block that getLogger
really is
-                name = BundleUtils.getBundleName(cls);
+                bundleName = BundleUtils.getBundleName(cls);
                 try {
                     b = BundleUtils.getBundle(cls);
                 } catch (MissingResourceException rex) {
                     //ignore
                 }
             } else {
-                name = BundleUtils.getBundleName(cls, name);
+                bundleName = BundleUtils.getBundleName(cls, bundleName);
                 try {
-                    b = BundleUtils.getBundle(cls, name);
+                    b = BundleUtils.getBundle(cls, bundleName);
                 } catch (MissingResourceException rex) {
                     //ignore
                 }
@@ -266,7 +267,7 @@ public final class LogUtils {
                     Constructor<?> cns = loggerClass.getConstructor(String.class, String.class);
                     if (name == null) {
                         try {
-                            return (Logger) cns.newInstance(loggerName, BundleUtils.getBundleName(cls));
+                            return (Logger) cns.newInstance(loggerName, bundleName);
                         } catch (InvocationTargetException ite) {
                             if (ite.getTargetException() instanceof MissingResourceException)
{
                                 return (Logger) cns.newInstance(loggerName, null);
@@ -276,7 +277,7 @@ public final class LogUtils {
                         } 
                     } else {
                         try {
-                            return (Logger) cns.newInstance(loggerName, BundleUtils.getBundleName(cls,
name));
+                            return (Logger) cns.newInstance(loggerName, bundleName);
                         } catch (InvocationTargetException ite) {
                             if (ite.getTargetException() instanceof MissingResourceException)
{
                                 throw (MissingResourceException)ite.getTargetException();
@@ -291,7 +292,7 @@ public final class LogUtils {
             }
                 
             try {
-                logger = Logger.getLogger(loggerName, name); //NOPMD
+                logger = Logger.getLogger(loggerName, bundleName); //NOPMD
             } catch (IllegalArgumentException iae) {
                 //likely a mismatch on the bundle name, just return the default
                 logger = Logger.getLogger(loggerName); //NOPMD



Mime
View raw message