Initialize pre-filled HashMaps with large enough capacity
Empty Maps are preferably initialized without capacity (not initializing them at all or lazily initializing with default capacity when needed). Issue: SPR-17105
This commit is contained in:
@@ -43,7 +43,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*/
|
||||
public class ConstructorArgumentValues {
|
||||
|
||||
private final Map<Integer, ValueHolder> indexedArgumentValues = new LinkedHashMap<>(0);
|
||||
private final Map<Integer, ValueHolder> indexedArgumentValues = new LinkedHashMap<>();
|
||||
|
||||
private final List<ValueHolder> genericArgumentValues = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
|
||||
|
||||
private boolean primary = false;
|
||||
|
||||
private final Map<String, AutowireCandidateQualifier> qualifiers = new LinkedHashMap<>(0);
|
||||
private final Map<String, AutowireCandidateQualifier> qualifiers = new LinkedHashMap<>();
|
||||
|
||||
@Nullable
|
||||
private Supplier<?> instanceSupplier;
|
||||
|
||||
Reference in New Issue
Block a user