diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java index 3f7b85ecb6..2dc5947c0b 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java @@ -1061,7 +1061,7 @@ public abstract class AnnotationUtils { return annotation; } - InvocationHandler handler = new SynthesizedAnnotationInvocationHandler(annotatedElement, annotation, + InvocationHandler handler = new SynthesizedAnnotationInvocationHandler(annotation, annotatedElement, getAttributeAliasMap(annotationType)); A synthesizedAnnotation = (A) Proxy.newProxyInstance(ClassUtils.getDefaultClassLoader(), new Class[] { (Class) annotationType, SynthesizedAnnotation.class }, handler); diff --git a/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java b/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java index 166b659287..edb26ef174 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java @@ -58,7 +58,16 @@ class SynthesizedAnnotationInvocationHandler implements InvocationHandler { private final Map aliasMap; - SynthesizedAnnotationInvocationHandler(AnnotatedElement annotatedElement, Annotation annotation, + /** + * Construct a new {@code SynthesizedAnnotationInvocationHandler}. + * + * @param annotation the annotation to synthesize + * @param annotatedElement the element that is annotated with the supplied + * annotation; may be {@code null} if unknown + * @param aliasMap the map of attribute alias pairs, declared via + * {@code @AliasFor} in the supplied annotation + */ + SynthesizedAnnotationInvocationHandler(Annotation annotation, AnnotatedElement annotatedElement, Map aliasMap) { this.annotatedElement = annotatedElement; this.annotation = annotation;