Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public LazyAndFutureSourcesTest() {
// note these are minimal happy path tests to cover API, more thorough tests are on the Scala side

@Test
@SuppressWarnings("deprecation")
public void future() throws Exception {
CompletionStage<List<String>> result =
Source.future(Future.successful("one")).runWith(Sink.seq(), system);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ object Source {
*
* Here for Java interoperability, the normal use from Java should be [[Source.completionStage]]
*/
@deprecated("Use 'Source.completionStage' or 'scaladsl.Source.future' instead", "1.5.0")
def future[T](futureElement: Future[T]): Source[T, NotUsed] =
scaladsl.Source.future(futureElement).asJava

Expand All @@ -406,7 +407,7 @@ object Source {
* If the `CompletionStage` is completed with a failure the stream is failed.
*/
def completionStage[T](completionStage: CompletionStage[T]): Source[T, NotUsed] =
future(completionStage.asScala)
new Source(scaladsl.Source.future(completionStage.asScala))

/**
* Turn a `CompletionStage[Source]` into a source that will emit the values of the source when the future completes successfully.
Expand Down
Loading