diff --git a/src/main/java/casser/core/Casser.java b/src/main/java/casser/core/Casser.java index ef65749..e92df48 100644 --- a/src/main/java/casser/core/Casser.java +++ b/src/main/java/casser/core/Casser.java @@ -16,8 +16,6 @@ package casser.core; import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; import casser.config.CasserSettings; import casser.config.DefaultCasserSettings; @@ -31,8 +29,6 @@ public final class Casser { private static volatile CasserSettings settings = new DefaultCasserSettings(); - private static final ConcurrentMap, Object> dslCache = new ConcurrentHashMap, Object>(); - private Casser() { } @@ -70,21 +66,7 @@ public final class Casser { } public static E dsl(Class iface, ClassLoader classLoader) { - - Object instance = dslCache.get(iface); - - if (instance == null) { - - instance = settings.getDslInstantiator().instantiate(iface, classLoader); - - Object c = dslCache.putIfAbsent(iface, instance); - if (c != null) { - instance = c; - } - } - - return (E) instance; - + return settings.getDslInstantiator().instantiate(iface, classLoader); } public static E wrap(Map map, Class iface) {