diff --git a/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java b/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java index 3216a9c5c50..d2b2ed6d4da 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java +++ b/org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java @@ -252,13 +252,14 @@ class ConfigurationClassEnhancer { // is the same as that of referring to a FactoryBean within XML. See SPR-6602. if (factoryContainsBean('&'+beanName) && factoryContainsBean(beanName)) { Object factoryBean = this.beanFactory.getBean('&'+beanName); - if (factoryBean instanceof ScopedProxyFactoryBean) { - // pass through - scoped proxy factory beans are a special case and should not - // be further proxied - } else { - // it is a candidate FactoryBean - go ahead with enhancement - return enhanceFactoryBean(factoryBean.getClass(), beanName); - } + if (factoryBean instanceof ScopedProxyFactoryBean) { + // pass through - scoped proxy factory beans are a special case and should not + // be further proxied + } + else { + // it is a candidate FactoryBean - go ahead with enhancement + return enhanceFactoryBean(factoryBean.getClass(), beanName); + } } boolean factoryIsCaller = beanMethod.equals(SimpleInstantiationStrategy.getCurrentlyInvokedFactoryMethod());