[logback-dev] svn commit: r1703 - logback/trunk/logback-classic/src/main/java/org/slf4j/impl

noreply.ceki at qos.ch noreply.ceki at qos.ch
Mon Jun 9 15:16:56 CEST 2008


Author: ceki
Date: Mon Jun  9 15:16:55 2008
New Revision: 1703

Modified:
   logback/trunk/logback-classic/src/main/java/org/slf4j/impl/LogbackMDCAdapter.java

Log:
Synchronize with changes to MDCAdapter interface in SLF4J 1.5.1

Modified: logback/trunk/logback-classic/src/main/java/org/slf4j/impl/LogbackMDCAdapter.java
==============================================================================
--- logback/trunk/logback-classic/src/main/java/org/slf4j/impl/LogbackMDCAdapter.java	(original)
+++ logback/trunk/logback-classic/src/main/java/org/slf4j/impl/LogbackMDCAdapter.java	Mon Jun  9 15:16:55 2008
@@ -147,4 +147,20 @@
       return null;
     }
   }
+
+  
+  @SuppressWarnings("unchecked") 
+  public void setContextMap(Map contextMap) {
+    HashMap<String, String> oldMap = inheritableThreadLocal.get();
+
+    HashMap<String, String> newMap = new HashMap<String, String>();
+    newMap.putAll(contextMap);
+
+    // the newMap replaces the old one for serialisation's sake
+    inheritableThreadLocal.set(newMap);
+    
+    // hints for the garbage collector
+    oldMap.clear();
+    oldMap = null;
+  }
 }



More information about the logback-dev mailing list