diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
index 11072dabc47..cb8dbb70f5f 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
@@ -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 findAnnotationOnBean(String beanName, Class 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);
}
}
}
diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
index ee607bd72f3..c715b127d43 100644
--- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
+++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
@@ -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 {
}
public A findAnnotationOnBean(String beanName, Class annotationType) {
- Class> handlerType = getType(beanName);
- return AnnotationUtils.findAnnotation(handlerType, annotationType);
+ return AnnotationUtils.findAnnotation(getType(beanName), annotationType);
}
}