File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
spring-core/src/main/java/org/springframework/core/annotation Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -433,6 +433,16 @@ public static <A extends Annotation> Set<A> getMergedRepeatableAnnotations(
433
433
* single annotation and within annotation hierarchies.
434
434
* <p>This method follows <em>get semantics</em> as described in the
435
435
* {@linkplain AnnotatedElementUtils class-level javadoc}.
436
+ * <p><strong>WARNING</strong>: if the supplied {@code containerType} is not
437
+ * {@code null}, the search will be restricted to supporting only repeatable
438
+ * annotations whose container is the supplied {@code containerType}. This
439
+ * prevents the search from finding repeatable annotations declared as
440
+ * meta-annotations on other types of repeatable annotations. If you need to
441
+ * support such a use case, favor {@link #getMergedRepeatableAnnotations(AnnotatedElement, Class)}
442
+ * over this method or alternatively use the {@link MergedAnnotations} API
443
+ * directly in conjunction with {@link RepeatableContainers} that are
444
+ * {@linkplain RepeatableContainers#and(Class, Class) composed} to support
445
+ * multiple repeatable annotation types.
436
446
* @param element the annotated element (never {@code null})
437
447
* @param annotationType the annotation type to find (never {@code null})
438
448
* @param containerType the type of the container that holds the annotations;
You can’t perform that action at this time.
0 commit comments