Inferred generics for newSetFromMap arrangements

Issue: SPR-13188
This commit is contained in:
Juergen Hoeller
2016-07-26 21:26:31 +02:00
parent e03dea1d64
commit b9ab895743
14 changed files with 24 additions and 37 deletions

View File

@@ -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));
/**

View File

@@ -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.

View File

@@ -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);
/**

View File

@@ -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));
/**

View File

@@ -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");
* 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));
/**

View File

@@ -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 =

View File

@@ -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;