You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2025/09/11 17:49:45 UTC

(pekko) branch 1.2.x-option created (now 9234d4162d)

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

hepin pushed a change to branch 1.2.x-option
in repository https://gitbox.apache.org/repos/asf/pekko.git


      at 9234d4162d chore: Deprecated japi.option

This branch includes the following new commits:

     new 9234d4162d chore: Deprecated japi.option

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org


(pekko) 01/01: chore: Deprecated japi.option

Posted by he...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9234d4162d1d62fdd0291b07e72a7dbf89e75c9e
Author: He-Pin <he...@gmail.com>
AuthorDate: Fri Sep 12 01:49:30 2025 +0800

    chore: Deprecated japi.option
---
 actor-tests/src/test/java/org/apache/pekko/actor/JavaAPI.java       | 1 +
 actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala            | 1 +
 .../org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala  | 6 ++++--
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/actor-tests/src/test/java/org/apache/pekko/actor/JavaAPI.java b/actor-tests/src/test/java/org/apache/pekko/actor/JavaAPI.java
index 253f0e4ffb..b903c9e44a 100644
--- a/actor-tests/src/test/java/org/apache/pekko/actor/JavaAPI.java
+++ b/actor-tests/src/test/java/org/apache/pekko/actor/JavaAPI.java
@@ -151,6 +151,7 @@ public class JavaAPI extends JUnitSuite {
   }
 
   @Test
+  @SuppressWarnings("deprecation")
   public void mustBeAbleToCreateOptionFromOptional() {
     Option<Object> empty = Util.option(Optional.ofNullable(null));
     assertTrue(empty.isEmpty());
diff --git a/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala b/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala
index 85fd954a19..f48edf6c70 100644
--- a/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala
+++ b/actor/src/main/scala/org/apache/pekko/japi/JavaAPI.scala
@@ -305,6 +305,7 @@ object Util {
 
   // TODO in case we decide to pull in scala-java8-compat methods below could be removed - https://github.com/akka/akka/issues/16247
 
+  @deprecated("This method will be removed in Pekko 2.0.0", "1.2.0")
   def option[T](jOption: java.util.Optional[T]): scala.Option[T] =
     scala.Option(jOption.orElse(null.asInstanceOf[T]))
 }
diff --git a/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala
index ca7f1e9d9f..33c6f0af49 100644
--- a/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala
+++ b/persistence/src/main/scala/org/apache/pekko/persistence/snapshot/japi/SnapshotStore.scala
@@ -28,8 +28,10 @@ abstract class SnapshotStore extends SSnapshotStore with SnapshotStorePlugin {
 
   override final def loadAsync(
       persistenceId: String,
-      criteria: SnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] =
-    doLoadAsync(persistenceId, criteria).map(option)
+      criteria: SnapshotSelectionCriteria): Future[Option[SelectedSnapshot]] = {
+    import pekko.util.OptionConverters._
+    doLoadAsync(persistenceId, criteria).map(_.toScala)
+  }
 
   override final def saveAsync(metadata: SnapshotMetadata, snapshot: Any): Future[Unit] =
     doSaveAsync(metadata, snapshot).map(_ => ())


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org