spring-framework/spring-core
Phillip Webb ad543dbee3 Use mapped annotation values when resolving mirrors
Update `TypeMappedAnnotation` mirror resolution logic so that mapped
annotation values are also considered. Prior to this commit, mirrors
in more complex meta-annotation scenarios would not resolve correctly.

Specifically, given the following:

 @interface TestAliased {

 	@AliasFor(attribute = "qualifier")
 	String value() default "";

 	@AliasFor(attribute = "value")
 	String qualifier() default "";
 }

 @TestAliased
 @interface TestMetaAliased {

 	@AliasFor(annotation = Aliased.class, attribute = "value")
 	String value() default "";
 }

 @TestMetaAliased("test")
 @interface TestComposed {
 }

A merged `@TestAliased` annotation obtained from a `@TestComposed`
root annotation would return a `value` and `qualifier` of "".

This was because the "value" and "qualifier" mirrors needed to be
resolved against the `@TestMetaAliased` meta-annotation. They cannot be
resolved against the declared `@TestComposed` annotation because it
does not have any attributes. Our previous tests only covered a single
depth scenario where `@TestMetaAliased` was used directly on the
annotated element.

Closes gh-23767
Co-authored-by: Sam Brannen <sbrannen@pivotal.io>
2019-10-21 21:57:30 -07:00
..
kotlin-coroutines Upgrade to Coroutines 1.3.2 2019-09-25 21:51:04 +02:00
src Use mapped annotation values when resolving mirrors 2019-10-21 21:57:30 -07:00
spring-core.gradle Use dependency management in Framework build 2019-09-02 18:01:09 +02:00