From be853d466b406b7f6a66420158b5eba1de2fe267 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 2 Nov 2016 14:41:11 +0100 Subject: [PATCH] AnnotatedElementAdapter explicitly declares isAnnotationPresent method Issue: SPR-14872 (cherry picked from commit 17863df) --- .../springframework/core/convert/TypeDescriptor.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index 54e2dea432a..b51c84aace3 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -688,6 +688,16 @@ public class TypeDescriptor implements Serializable { this.annotations = annotations; } + @Override + public boolean isAnnotationPresent(Class annotationClass) { + for (Annotation annotation : getAnnotations()) { + if (annotation.annotationType() == annotationClass) { + return true; + } + } + return false; + } + @Override @SuppressWarnings("unchecked") public T getAnnotation(Class annotationClass) {