RequiredAnnotationBeanPostProcessor's skip attribute accepts "true" as String value as well (SPR-8617)
This commit is contained in:
parent
63a217a40a
commit
f6be50eda2
|
@ -164,8 +164,11 @@ public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP
|
||||||
* @return <code>true</code> to skip the bean; <code>false</code> to process it
|
* @return <code>true</code> to skip the bean; <code>false</code> to process it
|
||||||
*/
|
*/
|
||||||
protected boolean shouldSkip(ConfigurableListableBeanFactory beanFactory, String beanName) {
|
protected boolean shouldSkip(ConfigurableListableBeanFactory beanFactory, String beanName) {
|
||||||
return (beanFactory != null && beanFactory.containsBeanDefinition(beanName) &&
|
if (beanFactory == null || !beanFactory.containsBeanDefinition(beanName)) {
|
||||||
Boolean.TRUE.equals(beanFactory.getBeanDefinition(beanName).getAttribute(SKIP_REQUIRED_CHECK_ATTRIBUTE)));
|
return false;
|
||||||
|
}
|
||||||
|
Object value = beanFactory.getBeanDefinition(beanName).getAttribute(SKIP_REQUIRED_CHECK_ATTRIBUTE);
|
||||||
|
return (value != null && (Boolean.TRUE.equals(value) || Boolean.valueOf(value.toString())));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue