From f6be50eda24dc4811a6f9024b8134e33c5e99a17 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 16 Aug 2011 22:41:11 +0000 Subject: [PATCH] RequiredAnnotationBeanPostProcessor's skip attribute accepts "true" as String value as well (SPR-8617) --- .../annotation/RequiredAnnotationBeanPostProcessor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java index 21925d6a67..8399f25f74 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/annotation/RequiredAnnotationBeanPostProcessor.java @@ -164,8 +164,11 @@ public class RequiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP * @return true to skip the bean; false to process it */ protected boolean shouldSkip(ConfigurableListableBeanFactory beanFactory, String beanName) { - return (beanFactory != null && beanFactory.containsBeanDefinition(beanName) && - Boolean.TRUE.equals(beanFactory.getBeanDefinition(beanName).getAttribute(SKIP_REQUIRED_CHECK_ATTRIBUTE))); + if (beanFactory == null || !beanFactory.containsBeanDefinition(beanName)) { + return false; + } + Object value = beanFactory.getBeanDefinition(beanName).getAttribute(SKIP_REQUIRED_CHECK_ATTRIBUTE); + return (value != null && (Boolean.TRUE.equals(value) || Boolean.valueOf(value.toString()))); } /**