Inferred generics for newSetFromMap arrangements
Issue: SPR-13188
This commit is contained in:
parent
e03dea1d64
commit
b9ab895743
|
@ -129,7 +129,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
|
||||||
private BeanFactory beanFactory;
|
private BeanFactory beanFactory;
|
||||||
|
|
||||||
private final Set<String> targetSourcedBeans =
|
private final Set<String> targetSourcedBeans =
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(16));
|
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||||
|
|
||||||
private final Set<Object> earlyProxyReferences =
|
private final Set<Object> earlyProxyReferences =
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||||
|
|
|
@ -58,7 +58,7 @@ public abstract class BeanUtils {
|
||||||
private static final Log logger = LogFactory.getLog(BeanUtils.class);
|
private static final Log logger = LogFactory.getLog(BeanUtils.class);
|
||||||
|
|
||||||
private static final Set<Class<?>> unknownEditorTypes =
|
private static final Set<Class<?>> unknownEditorTypes =
|
||||||
Collections.newSetFromMap(new ConcurrentReferenceHashMap<Class<?>, Boolean>(64));
|
Collections.newSetFromMap(new ConcurrentReferenceHashMap<>(64));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class CachedIntrospectionResults {
|
||||||
* accept classes from, even if the classes do not qualify as cache-safe.
|
* accept classes from, even if the classes do not qualify as cache-safe.
|
||||||
*/
|
*/
|
||||||
static final Set<ClassLoader> acceptedClassLoaders =
|
static final Set<ClassLoader> acceptedClassLoaders =
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<ClassLoader, Boolean>(16));
|
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map keyed by Class containing CachedIntrospectionResults, strongly held.
|
* Map keyed by Class containing CachedIntrospectionResults, strongly held.
|
||||||
|
|
|
@ -119,8 +119,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
|
||||||
|
|
||||||
protected final Log logger = LogFactory.getLog(getClass());
|
protected final Log logger = LogFactory.getLog(getClass());
|
||||||
|
|
||||||
private final Set<Class<? extends Annotation>> autowiredAnnotationTypes =
|
private final Set<Class<? extends Annotation>> autowiredAnnotationTypes = new LinkedHashSet<>();
|
||||||
new LinkedHashSet<>();
|
|
||||||
|
|
||||||
private String requiredParameterName = "required";
|
private String requiredParameterName = "required";
|
||||||
|
|
||||||
|
@ -130,14 +129,11 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
|
||||||
|
|
||||||
private ConfigurableListableBeanFactory beanFactory;
|
private ConfigurableListableBeanFactory beanFactory;
|
||||||
|
|
||||||
private final Set<String> lookupMethodsChecked =
|
private final Set<String> lookupMethodsChecked = Collections.newSetFromMap(new ConcurrentHashMap<>(256));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(256));
|
|
||||||
|
|
||||||
private final Map<Class<?>, Constructor<?>[]> candidateConstructorsCache =
|
private final Map<Class<?>, Constructor<?>[]> candidateConstructorsCache = new ConcurrentHashMap<>(256);
|
||||||
new ConcurrentHashMap<>(256);
|
|
||||||
|
|
||||||
private final Map<String, InjectionMetadata> injectionMetadataCache =
|
private final Map<String, InjectionMetadata> injectionMetadataCache = new ConcurrentHashMap<>(256);
|
||||||
new ConcurrentHashMap<>(256);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -93,8 +93,7 @@ public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP
|
||||||
/**
|
/**
|
||||||
* Cache for validated bean names, skipping re-validation for the same bean
|
* Cache for validated bean names, skipping re-validation for the same bean
|
||||||
*/
|
*/
|
||||||
private final Set<String> validatedBeanNames =
|
private final Set<String> validatedBeanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(64));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2013 the original author or authors.
|
* Copyright 2002-2016 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -74,7 +74,7 @@ public class PropertyOverrideConfigurer extends PropertyResourceConfigurer {
|
||||||
/**
|
/**
|
||||||
* Contains names of beans that have overrides
|
* Contains names of beans that have overrides
|
||||||
*/
|
*/
|
||||||
private final Set<String> beanNames = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(16));
|
private final Set<String> beanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -160,12 +160,10 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||||
private SecurityContextProvider securityContextProvider;
|
private SecurityContextProvider securityContextProvider;
|
||||||
|
|
||||||
/** Map from bean name to merged RootBeanDefinition */
|
/** Map from bean name to merged RootBeanDefinition */
|
||||||
private final Map<String, RootBeanDefinition> mergedBeanDefinitions =
|
private final Map<String, RootBeanDefinition> mergedBeanDefinitions = new ConcurrentHashMap<>(256);
|
||||||
new ConcurrentHashMap<>(256);
|
|
||||||
|
|
||||||
/** Names of beans that have already been created at least once */
|
/** Names of beans that have already been created at least once */
|
||||||
private final Set<String> alreadyCreated =
|
private final Set<String> alreadyCreated = Collections.newSetFromMap(new ConcurrentHashMap<>(256));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(256));
|
|
||||||
|
|
||||||
/** Names of beans that are currently in creation */
|
/** Names of beans that are currently in creation */
|
||||||
private final ThreadLocal<Object> prototypesCurrentlyInCreation =
|
private final ThreadLocal<Object> prototypesCurrentlyInCreation =
|
||||||
|
|
|
@ -96,11 +96,11 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
|
||||||
|
|
||||||
/** Names of beans that are currently in creation */
|
/** Names of beans that are currently in creation */
|
||||||
private final Set<String> singletonsCurrentlyInCreation =
|
private final Set<String> singletonsCurrentlyInCreation =
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(16));
|
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||||
|
|
||||||
/** Names of beans currently excluded from in creation checks */
|
/** Names of beans currently excluded from in creation checks */
|
||||||
private final Set<String> inCreationCheckExclusions =
|
private final Set<String> inCreationCheckExclusions =
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(16));
|
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
|
||||||
|
|
||||||
/** List of suppressed Exceptions, available for associating related causes */
|
/** List of suppressed Exceptions, available for associating related causes */
|
||||||
private Set<Exception> suppressedExceptions;
|
private Set<Exception> suppressedExceptions;
|
||||||
|
|
|
@ -60,8 +60,7 @@ public class EventListenerMethodProcessor implements SmartInitializingSingleton,
|
||||||
|
|
||||||
private final EventExpressionEvaluator evaluator = new EventExpressionEvaluator();
|
private final EventExpressionEvaluator evaluator = new EventExpressionEvaluator();
|
||||||
|
|
||||||
private final Set<Class<?>> nonAnnotatedClasses =
|
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>(64));
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -109,11 +109,9 @@ public class ScheduledAnnotationBeanPostProcessor implements DestructionAwareBea
|
||||||
|
|
||||||
private final ScheduledTaskRegistrar registrar = new ScheduledTaskRegistrar();
|
private final ScheduledTaskRegistrar registrar = new ScheduledTaskRegistrar();
|
||||||
|
|
||||||
private final Set<Class<?>> nonAnnotatedClasses =
|
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>(64));
|
|
||||||
|
|
||||||
private final Map<Object, Set<ScheduledTask>> scheduledTasks =
|
private final Map<Object, Set<ScheduledTask>> scheduledTasks = new ConcurrentHashMap<>(16);
|
||||||
new ConcurrentHashMap<>(16);
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,11 +38,9 @@ public abstract class DecoratingClassLoader extends ClassLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final Set<String> excludedPackages =
|
private final Set<String> excludedPackages = Collections.newSetFromMap(new ConcurrentHashMap<>(8));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(8));
|
|
||||||
|
|
||||||
private final Set<String> excludedClasses =
|
private final Set<String> excludedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(8));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(8));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -82,7 +82,7 @@ public abstract class StatementCreatorUtils {
|
||||||
static final boolean shouldIgnoreGetParameterType = SpringProperties.getFlag(IGNORE_GETPARAMETERTYPE_PROPERTY_NAME);
|
static final boolean shouldIgnoreGetParameterType = SpringProperties.getFlag(IGNORE_GETPARAMETERTYPE_PROPERTY_NAME);
|
||||||
|
|
||||||
static final Set<String> driversWithNoSupportForGetParameterType =
|
static final Set<String> driversWithNoSupportForGetParameterType =
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(1));
|
Collections.newSetFromMap(new ConcurrentHashMap<>(1));
|
||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(StatementCreatorUtils.class);
|
private static final Log logger = LogFactory.getLog(StatementCreatorUtils.class);
|
||||||
|
|
||||||
|
|
|
@ -99,14 +99,14 @@ public class JmsListenerAnnotationBeanPostProcessor
|
||||||
|
|
||||||
private StringValueResolver embeddedValueResolver;
|
private StringValueResolver embeddedValueResolver;
|
||||||
|
|
||||||
private final MessageHandlerMethodFactoryAdapter messageHandlerMethodFactory = new MessageHandlerMethodFactoryAdapter();
|
private final MessageHandlerMethodFactoryAdapter messageHandlerMethodFactory =
|
||||||
|
new MessageHandlerMethodFactoryAdapter();
|
||||||
|
|
||||||
private final JmsListenerEndpointRegistrar registrar = new JmsListenerEndpointRegistrar();
|
private final JmsListenerEndpointRegistrar registrar = new JmsListenerEndpointRegistrar();
|
||||||
|
|
||||||
private final AtomicInteger counter = new AtomicInteger();
|
private final AtomicInteger counter = new AtomicInteger();
|
||||||
|
|
||||||
private final Set<Class<?>> nonAnnotatedClasses =
|
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>(64));
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -51,8 +51,7 @@ public class SessionAttributesHandler {
|
||||||
|
|
||||||
private final Set<Class<?>> attributeTypes = new HashSet<>();
|
private final Set<Class<?>> attributeTypes = new HashSet<>();
|
||||||
|
|
||||||
private final Set<String> knownAttributeNames =
|
private final Set<String> knownAttributeNames = Collections.newSetFromMap(new ConcurrentHashMap<>(4));
|
||||||
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(4));
|
|
||||||
|
|
||||||
private final SessionAttributeStore sessionAttributeStore;
|
private final SessionAttributeStore sessionAttributeStore;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue