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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ Scala has proven the most viable way to do it, as long as you keep the following

1. Use `org.apache.pekko.util.FutureConverters` to translate `Future`s to `CompletionStage`s (or vice versa).

1. Use `org.apache.pekko.util.OptionConverters` to translate `Option`s to Java `Optional`s (or vice versa).
1. Use `scala.jdk.javaapi.OptionConverters` to translate `Option`s to Java `Optional`s (or vice versa).

1. Use `org.apache.pekko.util.FunctionConverters` to translate Scala Functions to Java Functions (or vice versa).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.slf4j.event.Level

import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._
import pekko.util.OptionVal

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.slf4j.event.Level

import org.apache.pekko
import pekko.util.ccompat.JavaConverters._
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._

object LoggingEvent {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import java.util.concurrent.CompletableFuture;
import scala.Option;
import scala.concurrent.Future;
import scala.jdk.javaapi.OptionConverters;

/**
* These tests are here to ensure that methods from {@link org.apache.pekko.util.FutureConverters},
* {@link org.apache.pekko.util.JavaDurationConverters} and {@link
* org.apache.pekko.util.OptionConverters} for use within Java can be compiled from with Java
* sources. This is because methods marked with the Scala 3 inline keyword cannot be called from
* within Java (see https://github.com/lampepfl/dotty/issues/19346)
* {@link org.apache.pekko.util.JavaDurationConverters} for use within Java can be compiled from
* with Java sources. This is because methods marked with the Scala 3 inline keyword cannot be
* called from within Java (see https://github.com/lampepfl/dotty/issues/19346)
*/
public class JavaConverterScala3InlineTest {
public void compileTest() {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import pekko.annotation.InternalApi
import pekko.util.Helpers.toRootLowerCase
import pekko.util.Helpers.Requiring
import pekko.util.JavaDurationConverters._
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._

/**
* Point-to-point reliable delivery between a single producer actor sending messages and a single consumer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import pekko.actor.typed.receptionist.ServiceKey
import pekko.actor.typed.scaladsl.Behaviors
import pekko.annotation.ApiMayChange
import pekko.util.JavaDurationConverters._
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._

/**
* Work pulling is a pattern where several worker actors pull tasks in their own pace from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@ ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.japi.Option$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.japi.Option$None$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.japi.Option$Some")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.japi.Option$Some$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOption")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOption$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptional")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptional$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptionalDouble")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptionalDouble$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptionalInt")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptionalInt$")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptionalLong")
ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.util.OptionConverters$RichOptionalLong$")

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ abstract class AbstractActor extends Actor {
@throws(classOf[Exception])
@nowarn("msg=deprecated")
override def preRestart(reason: Throwable, message: Option[Any]): Unit = {
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._
preRestart(reason, message.toJava)
}

Expand All @@ -295,7 +295,7 @@ abstract class AbstractActor extends Actor {
*/
@throws(classOf[Exception])
def preRestart(reason: Throwable, message: Optional[Any]): Unit = {
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._
super.preRestart(reason, message.toScala)
}

Expand Down
2 changes: 1 addition & 1 deletion actor/src/main/scala/org/apache/pekko/actor/Actor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ final case class ActorIdentity(correlationId: Any, ref: Option[ActorRef]) {
* not defined if no actor matched the request.
*/
def getActorRef: Optional[ActorRef] = {
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._
ref.toJava
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import pekko.japi.Util.immutableSeq
import pekko.serialization.SerializationExtension
import pekko.util._
import pekko.util.FutureConverters._
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._
import pekko.util.Helpers.toRootLowerCase
import pekko.util.ccompat.JavaConverters._

Expand Down
3 changes: 2 additions & 1 deletion actor/src/main/scala/org/apache/pekko/actor/Address.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

package org.apache.pekko.actor

import java.net.MalformedURLException
import java.net.URI
import java.net.URISyntaxException
Expand All @@ -22,7 +23,7 @@ import scala.collection.immutable

import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._

/**
* The address specifies the physical location under which an Actor can be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import pekko.Done
import pekko.annotation.InternalApi
import pekko.event.Logging
import pekko.pattern.after
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._
import pekko.util.OptionVal
import pekko.util.FutureConverters._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import scala.reflect.ClassTag

import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.util.OptionConverters._
import scala.jdk.OptionConverters._

/**
* Marker supertype for a setup part that can be put inside [[pekko.actor.setup.ActorSystemSetup]], if a specific concrete setup
Expand Down
Loading