mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 18:14:38 +02:00
8265208: [JEP-356] : SplittableRandom and SplittableGenerators - splits() methods does not throw NullPointerException when source is null
Reviewed-by: rriggs
This commit is contained in:
parent
f78440ad43
commit
0cc7833f3d
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue