Andy Wilkinson opened SPR-14257 and commented
When ConditionEvaluator looks for Conditional annotations, it doesn't find them when they are a meta-meta-annotation. The problem appears to be due to ConditionEvaluator's use of AnnotationTypeMetadata.getAllAnnotationAttributes which doesn't return all of the values for all of the Conditional annotations that are present. The attached class should hopefully illustrate the behaviour that we're seeing. When run it should output:
com.example.ConditionComposition$MetaFooAndBarConfiguration [class com.example.ConditionComposition$ConditionalOnBar$BarEnabledCondition]
com.example.ConditionComposition$MetaFooAndMetaBarConfiguration []
com.example.ConditionComposition$ExplicitAnnotationConfiguration [class com.example.ConditionComposition$ConditionalOnFoo$FooEnabledCondition, class com.example.ConditionComposition$ConditionalOnBar$BarEnabledCondition]
My expectation is that all three configuration classes should produce the output that ExplicitAnnotationConfiguration produces.
Affects: 4.2.6
Attachments:
Issue Links:
Referenced from: commits 24f5f36, 7de2976
Backported to: 4.2.7
Andy Wilkinson opened SPR-14257 and commented
When
ConditionEvaluatorlooks forConditionalannotations, it doesn't find them when they are a meta-meta-annotation. The problem appears to be due toConditionEvaluator's use ofAnnotationTypeMetadata.getAllAnnotationAttributeswhich doesn't return all of the values for all of theConditionalannotations that are present. The attached class should hopefully illustrate the behaviour that we're seeing. When run it should output:My expectation is that all three configuration classes should produce the output that
ExplicitAnnotationConfigurationproduces.Affects: 4.2.6
Attachments:
Issue Links:
Referenced from: commits 24f5f36, 7de2976
Backported to: 4.2.7