25
25
import java .util .stream .Stream ;
26
26
27
27
import org .springframework .lang .Nullable ;
28
+ import org .springframework .util .Assert ;
28
29
29
30
/**
30
31
* Provides access to a collection of merged annotations, usually obtained
@@ -345,6 +346,8 @@ static MergedAnnotations from(AnnotatedElement element, SearchStrategy searchStr
345
346
static MergedAnnotations from (AnnotatedElement element , SearchStrategy searchStrategy ,
346
347
RepeatableContainers repeatableContainers , AnnotationFilter annotationFilter ) {
347
348
349
+ Assert .notNull (repeatableContainers , "RepeatableContainers must not be null" );
350
+ Assert .notNull (annotationFilter , "AnnotationFilter must not be null" );
348
351
return TypeMappedAnnotations .from (element , searchStrategy , repeatableContainers , annotationFilter );
349
352
}
350
353
@@ -405,6 +408,8 @@ static MergedAnnotations from(Object source, Annotation[] annotations, Repeatabl
405
408
static MergedAnnotations from (Object source , Annotation [] annotations ,
406
409
RepeatableContainers repeatableContainers , AnnotationFilter annotationFilter ) {
407
410
411
+ Assert .notNull (repeatableContainers , "RepeatableContainers must not be null" );
412
+ Assert .notNull (annotationFilter , "AnnotationFilter must not be null" );
408
413
return TypeMappedAnnotations .from (source , annotations , repeatableContainers , annotationFilter );
409
414
}
410
415
@@ -414,10 +419,9 @@ static MergedAnnotations from(Object source, Annotation[] annotations,
414
419
* {@link MergedAnnotations} instance to be created from annotations that
415
420
* are not necessarily loaded using reflection. The provided annotations
416
421
* must all be {@link MergedAnnotation#isDirectlyPresent() directly present}
417
- * and must have a {@link MergedAnnotation#getAggregateIndex() aggregate
422
+ * and must have an {@link MergedAnnotation#getAggregateIndex() aggregate
418
423
* index} of {@code 0}.
419
- * <p>
420
- * The resulting {@link MergedAnnotations} instance will contain both the
424
+ * <p>The resulting {@link MergedAnnotations} instance will contain both the
421
425
* specified annotations, and any meta-annotations that can be read using
422
426
* reflection.
423
427
* @param annotations the annotations to include
0 commit comments