From 0c5ae23aead0bd8866119945f535a6d2257e238f Mon Sep 17 00:00:00 2001 From: jackygurui Date: Fri, 10 Jun 2016 21:59:30 +0100 Subject: [PATCH] Removed class level cache. --- .../liveobject/misc/Introspectior.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/redisson/liveobject/misc/Introspectior.java b/src/main/java/org/redisson/liveobject/misc/Introspectior.java index 66404d942..39a1a46f3 100644 --- a/src/main/java/org/redisson/liveobject/misc/Introspectior.java +++ b/src/main/java/org/redisson/liveobject/misc/Introspectior.java @@ -15,15 +15,10 @@ import net.bytebuddy.matcher.ElementMatchers; */ public class Introspectior { - private static final ConcurrentMap tCache = PlatformDependent.newConcurrentHashMap(); - public static TypeDescription.ForLoadedType getTypeDescription(Class c) { - if (!tCache.containsKey(c)) { - return new TypeDescription.ForLoadedType(c); - } - return tCache.get(c); + return new TypeDescription.ForLoadedType(c); } - + public static MethodDescription getMethodDescription(Class c, String method) { if (method == null || method.isEmpty()) { return null; @@ -33,7 +28,7 @@ public class Introspectior { .filter(ElementMatchers.hasMethodName(method)) .getOnly(); } - + public static FieldDescription getFieldDescription(Class c, String field) { if (field == null || field.isEmpty()) { return null; @@ -43,10 +38,10 @@ public class Introspectior { .filter(ElementMatchers.named(field)) .getOnly(); } - + public static FieldList getFieldsWithAnnotation(Class c, Class a) { - return getTypeDescription(c) - .getDeclaredFields() - .filter(ElementMatchers.isAnnotatedWith(a)); + return getTypeDescription(c) + .getDeclaredFields() + .filter(ElementMatchers.isAnnotatedWith(a)); } }