DATACMNS-1755 - Rename uppercase 'CACHE' static finals.
Rename static final `CACHE` members to use the lowercase form. Although the caches are static final, they are not constant values. Original pull request: #448.
This commit is contained in:
committed by
Mark Paluch
parent
df5f42ce29
commit
cb8443e299
@@ -48,11 +48,11 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> {
|
||||
public static final ClassTypeInformation<Map> MAP = new ClassTypeInformation(Map.class);
|
||||
public static final ClassTypeInformation<Object> OBJECT = new ClassTypeInformation(Object.class);
|
||||
|
||||
private static final Map<Class<?>, ClassTypeInformation<?>> CACHE = new ConcurrentReferenceHashMap<>(64,
|
||||
private static final Map<Class<?>, ClassTypeInformation<?>> cache = new ConcurrentReferenceHashMap<>(64,
|
||||
ReferenceType.WEAK);
|
||||
|
||||
static {
|
||||
Arrays.asList(COLLECTION, LIST, SET, MAP, OBJECT).forEach(it -> CACHE.put(it.getType(), it));
|
||||
Arrays.asList(COLLECTION, LIST, SET, MAP, OBJECT).forEach(it -> cache.put(it.getType(), it));
|
||||
}
|
||||
|
||||
private final Class<S> type;
|
||||
@@ -68,7 +68,7 @@ public class ClassTypeInformation<S> extends TypeDiscoverer<S> {
|
||||
|
||||
Assert.notNull(type, "Type must not be null!");
|
||||
|
||||
return (ClassTypeInformation<S>) CACHE.computeIfAbsent(type, ClassTypeInformation::new);
|
||||
return (ClassTypeInformation<S>) cache.computeIfAbsent(type, ClassTypeInformation::new);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,7 +44,7 @@ import org.springframework.util.TypeUtils;
|
||||
public class ParameterTypes {
|
||||
|
||||
private static final TypeDescriptor OBJECT_DESCRIPTOR = TypeDescriptor.valueOf(Object.class);
|
||||
private static final ConcurrentMap<List<TypeDescriptor>, ParameterTypes> CACHE = new ConcurrentReferenceHashMap<>();
|
||||
private static final ConcurrentMap<List<TypeDescriptor>, ParameterTypes> cache = new ConcurrentReferenceHashMap<>();
|
||||
|
||||
private final List<TypeDescriptor> types;
|
||||
private final Lazy<Collection<ParameterTypes>> alternatives;
|
||||
@@ -75,7 +75,7 @@ public class ParameterTypes {
|
||||
|
||||
Assert.notNull(types, "Types must not be null!");
|
||||
|
||||
return CACHE.computeIfAbsent(types, ParameterTypes::new);
|
||||
return cache.computeIfAbsent(types, ParameterTypes::new);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user