Skip to content

Commit 718ef42

Browse files
committed
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
1 parent 86a85f5 commit 718ef42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.springframework.aot.hint.RuntimeHints;
2828
import org.springframework.aot.hint.TypeHint;
2929
import org.springframework.aot.hint.TypeHint.Builder;
30+
import org.springframework.aot.hint.annotation.Reflective;
3031
import org.springframework.core.annotation.AliasFor;
3132
import org.springframework.core.annotation.MergedAnnotations;
3233
import org.springframework.core.annotation.SynthesizedAnnotation;
@@ -66,7 +67,7 @@ public static void registerAnnotation(RuntimeHints hints, Class<?> annotationTyp
6667
}
6768

6869
private static void collectAliasedAnnotations(Set<Class<?>> seen, Set<Class<?>> types, Class<?> annotationType) {
69-
if (seen.contains(annotationType)) {
70+
if (seen.contains(annotationType) || Reflective.class.equals(annotationType)) {
7071
return;
7172
}
7273
seen.add(annotationType);

0 commit comments

Comments
 (0)