Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 80FF4DE8B for ; Thu, 8 Nov 2012 15:21:45 +0000 (UTC) Received: (qmail 75586 invoked by uid 500); 8 Nov 2012 15:21:45 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 75505 invoked by uid 500); 8 Nov 2012 15:21:44 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 75492 invoked by uid 99); 8 Nov 2012 15:21:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 15:21:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 15:21:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AFCA62388980; Thu, 8 Nov 2012 15:21:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121108152120.AFCA62388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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