This is an automated email from the ASF dual-hosted git repository.

hepin pushed a commit to branch 1.4.x-deprecateFuture
in repository https://gitbox.apache.org/repos/asf/pekko.git

commit 35fcf1dc450adeb09997754e3de6a50ec02591e4
Author: He-Pin <[email protected]>
AuthorDate: Sat Dec 6 18:05:24 2025 +0800

    chore: Deprecate Source#future in javadsl
---
 .../java/org/apache/pekko/stream/javadsl/LazyAndFutureSourcesTest.java   | 1 +
 stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala       | 1 +
 2 files changed, 2 insertions(+)

diff --git 
a/stream-tests/src/test/java/org/apache/pekko/stream/javadsl/LazyAndFutureSourcesTest.java
 
b/stream-tests/src/test/java/org/apache/pekko/stream/javadsl/LazyAndFutureSourcesTest.java
index f379b49ce0..958948ea94 100644
--- 
a/stream-tests/src/test/java/org/apache/pekko/stream/javadsl/LazyAndFutureSourcesTest.java
+++ 
b/stream-tests/src/test/java/org/apache/pekko/stream/javadsl/LazyAndFutureSourcesTest.java
@@ -43,6 +43,7 @@ public class LazyAndFutureSourcesTest extends StreamTest {
   // 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);
diff --git a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala 
b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala
index 5cc5401219..6fbf2be3d0 100755
--- a/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala
+++ b/stream/src/main/scala/org/apache/pekko/stream/javadsl/Source.scala
@@ -391,6 +391,7 @@ object Source {
    *
    * Here for Java interoperability, the normal use from Java should be 
[[Source.completionStage]]
    */
+  @deprecated("Use 'Source.completionStage' instead", "Pekko 1.4.0")
   def future[T](futureElement: Future[T]): Source[T, NotUsed] =
     scaladsl.Source.future(futureElement).asJava
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to