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: https://github.com/spring-projects/spring-framework/blob/df588e030f069dd31997ff747839f1d8d5d8d7c7/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassParser.java#L292

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 620c16f5c7bb543b18f71b2848f90461f8646237 was reverted to not process conditions on parent classes.