Simplify implementation of AnnotationMetadata.getMetaAnnotationTypes()

Since an annotation cannot be extended in Java, there is no need to use
the INHERITED_ANNOTATIONS SearchStrategy to search for meta-annotations
on an annotation.
This commit is contained in:
Sam Brannen 2023-08-22 14:58:19 +02:00
parent 2935ff8f97
commit a55b50b512
1 changed files with 1 additions and 2 deletions

View File

@ -23,7 +23,6 @@ import java.util.stream.Collectors;
import org.springframework.core.annotation.MergedAnnotation;
import org.springframework.core.annotation.MergedAnnotations;
import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
/**
* Interface that defines abstract access to the annotations of a specific
@ -64,7 +63,7 @@ public interface AnnotationMetadata extends ClassMetadata, AnnotatedTypeMetadata
if (!annotation.isPresent()) {
return Collections.emptySet();
}
return MergedAnnotations.from(annotation.getType(), SearchStrategy.INHERITED_ANNOTATIONS).stream()
return MergedAnnotations.from(annotation.getType()).stream()
.map(mergedAnnotation -> mergedAnnotation.getType().getName())
.collect(Collectors.toCollection(LinkedHashSet::new));
}