From 6608fe887d1eed19d0e7e64c9056979ae93a4ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Wi=C4=85cek?= Date: Fri, 2 Aug 2019 19:33:10 +0200 Subject: [PATCH] Added a warning to AnnotationReadingVisitorUtils. Closes 23406 --- .../type/classreading/AnnotationReadingVisitorUtils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java b/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java index 3c2ca2dc4c7f..3397069f8ca2 100644 --- a/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java +++ b/spring-core/src/main/java/org/springframework/core/type/classreading/AnnotationReadingVisitorUtils.java @@ -23,6 +23,9 @@ import java.util.Map; import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import org.springframework.asm.Type; import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.annotation.AnnotationUtils; @@ -45,6 +48,8 @@ @Deprecated abstract class AnnotationReadingVisitorUtils { + private static final Log logger = LogFactory.getLog(AnnotationReadingVisitorUtils.class); + public static AnnotationAttributes convertClassValues(Object annotatedElement, @Nullable ClassLoader classLoader, AnnotationAttributes original, boolean classValuesAsString) { @@ -94,7 +99,8 @@ else if (value instanceof Class[]) { } entry.setValue(value); } - catch (Throwable ex) { + catch (Exception ex) { + logger.warn("Cannot convert class values", ex); // Class not found - can't resolve class reference in annotation attribute. result.put(entry.getKey(), ex); }