Annotate often-used Collectors method
We commonly end a Stream with
.collect(Collectors.toList());
However the returned List is not null-annotated, which means it gives a
warning if we want to save it to a @NonNull List<> reference.
It could be tempting to annotate Stream.collect() directly, however that
would be wrong: there is no guarantee that some shoddy Collector does
not return a null value.
Instead, annotate Collectors.toList(), toSet() and toCollection(), which
should cover for most common use cases.
Change-Id: I8adaf55579bf5b1cc66c5fbb122acc416a4870dc
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/59327
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
This page took 0.025641 seconds and 5 git commands to generate.