Recent releases of the Spring Framework have introduced support for meta-annotation attribute overrides in custom composed annotations. This support works as expected with reflection-based annotation processing; however, Spring's ASM-based support for annotation processing completely ignores meta-annotation attribute overrides.
By comparing the implementations of getAnnotationAttributes(String, boolean) in StandardAnnotationMetadata (reflection) and AnnotationMetadataReadingVisitor (ASM), we see that StandardAnnotationMetadata delegates to AnnotatedElementUtils which properly supports meta-annotation attribute overrides. Whereas, AnnotationMetadataReadingVisitor performs a simple look-up in a local (linked) hash map with complete disregard for attribute overrides.
Refactor AnnotationMetadataReadingVisitor so that Spring's ASM-based annotation processing supports meta-annotation attribute overrides on par with the support already provided for reflection-based processing in AnnotatedElementUtils.
See TODO comments in ConfigurationClassPostProcessorTests.
Affects: 4.0 GA
#16181 Support Class meta-annotation attributes with ASM-based annotation processing ("depends on")
#17234 AnnotationTypeFilter not finding java.lang annotations as meta annotations
#16272 AnnotationReadingVisitorUtils.getMergedAnnotationAttributes() overrides values it should not
#16332 AnnotationReadingVisitorUtils.getMergedAnnotationAttributes() mutates the map argument
#16331 Consider not overriding meta-annotation attributes if empty
The text was updated successfully, but these errors were encountered: