[JIRA] (SLF4J-414) MDCAdapter does not handle null map

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[JIRA] (SLF4J-414) MDCAdapter does not handle null map

JIRA noreply-jira@qos.ch
Dmitry created SLF4J-414:

             Summary: MDCAdapter does not handle null map
                 Key: SLF4J-414
                 URL: https://jira.qos.ch/browse/SLF4J-414
             Project: SLF4J
          Issue Type: Bug
          Components: Implementations
    Affects Versions: 1.7.25
            Reporter: Dmitry
            Assignee: SLF4J developers list
            Priority: Minor

It turned out that method {{org.slf4j.impl.Log4jMDCAdapter#getCopyOfContextMap()}} may return {{null}} however {{org.slf4j.impl.Log4jMDCAdapter#setContextMap()}} does not handle this situation. That causes the Slf4j API consumer to eventually break with NPE in this code, depending on implementation / current logging backend provider:
Map<String, String> mcdContextMap = MDC.getCopyOfContextMap();
It is expected that {{MDC.setContextMap()}} API treats {{null}} map as empty map.

This message was sent by Atlassian JIRA
slf4j-dev mailing list
[hidden email]