https://issues.apache.org/bugzilla/show_bug.cgi?id=50486

--- Comment #42 from [email protected] ---
(In reply to comment #40)
> Hi Marcel,
> 
> this patch is actually applied (slightly modified):
> 
> http://svn.apache.org/repos/asf/logging/log4j/trunk/src/main/java/org/apache/
> log4j/MDC.java
> 
>  private void remove0(String key) {
>         if (!java1 && tlm != null) {
>             Hashtable ht = (Hashtable) ((ThreadLocalMap) tlm).get();
>             if (ht != null) {
>                 ht.remove(key);
>                 // clean up if this was the last key
>                 if (ht.isEmpty()) {
>                     clear0();
>                 }
>             }
>         }
>     }
> 
> 
> If the Hashtable is empty after key removal, the clear0() method is called.
> 
> Do you agree?

Yes, looks good to me. I just mentioned it again because calling clean() in
Servlet#destroy() doesn't make sense in my opinion. In fact, clients shouldn't
have to call clean() at all if they properly call remove() for each key they
add.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to