Skip to content

Commit d020d73

Browse files
committed
SPR-6186: removed remaining duplicate check for @configuration
1 parent cbadf35 commit d020d73

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

org.springframework.web/src/main/java/org/springframework/web/context/support/ConfigurationClassWebApplicationContext.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
import java.io.IOException;
2020

2121
import org.springframework.beans.BeansException;
22+
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
23+
import org.springframework.beans.factory.config.BeanDefinition;
24+
import org.springframework.beans.factory.support.DefaultBeanNameGenerator;
2225
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
26+
import org.springframework.context.annotation.AnnotationConfigUtils;
2327
import org.springframework.context.annotation.Configuration;
2428
import org.springframework.context.annotation.ConfigurationClassApplicationContext;
25-
import org.springframework.core.annotation.AnnotationUtils;
29+
import org.springframework.context.annotation.ConfigurationClassPostProcessor;
2630
import org.springframework.util.Assert;
2731
import org.springframework.util.ClassUtils;
2832

@@ -88,9 +92,6 @@ protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory)
8892
for (String configLocation : getConfigLocations()) {
8993
try {
9094
Class<?> configClass = ClassUtils.getDefaultClassLoader().loadClass(configLocation);
91-
if (AnnotationUtils.findAnnotation(configClass, Configuration.class) == null) {
92-
throw new IllegalArgumentException("Class [" + configClass.getName() + "] is not annotated with @Configuration");
93-
}
9495
this.delegate.addConfigurationClass(configClass);
9596
} catch (ClassNotFoundException ex) {
9697
throw new IOException("Could not load @Configuration class [" + configLocation + "]", ex);

0 commit comments

Comments
 (0)