Browse Source

Exclude @Reflective from @AliasFor collection

Update `RuntimeHintsUtils` to skip `@Reflective` annotations when
checking for `@AliasFor`. Since the `@Reflective` annotation is only
used at AOT processing time, we shouldn't need a hint for it.

See gh-28528
pull/28538/head
Phillip Webb 4 years ago
parent
commit
718ef42d68
  1. 3
      spring-core/src/main/java/org/springframework/aot/hint/support/RuntimeHintsUtils.java

3
spring-core/src/main/java/org/springframework/aot/hint/support/RuntimeHintsUtils.java

@ -27,6 +27,7 @@ import org.springframework.aot.hint.MemberCategory; @@ -27,6 +27,7 @@ import org.springframework.aot.hint.MemberCategory;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.TypeHint;
import org.springframework.aot.hint.TypeHint.Builder;
import org.springframework.aot.hint.annotation.Reflective;
import org.springframework.core.annotation.AliasFor;
import org.springframework.core.annotation.MergedAnnotations;
import org.springframework.core.annotation.SynthesizedAnnotation;
@ -66,7 +67,7 @@ public abstract class RuntimeHintsUtils { @@ -66,7 +67,7 @@ public abstract class RuntimeHintsUtils {
}
private static void collectAliasedAnnotations(Set<Class<?>> seen, Set<Class<?>> types, Class<?> annotationType) {
if (seen.contains(annotationType)) {
if (seen.contains(annotationType) || Reflective.class.equals(annotationType)) {
return;
}
seen.add(annotationType);

Loading…
Cancel
Save