@@ -982,7 +982,7 @@ private <T> NamedBeanHolder<T> resolveNamedBean(Class<T> requiredType, Object...
982982 String [] candidateNames = getBeanNamesForType (requiredType );
983983
984984 if (candidateNames .length > 1 ) {
985- ArrayList <String > autowireCandidates = new ArrayList <>();
985+ List <String > autowireCandidates = new ArrayList <>(candidateNames . length );
986986 for (String beanName : candidateNames ) {
987987 if (!containsBeanDefinition (beanName ) || getBeanDefinition (beanName ).isAutowireCandidate ()) {
988988 autowireCandidates .add (beanName );
@@ -999,12 +999,12 @@ private <T> NamedBeanHolder<T> resolveNamedBean(Class<T> requiredType, Object...
999999 }
10001000 else if (candidateNames .length > 1 ) {
10011001 Map <String , Object > candidates = new LinkedHashMap <>(candidateNames .length );
1002- for (String candidateName : candidateNames ) {
1003- if (containsSingleton (candidateName )) {
1004- candidates .put (candidateName , getBean (candidateName , requiredType , args ));
1002+ for (String beanName : candidateNames ) {
1003+ if (containsSingleton (beanName )) {
1004+ candidates .put (beanName , getBean (beanName , requiredType , args ));
10051005 }
10061006 else {
1007- candidates .put (candidateName , getType (candidateName ));
1007+ candidates .put (beanName , getType (beanName ));
10081008 }
10091009 }
10101010 String candidateName = determinePrimaryCandidate (candidates , requiredType );
@@ -1688,7 +1688,7 @@ public Object getOrderSource(Object obj) {
16881688 if (beanDefinition == null ) {
16891689 return null ;
16901690 }
1691- List <Object > sources = new ArrayList <>();
1691+ List <Object > sources = new ArrayList <>(2 );
16921692 Method factoryMethod = beanDefinition .getResolvedFactoryMethod ();
16931693 if (factoryMethod != null ) {
16941694 sources .add (factoryMethod );
0 commit comments