Honor default values for implicit aliases in composed annotations
Spring Framework 5.2 introduced a regression for implicit aliases declared via @AliasFor. Specifically, Spring's merged annotation algorithms stopped honoring default values for implicit alias pairs if the composed annotation was used without specifying the aliased attributes. This commit fixes this regression. Closes gh-24110
This commit is contained in:
committed by
Sam Brannen
parent
1bff7ce141
commit
6f15f32be3
@@ -368,13 +368,13 @@ class AnnotationTypeMappingsTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void resolveMirrorsWhenOnlyHasDefaultValuesResolvesNone() {
|
||||
void resolveMirrorsWhenOnlyHasDefaultValuesUsesFirst() {
|
||||
AnnotationTypeMapping mapping = AnnotationTypeMappings.forAnnotationType(
|
||||
AliasPair.class).get(0);
|
||||
Method[] resolved = resolveMirrorSets(mapping, WithDefaultValueAliasPair.class,
|
||||
AliasPair.class);
|
||||
assertThat(resolved[0]).isNull();
|
||||
assertThat(resolved[1]).isNull();
|
||||
assertThat(resolved[0].getName()).isEqualTo("a");
|
||||
assertThat(resolved[1].getName()).isEqualTo("a");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user