Avoid exposeTargetClass attempt if bean name is null

Issue: SPR-13650
master
Juergen Hoeller 9 years ago
parent 2defb6555e
commit 90c9d96a4d
  1. 4
      spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java

@ -94,14 +94,14 @@ public abstract class AutoProxyUtils {
} }
/** /**
* Expose the given target class for the specified bean. * Expose the given target class for the specified bean, if possible.
* @param beanFactory the containing ConfigurableListableBeanFactory * @param beanFactory the containing ConfigurableListableBeanFactory
* @param beanName the name of the bean * @param beanName the name of the bean
* @param targetClass the corresponding target class * @param targetClass the corresponding target class
* @since 4.2.3 * @since 4.2.3
*/ */
static void exposeTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName, Class<?> targetClass) { static void exposeTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName, Class<?> targetClass) {
if (beanFactory.containsBeanDefinition(beanName)) { if (beanName != null && beanFactory.containsBeanDefinition(beanName)) {
beanFactory.getMergedBeanDefinition(beanName).setAttribute(ORIGINAL_TARGET_CLASS_ATTRIBUTE, targetClass); beanFactory.getMergedBeanDefinition(beanName).setAttribute(ORIGINAL_TARGET_CLASS_ATTRIBUTE, targetClass);
} }
} }

Loading…
Cancel
Save