8265208: [JEP-356] : SplittableRandom and SplittableGenerators - splits() methods does not throw NullPointerException when source is null

Reviewed-by: rriggs
This commit is contained in:
Jim Laskey 2021-05-10 18:52:02 +00:00
parent f78440ad43
commit 0cc7833f3d

View file

@ -2091,6 +2091,8 @@ public class RandomSupport {
@Override
public Stream<SplittableGenerator> splits(long streamSize, SplittableGenerator source) {
RandomSupport.checkStreamSize(streamSize);
Objects.requireNonNull(source, "source should be non-null");
return StreamSupport.stream(makeSplitsSpliterator(0L, streamSize, source), false);
}