@Test public void testNullValues() { MDC.put("foo", null); assertNull(MDC.get("foo")); }
@Nullable @Override public String get(String key) { switch (key) { case TRACE_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.traceIdHex(); } break; } case SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.spanIdHex(); } break; } case PARENT_SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.nonnullParentSpanIdHex(); } break; } default: break; } return super.get(key); }
ServiceTalkTracingThreadContextMap extends ServiceTalkThreadContextMap { @Nullable @Override public String get(String key) { switch (key) { case TRACE_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.traceIdHex(); } break; } case SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.spanIdHex(); } break; } case PARENT_SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.nonnullParentSpanIdHex(); } break; } default: break; } return super.get(key); } }
ServiceTalkTracingThreadContextMap extends ServiceTalkThreadContextMap { @Nullable @Override public String get(String key) { switch (key) { case TRACE_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.traceIdHex(); } break; } case SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.spanIdHex(); } break; } case PARENT_SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.nonnullParentSpanIdHex(); } break; } default: break; } return super.get(key); }  }
ServiceTalkTracingThreadContextMap extends ServiceTalkThreadContextMap { @Nullable @Override public String get(String key) { switch (key) { case TRACE_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.traceIdHex(); } break; } case SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.spanIdHex(); } break; } case PARENT_SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.nonnullParentSpanIdHex(); } break; } default: break; } return super.get(key); }  @Nullable @Override String get(String key); @Override boolean containsKey(String key); @Override Map<String, String> getCopy(); @Nullable @Override Map<String, String> getImmutableMapOrNull(); @Override boolean isEmpty(); @Override StringMap getReadOnlyContextData(); }
ServiceTalkTracingThreadContextMap extends ServiceTalkThreadContextMap { @Nullable @Override public String get(String key) { switch (key) { case TRACE_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.traceIdHex(); } break; } case SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.spanIdHex(); } break; } case PARENT_SPAN_ID_KEY: { InMemorySpan span = SCOPE_MANAGER.activeSpan(); if (span != null) { return span.nonnullParentSpanIdHex(); } break; } default: break; } return super.get(key); }  @Nullable @Override String get(String key); @Override boolean containsKey(String key); @Override Map<String, String> getCopy(); @Nullable @Override Map<String, String> getImmutableMapOrNull(); @Override boolean isEmpty(); @Override StringMap getReadOnlyContextData();  }