// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package org.slf4j.helpers; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; import org.slf4j.spi.MDCAdapter; public class BasicMDCAdapter implements MDCAdapter { static boolean IS_JDK14 = isJDK14(); private InheritableThreadLocal inheritableThreadLocal; public BasicMDCAdapter() { inheritableThreadLocal = new InheritableThreadLocal(); } static boolean isJDK14() { boolean flag; try { flag = System.getProperty("java.version").startsWith("1.4"); } catch (SecurityException securityexception) { return false; } return flag; } public void clear() { label0: { Map map = (Map)inheritableThreadLocal.get(); if (map != null) { map.clear(); if (!isJDK14()) { break label0; } inheritableThreadLocal.set(null); } return; } inheritableThreadLocal.remove(); } public String get(String s) { Map map = (Map)inheritableThreadLocal.get(); if (map != null && s != null) { return (String)map.get(s); } else { return null; } } public Map getCopyOfContextMap() { Map map; map = (Map)inheritableThreadLocal.get(); if (map == null) { break MISSING_BLOCK_LABEL_44; } Map map1 = Collections.synchronizedMap(new HashMap()); map; JVM INSTR monitorenter ; map1.putAll(map); map; JVM INSTR monitorexit ; return map1; Exception exception; exception; map; JVM INSTR monitorexit ; throw exception; return null; } public Set getKeys() { Map map = (Map)inheritableThreadLocal.get(); if (map != null) { return map.keySet(); } else { return null; } } public void put(String s, String s1) { if (s == null) { throw new IllegalArgumentException("key cannot be null"); } Map map1 = (Map)inheritableThreadLocal.get(); Map map = map1; if (map1 == null) { map = Collections.synchronizedMap(new HashMap()); inheritableThreadLocal.set(map); } map.put(s, s1); } public void remove(String s) { Map map = (Map)inheritableThreadLocal.get(); if (map != null) { map.remove(s); } } public void setContextMap(Map map) { map = Collections.synchronizedMap(new HashMap(map)); inheritableThreadLocal.set(map); } }