Browse Source

Use CollectionFactory#newLinkedHashSet for method arguments

See gh-32291
pull/33065/head
Juergen Hoeller 2 years ago
parent
commit
a58e27eded
  1. 2
      spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

2
spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java

@ -875,7 +875,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA @@ -875,7 +875,7 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
int argumentCount = method.getParameterCount();
Object[] arguments = new Object[argumentCount];
DependencyDescriptor[] descriptors = new DependencyDescriptor[argumentCount];
Set<String> autowiredBeanNames = new LinkedHashSet<>(argumentCount * 2);
Set<String> autowiredBeanNames = CollectionUtils.newLinkedHashSet(argumentCount);
Assert.state(beanFactory != null, "No BeanFactory available");
TypeConverter typeConverter = beanFactory.getTypeConverter();
for (int i = 0; i < arguments.length; i++) {

Loading…
Cancel
Save