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 9C9A910B28 for ; Mon, 15 Jul 2013 18:50:38 +0000 (UTC) Received: (qmail 60092 invoked by uid 500); 15 Jul 2013 18:50:38 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 60034 invoked by uid 500); 15 Jul 2013 18:50:38 -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 60027 invoked by uid 99); 15 Jul 2013 18:50:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jul 2013 18:50:38 +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; Mon, 15 Jul 2013 18:50:37 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5BC2523888D7; Mon, 15 Jul 2013 18:50:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1503414 - /cxf/branches/2.5.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java Date: Mon, 15 Jul 2013 18:50:17 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130715185017.5BC2523888D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Mon Jul 15 18:50:16 2013 New Revision: 1503414 URL: http://svn.apache.org/r1503414 Log: Merged revisions 1503373 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes ........ r1503373 | dkulp | 2013-07-15 14:03:46 -0400 (Mon, 15 Jul 2013) | 18 lines Merged revisions 1502599 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes ........ r1502599 | dkulp | 2013-07-12 12:21:06 -0400 (Fri, 12 Jul 2013) | 10 lines Merged revisions 1501373 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1501373 | dkulp | 2013-07-09 12:41:29 -0400 (Tue, 09 Jul 2013) | 2 lines Some optimizations which also remove a PMD 5.0 error ........ ........ ........ Modified: cxf/branches/2.5.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java Modified: cxf/branches/2.5.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java?rev=1503414&r1=1503413&r2=1503414&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java (original) +++ cxf/branches/2.5.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java Mon Jul 15 18:50:16 2013 @@ -28,24 +28,24 @@ package org.apache.cxf.management.web.lo */ final class LoggingThread { - private static ThreadLocal threadLocal = new ThreadLocal() { - @Override - protected LoggingThread initialValue() { - return new LoggingThread(); - } - }; - - private boolean isSilent; + private static ThreadLocal threadLocal = new ThreadLocal(); private LoggingThread() { } public static void markSilent(boolean silent) { - LoggingThread lt = threadLocal.get(); - lt.isSilent = silent; + if (silent) { + threadLocal.set(Boolean.TRUE); + } else { + threadLocal.remove(); + } } public static boolean isSilent() { - return threadLocal.get().isSilent; + Boolean b = threadLocal.get(); + if (b != null) { + return b; + } + return false; } }