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 @@ -42,6 +42,7 @@ public LazyAndFutureSourcesTest() {
4242 // note these are minimal happy path tests to cover API, more thorough tests are on the Scala side
4343
4444 @ Test
45+ @ SuppressWarnings ("deprecation" )
4546 public void future () throws Exception {
4647 CompletionStage <List <String >> result =
4748 Source .future (Future .successful ("one" )).runWith (Sink .seq (), system );
Original file line number Diff line number Diff line change @@ -322,6 +322,7 @@ object Source {
322322 *
323323 * Here for Java interoperability, the normal use from Java should be [[Source.completionStage ]]
324324 */
325+ @ deprecated(" Use 'Source.completionStage' or 'scaladsl.Source.future' instead" , " 1.5.0" )
325326 def future [T ](futureElement : Future [T ]): Source [T , NotUsed ] =
326327 scaladsl.Source .future(futureElement).asJava
327328
@@ -337,7 +338,7 @@ object Source {
337338 * If the `CompletionStage` is completed with a failure the stream is failed.
338339 */
339340 def completionStage [T ](completionStage : CompletionStage [T ]): Source [T , NotUsed ] =
340- future(completionStage.asScala)
341+ new Source (scaladsl. Source . future(completionStage.asScala) )
341342
342343 /**
343344 * 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