2323import java .util .stream .Stream ;
2424
2525import org .springframework .data .util .Lazy ;
26+ import org .springframework .util .Assert ;
2627
2728/**
28- * Types managed by a Spring Data implementation. Used to predefine a set of know entities that might need processing
29- * during the Spring container, Spring Data Repository initialization phase.
29+ * Types managed by a Spring Data implementation. Used to predefine a set of known entities that might need processing
30+ * during the initialization phase.
3031 *
3132 * @author Christoph Strobl
3233 * @author John Blum
33- * @see java.lang.FunctionalInterface
3434 * @since 3.0
3535 */
3636@ FunctionalInterface
@@ -60,6 +60,8 @@ static ManagedTypes empty() {
6060 * @see #fromSupplier(Supplier)
6161 */
6262 static ManagedTypes fromIterable (Iterable <? extends Class <?>> types ) {
63+
64+ Assert .notNull (types , "Types must not be null" );
6365 return types ::forEach ;
6466 }
6567
@@ -75,6 +77,8 @@ static ManagedTypes fromIterable(Iterable<? extends Class<?>> types) {
7577 * @see #fromSupplier(Supplier)
7678 */
7779 static ManagedTypes fromStream (Stream <? extends Class <?>> types ) {
80+
81+ Assert .notNull (types , "Types must not be null" );
7882 return types ::forEach ;
7983 }
8084
@@ -88,11 +92,13 @@ static ManagedTypes fromStream(Stream<? extends Class<?>> types) {
8892 * {@link Iterable} of {@link Class types}.
8993 * @see java.util.function.Supplier
9094 * @see java.lang.Iterable
91- * @see #fromIterable(Iterable)
92- * @see #fromStream(Stream)
95+ * @see #fromIterable(Iterable)
96+ * @see #fromStream(Stream)
9397 */
9498 static ManagedTypes fromSupplier (Supplier <Iterable <Class <?>>> dataProvider ) {
9599
100+ Assert .notNull (dataProvider , "Supplier must not be null" );
101+
96102 return new ManagedTypes () {
97103
98104 final Lazy <Iterable <Class <?>>> lazyProvider = Lazy .of (dataProvider );
0 commit comments