Committed by
Gerrit Code Review
Make the method receive a more flexible parameter
Change-Id: Icf5d0e272a6f20be40a266f276710b1cd0c144ef
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -659,8 +659,8 @@ public abstract class Tools { | ... | @@ -659,8 +659,8 @@ public abstract class Tools { |
659 | * @param <T> type of enclosed value | 659 | * @param <T> type of enclosed value |
660 | * @return optional as a stream | 660 | * @return optional as a stream |
661 | */ | 661 | */ |
662 | - public static <T> Stream<T> stream(Optional<T> optional) { | 662 | + public static <T> Stream<T> stream(Optional<? extends T> optional) { |
663 | - return optional.map(Stream::of).orElse(Stream.empty()); | 663 | + return optional.map(x -> Stream.of(x)).orElse(Stream.empty()); |
664 | } | 664 | } |
665 | 665 | ||
666 | // Auxiliary path visitor for recursive directory structure copying. | 666 | // Auxiliary path visitor for recursive directory structure copying. | ... | ... |
-
Please register or login to post a comment