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 9cc25cd357..439cb9d124 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 @@ -364,11 +364,12 @@ public abstract class AnnotationUtils { result = searchOnInterfaces(method, annotationType, clazz.getInterfaces()); } } - } - if (result != null) { - findAnnotationCache.put(cacheKey, result); + if (result != null) { + findAnnotationCache.put(cacheKey, result); + } } + return result; }