提交 b9ab8957 编写于 作者: J Juergen Hoeller

Inferred generics for newSetFromMap arrangements

Issue: SPR-13188
上级 e03dea1d
......@@ -129,7 +129,7 @@ public abstract class AbstractAutoProxyCreator extends ProxyProcessorSupport
private BeanFactory beanFactory;
private final Set<String> targetSourcedBeans =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(16));
Collections.newSetFromMap(new ConcurrentHashMap<>(16));
private final Set<Object> earlyProxyReferences =
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 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.
*/
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.
......
......@@ -119,8 +119,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
protected final Log logger = LogFactory.getLog(getClass());
private final Set<Class<? extends Annotation>> autowiredAnnotationTypes =
new LinkedHashSet<>();
private final Set<Class<? extends Annotation>> autowiredAnnotationTypes = new LinkedHashSet<>();
private String requiredParameterName = "required";
......@@ -130,14 +129,11 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
private ConfigurableListableBeanFactory beanFactory;
private final Set<String> lookupMethodsChecked =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(256));
private final Set<String> lookupMethodsChecked = Collections.newSetFromMap(new ConcurrentHashMap<>(256));
private final Map<Class<?>, Constructor<?>[]> candidateConstructorsCache =
new ConcurrentHashMap<>(256);
private final Map<Class<?>, Constructor<?>[]> candidateConstructorsCache = new ConcurrentHashMap<>(256);
private final Map<String, InjectionMetadata> injectionMetadataCache =
new ConcurrentHashMap<>(256);
private final Map<String, InjectionMetadata> injectionMetadataCache = new ConcurrentHashMap<>(256);
/**
......
......@@ -93,8 +93,7 @@ public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP
/**
* Cache for validated bean names, skipping re-validation for the same bean
*/
private final Set<String> validatedBeanNames =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(64));
private final Set<String> validatedBeanNames = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
/**
......
/*
* 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");
* 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
*/
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;
/** Map from bean name to merged RootBeanDefinition */
private final Map<String, RootBeanDefinition> mergedBeanDefinitions =
new ConcurrentHashMap<>(256);
private final Map<String, RootBeanDefinition> mergedBeanDefinitions = new ConcurrentHashMap<>(256);
/** Names of beans that have already been created at least once */
private final Set<String> alreadyCreated =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(256));
private final Set<String> alreadyCreated = Collections.newSetFromMap(new ConcurrentHashMap<>(256));
/** Names of beans that are currently in creation */
private final ThreadLocal<Object> prototypesCurrentlyInCreation =
......
......@@ -96,11 +96,11 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
/** Names of beans that are currently in creation */
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 */
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 */
private Set<Exception> suppressedExceptions;
......
......@@ -60,8 +60,7 @@ public class EventListenerMethodProcessor implements SmartInitializingSingleton,
private final EventExpressionEvaluator evaluator = new EventExpressionEvaluator();
private final Set<Class<?>> nonAnnotatedClasses =
Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>(64));
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
@Override
......
......@@ -109,11 +109,9 @@ public class ScheduledAnnotationBeanPostProcessor implements DestructionAwareBea
private final ScheduledTaskRegistrar registrar = new ScheduledTaskRegistrar();
private final Set<Class<?>> nonAnnotatedClasses =
Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>(64));
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
private final Map<Object, Set<ScheduledTask>> scheduledTasks =
new ConcurrentHashMap<>(16);
private final Map<Object, Set<ScheduledTask>> scheduledTasks = new ConcurrentHashMap<>(16);
@Override
......
......@@ -38,11 +38,9 @@ public abstract class DecoratingClassLoader extends ClassLoader {
}
private final Set<String> excludedPackages =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(8));
private final Set<String> excludedPackages = Collections.newSetFromMap(new ConcurrentHashMap<>(8));
private final Set<String> excludedClasses =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(8));
private final Set<String> excludedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(8));
/**
......
......@@ -82,7 +82,7 @@ public abstract class StatementCreatorUtils {
static final boolean shouldIgnoreGetParameterType = SpringProperties.getFlag(IGNORE_GETPARAMETERTYPE_PROPERTY_NAME);
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);
......
......@@ -99,14 +99,14 @@ public class JmsListenerAnnotationBeanPostProcessor
private StringValueResolver embeddedValueResolver;
private final MessageHandlerMethodFactoryAdapter messageHandlerMethodFactory = new MessageHandlerMethodFactoryAdapter();
private final MessageHandlerMethodFactoryAdapter messageHandlerMethodFactory =
new MessageHandlerMethodFactoryAdapter();
private final JmsListenerEndpointRegistrar registrar = new JmsListenerEndpointRegistrar();
private final AtomicInteger counter = new AtomicInteger();
private final Set<Class<?>> nonAnnotatedClasses =
Collections.newSetFromMap(new ConcurrentHashMap<Class<?>, Boolean>(64));
private final Set<Class<?>> nonAnnotatedClasses = Collections.newSetFromMap(new ConcurrentHashMap<>(64));
@Override
......
......@@ -51,8 +51,7 @@ public class SessionAttributesHandler {
private final Set<Class<?>> attributeTypes = new HashSet<>();
private final Set<String> knownAttributeNames =
Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>(4));
private final Set<String> knownAttributeNames = Collections.newSetFromMap(new ConcurrentHashMap<>(4));
private final SessionAttributeStore sessionAttributeStore;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册