[prev in list] [next in list] [prev in thread] [next in thread]
List: slf4j-dev
Subject: [slf4j-dev] [JIRA] (SLF4J-414) MDCAdapter does not handle null map
From: "QOS.CH (JIRA)" <noreply-jira () qos ! ch>
Date: 2017-07-14 13:45:00
Message-ID: JIRA.14924.1500039886000.524.1500039900183 () Atlassian ! JIRA
[Download RAW message or body]
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: {code}
Map<String, String> mcdContextMap = MDC.getCopyOfContextMap();
...
MDC.setContextMap(mcdContextMap);
{code}
It is expected that {{MDC.setContextMap()}} API treats {{null}} map as empty map.
--
This message was sent by Atlassian JIRA
(v7.3.1#73012)
_______________________________________________
slf4j-dev mailing list
slf4j-dev@qos.ch
http://mailman.qos.ch/mailman/listinfo/slf4j-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic