Consider @Import classes as lite @Configuration
Allow classes that are annotated with @Import to be considered as 'lite' @Configuration candidates. Allows the AnnotationConfigApplicationContext to directly register @Import beans even if they are not @Components. Issue: SPR-10533
This commit is contained in:
@@ -101,9 +101,12 @@ abstract class ConfigurationClassUtils {
|
||||
}
|
||||
|
||||
public static boolean isLiteConfigurationCandidate(AnnotationMetadata metadata) {
|
||||
return !metadata.isInterface() && // not an interface or an annotation
|
||||
(metadata.isAnnotated(Component.class.getName()) ||
|
||||
metadata.hasAnnotatedMethods(Bean.class.getName()));
|
||||
if(metadata.isInterface()) {
|
||||
return false; // do not consider an interface or an annotation
|
||||
}
|
||||
return metadata.isAnnotated(Import.class.getName()) ||
|
||||
metadata.isAnnotated(Component.class.getName()) ||
|
||||
metadata.hasAnnotatedMethods(Bean.class.getName());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user