Document @AliasFor support in AnnotatedTypeMetadata.getAnnotationAttributes()
The Javadoc for getAnnotationAttributes() states that it supports "attribute overrides on composed annotations"; however, it actually supports @AliasFor in general, including attribute aliases within a given annotation. This commit updates the Javadoc and corresponding tests to reflect that. Closes gh-31042
This commit is contained in:
@@ -214,8 +214,8 @@ class AnnotationMetadataTests {
|
||||
private void assertMetaAnnotationOverrides(AnnotationMetadata metadata) {
|
||||
AnnotationAttributes attributes = (AnnotationAttributes) metadata.getAnnotationAttributes(
|
||||
TestComponentScan.class.getName(), false);
|
||||
assertThat(attributes.getStringArray("value")).containsExactly("org.example.componentscan");
|
||||
assertThat(attributes.getStringArray("basePackages")).containsExactly("org.example.componentscan");
|
||||
assertThat(attributes.getStringArray("value")).isEmpty();
|
||||
assertThat(attributes.getClassArray("basePackageClasses")).isEmpty();
|
||||
}
|
||||
|
||||
@@ -536,8 +536,10 @@ class AnnotationMetadataTests {
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface TestComponentScan {
|
||||
|
||||
@AliasFor("basePackages")
|
||||
String[] value() default {};
|
||||
|
||||
@AliasFor("value")
|
||||
String[] basePackages() default {};
|
||||
|
||||
Class<?>[] basePackageClasses() default {};
|
||||
|
||||
Reference in New Issue
Block a user