From 2451594cdd7ba4c99536571a998e90ae6dc8d5d8 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 23 Jun 2015 18:30:47 +0200 Subject: [PATCH] Synthesize annotation arrays within AnnotationUtils Issue: SPR-11393 --- .../springframework/core/annotation/AnnotationUtils.java | 7 +++++-- 1 file changed, 5 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 1d969e2f1d..70e1080ba8 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 @@ -219,7 +219,7 @@ public abstract class AnnotationUtils { */ public static Annotation[] getAnnotations(AnnotatedElement annotatedElement) { try { - return annotatedElement.getAnnotations(); + return synthesizeAnnotationArray(annotatedElement.getAnnotations(), annotatedElement); } catch (Exception ex) { handleIntrospectionFailure(annotatedElement, ex); @@ -241,7 +241,7 @@ public abstract class AnnotationUtils { */ public static Annotation[] getAnnotations(Method method) { try { - return BridgeMethodResolver.findBridgedMethod(method).getAnnotations(); + return synthesizeAnnotationArray(BridgeMethodResolver.findBridgedMethod(method).getAnnotations(), method); } catch (Exception ex) { handleIntrospectionFailure(method, ex); @@ -1811,6 +1811,9 @@ public abstract class AnnotationUtils { this.declaredMode = declaredMode; } + /** + * @since 4.2 + */ @SuppressWarnings("unchecked") static Class resolveContainerAnnotationType(Class annotationType) { try {