From 4a733513c14ea46bff03b78f526acefc21c58b9c Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 4 Mar 2010 22:36:35 +0000 Subject: [PATCH] added bean name assertions git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3058 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../beans/factory/support/AbstractBeanFactory.java | 1 + .../beans/factory/support/DefaultListableBeanFactory.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index 9191bb9b63b..136d6f0123f 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -901,6 +901,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp } public boolean isCurrentlyInCreation(String beanName) { + Assert.notNull(beanName, "Bean name must not be null"); return isSingletonCurrentlyInCreation(beanName) || isPrototypeCurrentlyInCreation(beanName); } diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 1da35ce9568..6a85c8d1fbf 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -262,6 +262,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @Override public boolean containsBeanDefinition(String beanName) { + Assert.notNull(beanName, "Bean name must not be null"); return this.beanDefinitionMap.containsKey(beanName); } @@ -574,7 +575,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException { - Assert.hasText(beanName, "'beanName' must not be empty"); + Assert.hasText(beanName, "Bean name must not be empty"); Assert.notNull(beanDefinition, "BeanDefinition must not be null"); if (beanDefinition instanceof AbstractBeanDefinition) {