Fix introspection of annotations that use local aliased attributes
Closes gh-28528
This commit is contained in:
@@ -53,6 +53,15 @@ class RuntimeHintsUtilsTests {
|
||||
assertThat(this.hints.proxies().jdkProxies()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerAnnotationTypeWithLocalUseOfAliasForRegistersProxy() {
|
||||
RuntimeHintsUtils.registerAnnotation(this.hints, LocalMapping.class);
|
||||
assertThat(this.hints.reflection().typeHints()).singleElement()
|
||||
.satisfies(annotationHint(LocalMapping.class));
|
||||
assertThat(this.hints.proxies().jdkProxies()).singleElement()
|
||||
.satisfies(annotationProxy(LocalMapping.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void registerAnnotationTypeProxyRegistersJdkProxy() {
|
||||
RuntimeHintsUtils.registerAnnotation(this.hints, RetryInvoker.class);
|
||||
@@ -108,6 +117,19 @@ class RuntimeHintsUtilsTests {
|
||||
|
||||
}
|
||||
|
||||
@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@interface LocalMapping {
|
||||
|
||||
@AliasFor("retries")
|
||||
int value() default 0;
|
||||
|
||||
@AliasFor("value")
|
||||
int retries() default 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
Reference in New Issue
Block a user