ConfigurationClassUtils should check bean methods in super classes also Fix GH-30449
Comment From: quaff
Test case added, could you review it? @jhoeller @sbrannen
Comment From: jhoeller
This is not within the intentions of our configuration class check which may literally apply to every bean in an application context. Driven by the fact that we're typically introspecting class files in a classpath scan there, not fully resolved classes, we intentionally do not rely on the superclass/interface hierarchy of such beans. We only search for @Bean
methods on superclasses and interfaces if there is an indication on the given class to begin with, either a stereotype or local @Bean
methods. With the latter local method check, we're just trying to be lenient; in the original version of that code, we insisted on a stereotype for any lite configuration class. I'm afraid we cannot be even more lenient than that when that would incur significant extra parsing cost.
Comment From: quaff
I'm afraid we cannot be even more lenient than that when that would incur significant extra parsing cost.
I don't think it would incur significant extra parsing cost since it's a rare case, at least document should be improved if you insist.