Skip to content

ClassPathBeanDefinitionScanner vs ClassPathBeanDefinitionScanner: difference in behavior when dealing with @ComponentScan excludeFilters [SPR-9100] #13738

@spring-projects-issues

Description

@spring-projects-issues

Yannick Lazzari opened SPR-9100 and commented

There seems to be a difference in the way configuration classes, i.e. classes annotated with @Configuration, are handled by the ClassPathBeanDefinitionScanner vs the AnnotatedBeanDefinitionReader. The javadoc says that the AnnotatedBeanDefinitionReader is, "...an alternative to ClassPathBeanDefinitionScanner, applying the same resolution of annotations but for explicitly registered classes only.". If you read the Spring forum thread attached to this issue report, you will find an example that shows that the way @ComponentScan excludeFilters are processed is not the same; actually, they seemed to be totally ignored when the ClassPathBeanDefinitionScanner scans a class annotated in the following manner:

@Configuration
@ComponentScan(basePackages={"com.foo", "com.bar"}, excludeFilters={@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.foo.ComponentA.class)})
public class TestConfig {
}


Affects: 3.1 GA

Reference URL: http://forum.springsource.org/showthread.php?122907-Spring-3-1-AnnotationConfigWebApplicationContext-scan-vs-register-method&p=400832

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions