@Required does not get processed on beans returned by @Bean factory methods (SPR-5744)
This commit is contained in:
@@ -28,6 +28,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
|
||||
import org.springframework.beans.factory.annotation.Autowire;
|
||||
import org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.config.BeanDefinitionHolder;
|
||||
import org.springframework.beans.factory.parsing.SourceExtractor;
|
||||
@@ -123,6 +124,7 @@ class ConfigurationClassBeanDefinitionReader {
|
||||
beanDef.setFactoryBeanName(configClass.getBeanName());
|
||||
beanDef.setUniqueFactoryMethodName(metadata.getMethodName());
|
||||
beanDef.setAutowireMode(RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
|
||||
beanDef.setAttribute(RequiredAnnotationBeanPostProcessor.SKIP_REQUIRED_CHECK_ATTRIBUTE, Boolean.TRUE);
|
||||
|
||||
// consider name and any aliases
|
||||
Map<String, Object> beanAttributes = metadata.getAnnotationAttributes(Bean.class.getName());
|
||||
|
||||
Reference in New Issue
Block a user