File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
stream-tests/src/test/java/org/apache/pekko/stream/javadsl
stream/src/main/scala/org/apache/pekko/stream/javadsl Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ public LazyAndFutureSourcesTest() {
4343 // note these are minimal happy path tests to cover API, more thorough tests are on the Scala side
4444
4545 @ Test
46+ @ SuppressWarnings ("deprecation" )
4647 public void future () throws Exception {
4748 CompletionStage <List <String >> result =
4849 Source .future (Future .successful ("one" )).runWith (Sink .seq (), system );
Original file line number Diff line number Diff line change @@ -391,6 +391,7 @@ object Source {
391391 *
392392 * Here for Java interoperability, the normal use from Java should be [[Source.completionStage ]]
393393 */
394+ @ deprecated(" Use 'Source.completionStage' instead" , " Pekko 1.4.0" )
394395 def future [T ](futureElement : Future [T ]): Source [T , NotUsed ] =
395396 scaladsl.Source .future(futureElement).asJava
396397
@@ -406,7 +407,7 @@ object Source {
406407 * If the `CompletionStage` is completed with a failure the stream is failed.
407408 */
408409 def completionStage [T ](completionStage : CompletionStage [T ]): Source [T , NotUsed ] =
409- future(completionStage.asScala)
410+ new Source (scaladsl. Source . future(completionStage.asScala) )
410411
411412 /**
412413 * Turn a `CompletionStage[Source]` into a source that will emit the values of the source when the future completes successfully.
You can’t perform that action at this time.
0 commit comments