From e6dae633f7b109e5ad3090da80d9d95c86072f42 Mon Sep 17 00:00:00 2001 From: Albert Shift Date: Fri, 27 Mar 2015 13:14:30 -0700 Subject: [PATCH] remove dsl caching in Casser, no need it --- src/main/java/casser/core/Casser.java | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) 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) {