From a1fc2097a1af5451d5e0f19f55c450f1ddc1c898 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 24 May 2015 15:09:22 +0200 Subject: [PATCH] Document SynthesizedAnnotationInvocationHandler constructor Issue: SPR-11512 --- .../core/annotation/AnnotationUtils.java | 2 +- .../SynthesizedAnnotationInvocationHandler.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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;