Skip to content

Commit

Permalink
Add warning to AnnotatedElementUtils.getMergedRepeatableAnnotations()
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Oct 11, 2022
1 parent 332b25b commit 5ac687f
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -433,6 +433,16 @@ public static <A extends Annotation> Set<A> getMergedRepeatableAnnotations(
* single annotation and within annotation hierarchies.
* <p>This method follows <em>get semantics</em> as described in the
* {@linkplain AnnotatedElementUtils class-level javadoc}.
* <p><strong>WARNING</strong>: if the supplied {@code containerType} is not
* {@code null}, the search will be restricted to supporting only repeatable
* annotations whose container is the supplied {@code containerType}. This
* prevents the search from finding repeatable annotations declared as
* meta-annotations on other types of repeatable annotations. If you need to
* support such a use case, favor {@link #getMergedRepeatableAnnotations(AnnotatedElement, Class)}
* over this method or alternatively use the {@link MergedAnnotations} API
* directly in conjunction with {@link RepeatableContainers} that are
* {@linkplain RepeatableContainers#and(Class, Class) composed} to support
* multiple repeatable annotation types.
* @param element the annotated element (never {@code null})
* @param annotationType the annotation type to find (never {@code null})
* @param containerType the type of the container that holds the annotations;
Expand Down

0 comments on commit 5ac687f

Please sign in to comment.