File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
spring-beans/src/main/java/org/springframework/beans/factory/support Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -562,17 +562,10 @@ public String[] getBeanNamesForAnnotation(Class<? extends Annotation> annotation
562
562
563
563
@ Override
564
564
public Map <String , Object > getBeansWithAnnotation (Class <? extends Annotation > annotationType ) {
565
- Map <String , Object > results = new LinkedHashMap <String , Object >();
566
- for (String beanName : this .beanDefinitionNames ) {
567
- BeanDefinition beanDefinition = getBeanDefinition (beanName );
568
- if (!beanDefinition .isAbstract () && findAnnotationOnBean (beanName , annotationType ) != null ) {
569
- results .put (beanName , getBean (beanName ));
570
- }
571
- }
572
- for (String beanName : this .manualSingletonNames ) {
573
- if (!results .containsKey (beanName ) && findAnnotationOnBean (beanName , annotationType ) != null ) {
574
- results .put (beanName , getBean (beanName ));
575
- }
565
+ String [] beanNames = getBeanNamesForAnnotation (annotationType );
566
+ Map <String , Object > results = new LinkedHashMap <String , Object >(beanNames .length );
567
+ for (String beanName : beanNames ) {
568
+ results .put (beanName , getBean (beanName ));
576
569
}
577
570
return results ;
578
571
}
You can’t perform that action at this time.
0 commit comments