Conditions to determine if @ComponentScan
should be applied can be chosen from the wrong class
#27077
Labels
Milestone
Here is an example that demonstrates the problem: https://github.com/snicoll-scratches/demo-condition-parent
ConfigurationClassParser
does the following when it determines if a@ComponentScan
should be applied:spring-framework/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java
Line 292 in df588e0
It is processed on the
sourceClass
rather than the configuration class being built. The former can be a parent in the hierarchy. In such a case, the conditions in the parent are going to be considered (and the conditions of the configuration class will be ignored).I am wondering how useful this condition is though. Considering that we should ignore the conditions on the parent, the conditions on the configuration class could have been evaluated prior to run
@ComponentScan
.At some point in the history of the project 620c16f was reverted to not process conditions on parent classes.
The text was updated successfully, but these errors were encountered: