Skip to content

Commit

Permalink
Revert changes to AnnotationUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Oct 4, 2023
1 parent 66c5a7d commit b5928a3
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,12 @@
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.Proxy;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Stream;

import org.springframework.core.BridgeMethodResolver;
import org.springframework.core.annotation.AnnotationTypeMapping.MirrorSets.MirrorSet;
Expand Down Expand Up @@ -564,18 +561,6 @@ public static <A extends Annotation> A findAnnotation(Class<?> clazz, @Nullable
return null;
}

// check if we are dealing with an annotation on an anonymous class (no need for class hierarchy traversal)
final A annotationOnAnonymous = Stream
.concat(Stream.of(clazz.getAnnotatedSuperclass()), Arrays.stream(clazz.getAnnotatedInterfaces()))
.filter(Objects::nonNull)
.map(a -> findAnnotation(a, annotationType))
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
if (annotationOnAnonymous != null) {
return annotationOnAnonymous;
}

// Shortcut: directly present on the element, with no merging needed?
if (AnnotationFilter.PLAIN.matches(annotationType) ||
AnnotationsScanner.hasPlainJavaAnnotationsOnly(clazz)) {
Expand Down

0 comments on commit b5928a3

Please sign in to comment.