@Test public void removeForNullKeyTest() { mdcAdapter.remove(null); }
public void remove(String key) { if (key == null) { return; } Map<String, String> oldMap = copyOnThreadLocal.get(); if (oldMap == null) return; Integer lastOp = getAndSetLastOperation(WRITE_OPERATION); if (wasLastOpReadOrNull(lastOp)) { Map<String, String> newMap = duplicateAndInsertNewMap(oldMap); newMap.remove(key); } else { oldMap.remove(key); } }
LogbackMDCAdapter implements MDCAdapter { public void remove(String key) { if (key == null) { return; } Map<String, String> oldMap = copyOnThreadLocal.get(); if (oldMap == null) return; Integer lastOp = getAndSetLastOperation(WRITE_OPERATION); if (wasLastOpReadOrNull(lastOp)) { Map<String, String> newMap = duplicateAndInsertNewMap(oldMap); newMap.remove(key); } else { oldMap.remove(key); } } }
LogbackMDCAdapter implements MDCAdapter { public void remove(String key) { if (key == null) { return; } Map<String, String> oldMap = copyOnThreadLocal.get(); if (oldMap == null) return; Integer lastOp = getAndSetLastOperation(WRITE_OPERATION); if (wasLastOpReadOrNull(lastOp)) { Map<String, String> newMap = duplicateAndInsertNewMap(oldMap); newMap.remove(key); } else { oldMap.remove(key); } }  }
LogbackMDCAdapter implements MDCAdapter { public void remove(String key) { if (key == null) { return; } Map<String, String> oldMap = copyOnThreadLocal.get(); if (oldMap == null) return; Integer lastOp = getAndSetLastOperation(WRITE_OPERATION); if (wasLastOpReadOrNull(lastOp)) { Map<String, String> newMap = duplicateAndInsertNewMap(oldMap); newMap.remove(key); } else { oldMap.remove(key); } }  void put(String key, String val); void remove(String key); void clear(); String get(String key); Map<String, String> getPropertyMap(); Set<String> getKeys(); Map<String, String> getCopyOfContextMap(); void setContextMap(Map<String, String> contextMap); }
LogbackMDCAdapter implements MDCAdapter { public void remove(String key) { if (key == null) { return; } Map<String, String> oldMap = copyOnThreadLocal.get(); if (oldMap == null) return; Integer lastOp = getAndSetLastOperation(WRITE_OPERATION); if (wasLastOpReadOrNull(lastOp)) { Map<String, String> newMap = duplicateAndInsertNewMap(oldMap); newMap.remove(key); } else { oldMap.remove(key); } }  void put(String key, String val); void remove(String key); void clear(); String get(String key); Map<String, String> getPropertyMap(); Set<String> getKeys(); Map<String, String> getCopyOfContextMap(); void setContextMap(Map<String, String> contextMap);  }