-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
@ConditionalOnClass is a Spring Boot feature but it relies on the fact that the ConditionEvaluator in Framework can read the metadata from it without having to load the classes it refers to. With the ASM use case, we use a MergedAnnotationsCollection. Which uses AnnotationTypeMappings which delegates to AnnotationsScanner.getDeclaredAnnotations(), and that ends up swallowing the exception and removes the @ConditionalOnClass(X.class) annotation from the mappings, because the X type cannot be loaded.
The code that filters out @ConditionalOnClass is actually in AttributeMethods.canLoad() - this method returns "false" when the type to be tested is not present.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement