jvz opened a new issue, #1426:
URL: https://github.com/apache/logging-log4j2/issues/1426

   ## Description
   
   `MDCContextMap::getCopy` delegates to `MDC::getCopyOfContextMap` which is 
documented as potentially returning `null`. This fact is respected within 
`MDCContextMap`, but `ThreadContextMap::getCopy` is documented as returning a 
non-null value. In `CloseableThreadContext.Instance`, this causes 
`NullPointerException`s in the `putAll` method when `ThreadContext::getContext` 
is invoked and later used.
   
   ## Configuration
   
   **Version:** 2.20.0
   
   **Operating system:** [OS and version]
   
   **JDK:** [JDK distribution and version]
   
   ## Logs
   
   ```
   java.lang.NullPointerException: null
           at 
org.apache.logging.log4j.CloseableThreadContext$Instance.putAll(CloseableThreadContext.java:170)
           at 
org.apache.logging.log4j.CloseableThreadContext.putAll(CloseableThreadContext.java:100)
   ```
   
   ## Reproduction
   
   [An isolated test reproducing the test.
   JUnit tests similar to the ones in the code base are extremely appreciated.]
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to