mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-23 22:59:03 +00:00
Prior to this commit, AnnotationDescriptor's findAllLocalMergedAnnotations() filtered results using MergedAnnotationPredicates.firstRunOf( MergedAnnotation::getAggregateIndex), which retains only annotations that share the same aggregate index as the first annotation encountered. Since annotations on the root declaring class have aggregate index 0 and annotations on interfaces have higher indices, interface annotations were silently excluded whenever the root declaring class itself declared the annotation. This commit fixes the issue by replacing the aggregate-index-based filter with a source-based filter that explicitly includes annotations from the root declaring class and from each directly implemented interface. The Javadoc for findAllLocalMergedAnnotations() has also been updated to document the ordering guarantee: annotations from the root declaring class appear first, followed by annotations from implemented interfaces in declaration order. Closes gh-36975