Browse Source

polishing

pull/23217/head
Juergen Hoeller 17 years ago
parent
commit
ac16101f98
  1. 6
      org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
  2. 5
      org.springframework.beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java

6
org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

@ -367,15 +367,13 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -367,15 +367,13 @@ 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) {
Class<?> handlerType = getType(beanName);
A ann = AnnotationUtils.findAnnotation(handlerType, annotationType);
A ann = AnnotationUtils.findAnnotation(getType(beanName), annotationType);
if (ann == null && containsBeanDefinition(beanName)) {
BeanDefinition bd = getMergedBeanDefinition(beanName);
if (bd instanceof AbstractBeanDefinition) {
AbstractBeanDefinition abd = (AbstractBeanDefinition) bd;
if (abd.hasBeanClass()) {
Class<?> beanClass = abd.getBeanClass();
ann = AnnotationUtils.findAnnotation(beanClass, annotationType);
ann = AnnotationUtils.findAnnotation(abd.getBeanClass(), annotationType);
}
}
}

5
org.springframework.beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 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.
@ -265,8 +265,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory { @@ -265,8 +265,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
}
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) {
Class<?> handlerType = getType(beanName);
return AnnotationUtils.findAnnotation(handlerType, annotationType);
return AnnotationUtils.findAnnotation(getType(beanName), annotationType);
}
}

Loading…
Cancel
Save