package io.tracee.backend.jbosslogging;

import io.tracee.MDCLike;
import org.jboss.logging.MDC;

import java.util.HashMap;
import java.util.Map;

final class JbossLoggingMdcLikeAdapter implements MDCLike {

    @Override
    public boolean containsKey(String key) {
        return MDC.get(key) != null;
    }

    @Override
    public void put(String key, String value) {
        MDC.put(key, value);
    }

    @Override
    public String get(String key) {

        return (String) MDC.get(key);
    }

    @Override
    public void remove(String key) {
        MDC.remove(key);
    }

    @Override
    public Map<String, String> getCopyOfContext() {
        final Map<String, Object> map = MDC.getMap();
        final Map<String, String> copy = new HashMap<String, String>(map.size());
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (!(entry.getValue() instanceof String)) continue;
            copy.put(entry.getKey(), (String) entry.getValue());
        }
        return copy;
    }
}

@@ -452,17 +452,16 @@
  key) %7B%0A
-%0A
         
@@ -467,25 +467,31 @@
  return 
-(
 String
-) 
+.valueOf(
 MDC.get(
@@ -490,24 +490,25 @@
 MDC.get(key)
+)
 ;%0A    %7D%0A%0A   
@@ -858,85 +858,11 @@
 ) %7B%0A
-            if (!(entry.getValue() instanceof String)) continue;%0A            
+%09%09%09
 copy
@@ -886,17 +886,23 @@
 (), 
-(
 String
-) 
+.valueOf(
 entr
@@ -910,24 +910,25 @@
 .getValue())
+)
 ;%0A        %7D%0A

Use String.valueOf() instead. It's more robust against Object values in the MDC.