fixed getBeansWithAnnotation to ignore beans with non-determinable type (SPR-6579)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2718 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-12-23 19:11:19 +00:00
parent f126255c18
commit a9a3fe28d0
2 changed files with 38 additions and 3 deletions
@@ -425,7 +425,11 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
* if not found on the exposed bean reference (e.g. in case of a proxy).
*/
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
A ann = AnnotationUtils.findAnnotation(getType(beanName), annotationType);
A ann = null;
Class beanType = getType(beanName);
if (beanType != null) {
ann = AnnotationUtils.findAnnotation(beanType, annotationType);
}
if (ann == null && containsBeanDefinition(beanName)) {
BeanDefinition bd = getMergedBeanDefinition(beanName);
if (bd instanceof AbstractBeanDefinition) {