From da80502ea6ed4860f5bf7b668300644cdfe3bb5a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 11 Apr 2018 12:50:27 +0200 Subject: [PATCH] AnnotationUtils.getAnnotation non-null check for synthesizeAnnotation Issue: SPR-16708 --- .../org/springframework/core/annotation/AnnotationUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 ab7c0899cd..54b64dbaac 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 @@ -166,7 +166,8 @@ public abstract class AnnotationUtils { } Class annotatedElement = annotation.annotationType(); try { - return synthesizeAnnotation(annotatedElement.getAnnotation(annotationType), annotatedElement); + A metaAnn = annotatedElement.getAnnotation(annotationType); + return (metaAnn != null ? synthesizeAnnotation(metaAnn, annotatedElement) : null); } catch (Throwable ex) { handleIntrospectionFailure(annotatedElement, ex);