cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1502599 - /cxf/branches/2.7.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java
Date Fri, 12 Jul 2013 16:21:06 GMT
Author: dkulp
Date: Fri Jul 12 16:21:06 2013
New Revision: 1502599

URL: http://svn.apache.org/r1502599
Log:
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.7.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java

Modified: cxf/branches/2.7.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.7.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java?rev=1502599&r1=1502598&r2=1502599&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/atom/LoggingThread.java
Fri Jul 12 16:21:06 2013
@@ -28,24 +28,24 @@ package org.apache.cxf.management.web.lo
  */
 final class LoggingThread {
 
-    private static ThreadLocal<LoggingThread> threadLocal = new ThreadLocal<LoggingThread>()
{
-        @Override
-        protected LoggingThread initialValue() {
-            return new LoggingThread();
-        }
-    };
-
-    private boolean isSilent;
+    private static ThreadLocal<Boolean> threadLocal = new ThreadLocal<Boolean>();
 
     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;
     }
 }



Mime
View raw message