Skip to content

Commit 3e327f5

Browse files
committed
Remove RuntimeHintsUtils
Due to gh-29053, we can stop using RuntimeHintsUtils to register SynthesizedAnnotation proxies. Closes gh-29058 Closes gh-29059
1 parent 903078a commit 3e327f5

File tree

14 files changed

+1
-457
lines changed

14 files changed

+1
-457
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/annotation/BeanFactoryAnnotationsRuntimeHints.java

Lines changed: 0 additions & 37 deletions
This file was deleted.

spring-beans/src/main/resources/META-INF/spring/aot.factories

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
org.springframework.aot.hint.RuntimeHintsRegistrar=\
2-
org.springframework.beans.factory.annotation.BeanFactoryAnnotationsRuntimeHints,\
32
org.springframework.beans.factory.annotation.JakartaAnnotationsRuntimeHints
43

54
org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor=\

spring-core/src/main/java/org/springframework/aot/hint/annotation/ReflectiveRuntimeHintsRegistrar.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
import org.springframework.aot.hint.ReflectionHints;
3030
import org.springframework.aot.hint.RuntimeHints;
31-
import org.springframework.aot.hint.support.RuntimeHintsUtils;
32-
import org.springframework.core.annotation.MergedAnnotation;
3331
import org.springframework.core.annotation.MergedAnnotations;
3432
import org.springframework.util.ClassUtils;
3533
import org.springframework.util.ReflectionUtils;
@@ -62,20 +60,9 @@ public void registerRuntimeHints(RuntimeHints runtimeHints, Class<?>... types) {
6260
entries.forEach(entry -> {
6361
AnnotatedElement element = entry.element();
6462
entry.processor().registerReflectionHints(runtimeHints.reflection(), element);
65-
registerAnnotationIfNecessary(runtimeHints, element);
6663
});
6764
}
6865

69-
@SuppressWarnings("deprecation")
70-
private void registerAnnotationIfNecessary(RuntimeHints hints, AnnotatedElement element) {
71-
MergedAnnotation<Reflective> reflectiveAnnotation = MergedAnnotations.from(element)
72-
.get(Reflective.class);
73-
MergedAnnotation<?> metaSource = reflectiveAnnotation.getMetaSource();
74-
if (metaSource != null) {
75-
RuntimeHintsUtils.registerAnnotationIfNecessary(hints, metaSource);
76-
}
77-
}
78-
7966
private void processType(Set<Entry> entries, Class<?> typeToProcess) {
8067
if (isReflective(typeToProcess)) {
8168
entries.add(createEntry(typeToProcess));

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

Lines changed: 0 additions & 95 deletions
This file was deleted.

spring-core/src/test/java/org/springframework/aot/hint/annotation/ReflectiveRuntimeHintsRegistrarTests.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,23 +86,6 @@ void shouldProcessAnnotationOnMethod() {
8686
.satisfies(methodHint -> assertThat(methodHint.getName()).isEqualTo("managed")));
8787
}
8888

89-
@Test
90-
void shouldNotRegisterAnnotationProxyIfNotNeeded() {
91-
process(SampleMethodMetaAnnotatedBean.class);
92-
RuntimeHints runtimeHints = this.runtimeHints;
93-
assertThat(runtimeHints.proxies().jdkProxies()).isEmpty();
94-
}
95-
96-
@Test
97-
@SuppressWarnings("deprecation")
98-
void shouldRegisterAnnotationProxy() {
99-
process(SampleMethodMetaAnnotatedBeanWithAlias.class);
100-
RuntimeHints runtimeHints = this.runtimeHints;
101-
assertThat(RuntimeHintsPredicates.proxies()
102-
.forInterfaces(SampleInvoker.class, org.springframework.core.annotation.SynthesizedAnnotation.class))
103-
.accepts(runtimeHints);
104-
}
105-
10689
@Test
10790
void shouldProcessAnnotationOnInterface() {
10891
process(SampleMethodAnnotatedBeanWithInterface.class);

spring-core/src/test/java/org/springframework/aot/hint/support/RuntimeHintsUtilsTests.java

Lines changed: 0 additions & 150 deletions
This file was deleted.

spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/MessagingAnnotationsRuntimeHints.java

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)