Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnnotatedElementUtils.getMergedAnnotation does not merge deep value attributes correctly #22703

Closed
philwebb opened this issue Mar 28, 2019 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Milestone

Comments

@philwebb
Copy link
Member

Most likely related to the fix for #22654 we have another subtle regression when dealing with value attributes on meta meta-annotations.

The following test passes with 5.1 but fails with 5.2

@Test
public void testName() {
	ValueAttribute annotation = AnnotatedElementUtils
			.getMergedAnnotation(AnotherConfig.class, ValueAttribute.class);
	assertThat(annotation.value()).containsExactly("FromAliasedValueAttributeMeta");
}

@Retention(RetentionPolicy.RUNTIME)
static @interface ValueAttribute {

	String[] value();

}

@Retention(RetentionPolicy.RUNTIME)
@ValueAttribute("FromAliasedValueAttributeMeta")
static @interface AliasedValueAttributeMeta {

	@AliasFor("alias")
	String[] value() default {};

	@AliasFor("value")
	String[] alias() default {};

}

@Retention(RetentionPolicy.RUNTIME)
@AliasedValueAttributeMeta("FromAliasedValueAttributeMetaMeta")
static @interface AliasedValueAttributeMetaMeta {

}

@AliasedValueAttributeMetaMeta
static class AnotherConfig {

}
@philwebb philwebb self-assigned this Mar 28, 2019
@philwebb philwebb added type: regression A bug that is also a regression in: core Issues in core modules (aop, beans, core, context, expression) labels Mar 28, 2019
@philwebb philwebb added this to the 5.2 M1 milestone Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

1 participant