From 599418775c0e7ccb1cd76b6c6d6edad81e8e209c Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 6 Oct 2009 04:30:26 +0000 Subject: [PATCH] SPR-6186: removed remaining duplicate check for @Configuration git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2056 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../support/ConfigurationClassWebApplicationContext.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.springframework.web/src/main/java/org/springframework/web/context/support/ConfigurationClassWebApplicationContext.java b/org.springframework.web/src/main/java/org/springframework/web/context/support/ConfigurationClassWebApplicationContext.java index d3d788dda2f..24763a11cac 100644 --- a/org.springframework.web/src/main/java/org/springframework/web/context/support/ConfigurationClassWebApplicationContext.java +++ b/org.springframework.web/src/main/java/org/springframework/web/context/support/ConfigurationClassWebApplicationContext.java @@ -19,10 +19,14 @@ package org.springframework.web.context.support; import java.io.IOException; import org.springframework.beans.BeansException; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.support.DefaultBeanNameGenerator; import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.context.annotation.AnnotationConfigUtils; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ConfigurationClassApplicationContext; -import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.context.annotation.ConfigurationClassPostProcessor; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; @@ -88,9 +92,6 @@ public class ConfigurationClassWebApplicationContext extends AbstractRefreshable for (String configLocation : getConfigLocations()) { try { Class configClass = ClassUtils.getDefaultClassLoader().loadClass(configLocation); - if (AnnotationUtils.findAnnotation(configClass, Configuration.class) == null) { - throw new IllegalArgumentException("Class [" + configClass.getName() + "] is not annotated with @Configuration"); - } this.delegate.addConfigurationClass(configClass); } catch (ClassNotFoundException ex) { throw new IOException("Could not load @Configuration class [" + configLocation + "]", ex);