Author: dkulp Date: Thu Nov 8 15:49:42 2012 New Revision: 1407135 URL: http://svn.apache.org/viewvc?rev=1407135&view=rev Log: Merged revisions 1407122 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
........ r1407122 | dkulp | 2012-11-08 10:21:20 -0500 (Thu, 08 Nov 2012) | 10 lines 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.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Modified: cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=1407135&r1=1407134&r2=1407135&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java (original) +++ cxf/branches/2.5.x-fixes/common/common/src/main/java/org/apache/cxf/common/logging/LogUtils.java Thu Nov 8 15:49:42 2012 @@ -233,22 +233,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 } @@ -262,7 +263,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); @@ -272,7 +273,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(); @@ -287,7 +288,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
