-
Notifications
You must be signed in to change notification settings - Fork 678
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DATACMNS-1273 - Consider merged annotations when populating for annot…
…ation cache. We now consider property annotations as merged annotations when initially scanning for annotations in a property declaration. Composed annotations such as declared outside our code are captured correctly because they use an own type that is not queried by users of PersistentProperty. Own, revised annotations, using @AliasFor providing an alias for annotation values require merged annotation processing. Previously, annotations were cached as-is without resolving @AliasFor. This caused a later lookup via findAnnotation(…) to return the cached annotation without aliasing. Because the annotation was cached, no further lookup via AnnotatedElementUtils.findMergedAnnotation(…) was attempted. @retention(RetentionPolicy.RUNTIME) @target(value = { FIELD, METHOD }) public @interface RevisedAnnnotationWithAliasFor { @AliasFor("value") String name() default ""; @AliasFor("name") String value() default ""; } public class Person { @RevisedAnnnotationWithAliasFor(value = "spring") String firstname; } PersistentProperty firstname = … property.findAnnotation(…) returned previously @RevisedAnnnotationWithAliasFor(value = "spring", name = "") now we return @RevisedAnnnotationWithAliasFor(value = "spring", name = "spring") Original ticket: DATACMNS-981. Java 6 compatible backport of 2da5acc.
- Loading branch information
Showing
2 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters