@@ -41,6 +41,7 @@ import pekko.stream.impl.Stages.DefaultAttributes
4141import pekko .stream .impl .fusing .{ StatefulMapConcat , ZipWithIndexJava }
4242import pekko .util ._
4343
44+ import org .jspecify .annotations .Nullable
4445import org .reactivestreams .{ Publisher , Subscriber }
4546
4647/** Java API */
@@ -537,7 +538,7 @@ object Source {
537538 def combine [T , U ](
538539 first : Source [T , _ <: Any ],
539540 second : Source [T , _ <: Any ],
540- rest : java.util.List [Source [T , _ <: Any ]],
541+ @ Nullable rest : java.util.List [Source [T , _ <: Any ]],
541542 fanInStrategy : function.Function [java.lang.Integer , _ <: Graph [UniformFanInShape [T , U ], NotUsed ]])
542543 : Source [U , NotUsed ] = {
543544 import scala .jdk .CollectionConverters ._
@@ -563,7 +564,7 @@ object Source {
563564 * @since 1.1.0
564565 */
565566 def combine [T , U , M ](
566- sources : java.util.List [_ <: Graph [SourceShape [T ], M ]],
567+ @ Nullable sources : java.util.List [_ <: Graph [SourceShape [T ], M ]],
567568 fanInStrategy : function.Function [java.lang.Integer , Graph [UniformFanInShape [T , U ], NotUsed ]])
568569 : Source [U , java.util.List [M ]] = {
569570 import pekko .util .Collections ._
@@ -578,7 +579,7 @@ object Source {
578579 /**
579580 * Combine the elements of multiple streams into a stream of lists.
580581 */
581- def zipN [T ](sources : java.util.List [Source [T , _ <: Any ]]): Source [java.util.List [T ], NotUsed ] = {
582+ def zipN [T ](@ Nullable sources : java.util.List [Source [T , _ <: Any ]]): Source [java.util.List [T ], NotUsed ] = {
582583 import scala .jdk .CollectionConverters ._
583584 val seq = if (sources ne null ) sources.asScala.map(_.asScala).toSeq else immutable.Seq ()
584585 new Source (scaladsl.Source .zipN(seq).map(_.asJava))
@@ -589,7 +590,7 @@ object Source {
589590 */
590591 def zipWithN [T , O ](
591592 zipper : function.Function [java.util.List [T ], O ],
592- sources : java.util.List [Source [T , _ <: Any ]]): Source [O , NotUsed ] = {
593+ @ Nullable sources : java.util.List [Source [T , _ <: Any ]]): Source [O , NotUsed ] = {
593594 import scala .jdk .CollectionConverters ._
594595 val seq = if (sources ne null ) sources.asScala.map(_.asScala).toSeq else immutable.Seq ()
595596 new Source (scaladsl.Source .zipWithN[T , O ](seq => zipper.apply(seq.asJava))(seq))
@@ -837,7 +838,7 @@ object Source {
837838 * '''Cancels when''' downstream cancels
838839 */
839840 def mergePrioritizedN [T ](
840- sourcesAndPriorities : java.util.List [Pair [Source [T , _ <: Any ], java.lang.Integer ]],
841+ @ Nullable sourcesAndPriorities : java.util.List [Pair [Source [T , _ <: Any ], java.lang.Integer ]],
841842 eagerComplete : Boolean ): javadsl.Source [T , NotUsed ] = {
842843 import scala .jdk .CollectionConverters ._
843844 val seq =
@@ -1618,7 +1619,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
16181619 * '''Cancels when''' downstream cancels
16191620 */
16201621 def interleaveAll (
1621- those : java.util.List [_ <: Graph [SourceShape [Out ], _ <: Any ]],
1622+ @ Nullable those : java.util.List [_ <: Graph [SourceShape [Out ], _ <: Any ]],
16221623 segmentSize : Int ,
16231624 eagerClose : Boolean ): javadsl.Source [Out , Mat ] = {
16241625 import pekko .util .Collections ._
@@ -1700,7 +1701,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
17001701 * '''Cancels when''' downstream cancels
17011702 */
17021703 def mergeAll (
1703- those : java.util.List [_ <: Graph [SourceShape [Out ], _ <: Any ]],
1704+ @ Nullable those : java.util.List [_ <: Graph [SourceShape [Out ], _ <: Any ]],
17041705 eagerComplete : Boolean ): javadsl.Source [Out , Mat ] = {
17051706 import pekko .util .Collections ._
17061707 val seq = if (those ne null ) those.collectToImmutableSeq {
@@ -4805,7 +4806,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
48054806 *
48064807 * '''Cancels when''' downstream cancels
48074808 */
4808- def log (name : String , extract : function.Function [Out , Any ], log : LoggingAdapter ): javadsl.Source [Out , Mat ] =
4809+ def log (name : String , extract : function.Function [Out , Any ], @ Nullable log : LoggingAdapter ): javadsl.Source [Out , Mat ] =
48094810 new Source (delegate.log(name, e => extract.apply(e))(log))
48104811
48114812 /**
@@ -4846,7 +4847,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
48464847 *
48474848 * '''Cancels when''' downstream cancels
48484849 */
4849- def log (name : String , log : LoggingAdapter ): javadsl.Source [Out , Mat ] =
4850+ def log (name : String , @ Nullable log : LoggingAdapter ): javadsl.Source [Out , Mat ] =
48504851 this .log(name, ConstantFun .javaIdentityFunction[Out ], log)
48514852
48524853 /**
@@ -4893,7 +4894,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
48934894 name : String ,
48944895 marker : function.Function [Out , LogMarker ],
48954896 extract : function.Function [Out , Any ],
4896- log : MarkerLoggingAdapter ): javadsl.Source [Out , Mat ] =
4897+ @ Nullable log : MarkerLoggingAdapter ): javadsl.Source [Out , Mat ] =
48974898 new Source (delegate.logWithMarker(name, e => marker.apply(e), e => extract.apply(e))(log))
48984899
48994900 /**
@@ -4940,7 +4941,7 @@ final class Source[Out, Mat](delegate: scaladsl.Source[Out, Mat]) extends Graph[
49404941 def logWithMarker (
49414942 name : String ,
49424943 marker : function.Function [Out , LogMarker ],
4943- log : MarkerLoggingAdapter ): javadsl.Source [Out , Mat ] =
4944+ @ Nullable log : MarkerLoggingAdapter ): javadsl.Source [Out , Mat ] =
49444945 this .logWithMarker(name, marker, ConstantFun .javaIdentityFunction[Out ], log)
49454946
49464947 /**
0 commit comments