Closed
Description
Sam Brannen opened SPR-11598 and commented
Background
This issue picks up where #16100 left off.
Status Quo
The implementations of AnnotatedElementUtils
and (potentially) Spring's ASM-based annotation processing currently favor inherited annotations and inherited composed annotations over composed annotations that are declared closer to the starting class passed to getAnnotationAttributes()
, getAllAnnotationAttributes()
, isAnnotated()
, etc.
See the examples and related discussion in #16100 for details.
Deliverables
- Determine which use cases require special treatment with regard to annotation inheritance.
- Known cases:
@Profile
and@Conditional
- Known cases:
- Reinstate the changes originally introduced in
AnnotatedElementUtils
for Favor more locally declared composed annotations over inherited annotations in AnnotationUtils [SPR-11475] #16100 (i.e., set thesearchClassHierarchy
totrue
for all invocations of the internalprocess()
method).- Search for Favor more locally declared composed annotations over inherited annotations [SPR-11598] #16221 in source code for TODOs.
- Introduce special handling for the known special cases determined in deliverable Spring core JMS pom.xml #1, in order to ensure proper backwards compatibility.
Affects: 4.0 GA
Issue Links:
- Favor more locally declared composed annotations over inherited annotations in AnnotationUtils [SPR-11475] #16100 Favor more locally declared composed annotations over inherited annotations in AnnotationUtils ("depends on")
- @TestExecutionListeners is not fully supported as a meta-annotation [SPR-12661] #17261
@TestExecutionListeners
is not fully supported as a meta-annotation ("is duplicated by") - @Conditional on superclass is ignored [SPR-10840] #15466
@Conditional
on superclass is ignored - Introduce a comprehensive programming model for meta-annotation support [SPR-11511] #16136 Introduce a comprehensive programming model for meta-annotation support
- ActiveProfiles not included when using a custom annotation. [SPR-13748] #18321 ActiveProfiles not included when using a custom annotation.
- Annotations on superclasses are detected by StandardAnnotationMetadata [SPR-11595] #16219 Annotations on superclasses are detected by StandardAnnotationMetadata
- AnnotatedElementUtils fails to find annotations on abstract, bridge, or interface methods [SPR-12738] #17335 AnnotatedElementUtils fails to find annotations on abstract, bridge, or interface methods
- Favor more locally declared composed annotations over inherited annotations in the TestContext framework [SPR-12749] #17346 Favor more locally declared composed annotations over inherited annotations in the TestContext framework