Skip to content

Commit 35fcf1d

Browse files
committed
chore: Deprecate Source#future in javadsl
1 parent 1fcfc9d commit 35fcf1d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

stream-tests/src/test/java/org/apache/pekko/stream/javadsl/LazyAndFutureSourcesTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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);

stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)