diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedMethod.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedMethod.java index 2fb34cf7f54..2efe4321aaf 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedMethod.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedMethod.java @@ -58,7 +58,7 @@ public class AnnotatedMethod { private final MethodParameter[] parameters; - private final Map, Object> annotations = new ConcurrentHashMap<>(4); + private final Map, Object> annotations; private volatile @Nullable List inheritedParameterAnnotations; @@ -73,6 +73,7 @@ public class AnnotatedMethod { this.bridgedMethod = BridgeMethodResolver.findBridgedMethod(method); ReflectionUtils.makeAccessible(this.bridgedMethod); this.parameters = initMethodParameters(); + this.annotations = new ConcurrentHashMap<>(4); } /** @@ -83,6 +84,7 @@ public class AnnotatedMethod { this.method = annotatedMethod.method; this.bridgedMethod = annotatedMethod.bridgedMethod; this.parameters = annotatedMethod.parameters; + this.annotations = annotatedMethod.annotations; this.inheritedParameterAnnotations = annotatedMethod.inheritedParameterAnnotations; }