From cbab6fa59fcc3b76b1400064081a029f8a5e803d Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 1 Oct 2010 22:22:50 +0000 Subject: [PATCH] reduced BeanDefinition footprint by initializing Sets and Maps with 0 --- .../org/springframework/beans/MutablePropertyValues.java | 2 +- .../beans/factory/config/ConstructorArgumentValues.java | 4 ++-- .../beans/factory/support/AbstractBeanDefinition.java | 2 +- .../beans/factory/support/MethodOverrides.java | 4 ++-- .../beans/factory/support/RootBeanDefinition.java | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java b/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java index 44d481bbb7..470a705dd5 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/MutablePropertyValues.java @@ -50,7 +50,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable { * @see #add(String, Object) */ public MutablePropertyValues() { - this.propertyValueList = new ArrayList(); + this.propertyValueList = new ArrayList(0); } /** diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java index a0701c2558..3a3aa9df17 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConstructorArgumentValues.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 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. @@ -42,7 +42,7 @@ import org.springframework.util.ObjectUtils; */ public class ConstructorArgumentValues { - private final Map indexedArgumentValues = new LinkedHashMap(); + private final Map indexedArgumentValues = new LinkedHashMap(0); private final List genericArgumentValues = new LinkedList(); diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java index e7c98618ec..f5852c44bd 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java @@ -147,7 +147,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess private boolean primary = false; private final Map qualifiers = - new LinkedHashMap(); + new LinkedHashMap(0); private boolean nonPublicAccessAllowed = true; diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java index e4ddfcd6ea..c8ba6e4b07 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/MethodOverrides.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 the original author or authors. + * Copyright 2002-2010 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. @@ -34,7 +34,7 @@ import java.util.Set; */ public class MethodOverrides { - private final Set overrides = new HashSet(); + private final Set overrides = new HashSet(0); /** diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java index 39e2915fa3..8d816a2b20 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java @@ -48,11 +48,11 @@ import org.springframework.util.Assert; */ public class RootBeanDefinition extends AbstractBeanDefinition { - private final Set externallyManagedConfigMembers = Collections.synchronizedSet(new HashSet()); + private final Set externallyManagedConfigMembers = Collections.synchronizedSet(new HashSet(0)); - private final Set externallyManagedInitMethods = Collections.synchronizedSet(new HashSet()); + private final Set externallyManagedInitMethods = Collections.synchronizedSet(new HashSet(0)); - private final Set externallyManagedDestroyMethods = Collections.synchronizedSet(new HashSet()); + private final Set externallyManagedDestroyMethods = Collections.synchronizedSet(new HashSet(0)); private BeanDefinitionHolder decoratedDefinition;