-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove @inline annotations and enable Scala 2 inliner
- Loading branch information
1 parent
d829637
commit 8cb7d25
Showing
34 changed files
with
254 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
actor/src/main/mima-filters/1.1.0.backwards.excludes/future-converters.excludes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.FutureConverters#CompletionStageOps.asScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.FutureConverters#CompletionStageOps.asScala") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.FutureConverters#CompletionStageOps.asScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.FutureConverters#FutureOps.asJava$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.FutureConverters#FutureOps.asJava") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.FutureConverters#FutureOps.asJava$extension") |
30 changes: 30 additions & 0 deletions
30
actor/src/main/mima-filters/1.1.0.backwards.excludes/option-converters.excludes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJava$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJavaPrimitive$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJava") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJavaPrimitive") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJava$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOption.toJavaPrimitive$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toJavaPrimitive$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toScala") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toJavaPrimitive") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptional.toJavaPrimitive$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toJavaGeneric$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toScala") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toJavaGeneric") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalDouble.toJavaGeneric$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toJavaGeneric$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toScala") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toJavaGeneric") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalInt.toJavaGeneric$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toJavaGeneric$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toScala") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toJavaGeneric") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.OptionConverters#RichOptionalLong.toJavaGeneric$extension") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
actor/src/main/scala-3/org/apache/pekko/util/FutureConverters.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* license agreements; and to You under the Apache License, version 2.0: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* This file is part of the Apache Pekko project, derived from Akka. | ||
*/ | ||
|
||
package org.apache.pekko.util | ||
|
||
import org.apache.pekko.annotation.InternalStableApi | ||
|
||
import java.util.concurrent.CompletionStage | ||
import scala.concurrent.Future | ||
|
||
/** | ||
* INTERNAL API | ||
* | ||
* Remove this once Scala 2.12 support is dropped since all methods are in Scala 2.13+ stdlib | ||
*/ | ||
@InternalStableApi | ||
private[pekko] object FutureConverters { | ||
import scala.jdk.javaapi | ||
|
||
def asJava[T](f: Future[T]): CompletionStage[T] = javaapi.FutureConverters.asJava(f) | ||
|
||
implicit final class FutureOps[T](private val f: Future[T]) extends AnyVal { | ||
inline def asJava: CompletionStage[T] = FutureConverters.asJava(f) | ||
} | ||
|
||
def asScala[T](cs: CompletionStage[T]): Future[T] = javaapi.FutureConverters.asScala(cs) | ||
|
||
implicit final class CompletionStageOps[T](private val cs: CompletionStage[T]) extends AnyVal { | ||
inline def asScala: Future[T] = FutureConverters.asScala(cs) | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
actor/src/main/scala-3/org/apache/pekko/util/OptionConverters.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* license agreements; and to You under the Apache License, version 2.0: | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* This file is part of the Apache Pekko project, derived from Akka. | ||
*/ | ||
|
||
package org.apache.pekko.util | ||
|
||
import org.apache.pekko.annotation.InternalStableApi | ||
|
||
import java.util._ | ||
import scala.jdk.OptionShape | ||
|
||
/** | ||
* INTERNAL API | ||
* | ||
* Remove this once Scala 2.12 support is dropped since all methods are in Scala 2.13+ stdlib | ||
*/ | ||
@InternalStableApi | ||
private[pekko] object OptionConverters { | ||
|
||
inline final def toScala[A](o: Optional[A]): Option[A] = scala.jdk.javaapi.OptionConverters.toScala(o) | ||
|
||
inline def toScala(o: OptionalDouble): Option[java.lang.Double] = scala.jdk.javaapi.OptionConverters.toScala(o) | ||
|
||
inline def toScala(o: OptionalInt): Option[java.lang.Integer] = scala.jdk.javaapi.OptionConverters.toScala(o) | ||
|
||
inline def toScala(o: OptionalLong): Option[java.lang.Long] = scala.jdk.javaapi.OptionConverters.toScala(o) | ||
|
||
inline final def toJava[A](o: Option[A]): Optional[A] = scala.jdk.javaapi.OptionConverters.toJava(o) | ||
|
||
implicit final class RichOptional[A](private val o: java.util.Optional[A]) extends AnyVal { | ||
inline def toScala: Option[A] = scala.jdk.OptionConverters.RichOptional(o).toScala | ||
|
||
inline def toJavaPrimitive[O](implicit shape: OptionShape[A, O]): O = | ||
scala.jdk.OptionConverters.RichOptional(o).toJavaPrimitive | ||
} | ||
|
||
implicit final class RichOption[A](private val o: Option[A]) extends AnyVal { | ||
inline def toJava: Optional[A] = scala.jdk.OptionConverters.RichOption(o).toJava | ||
|
||
inline def toJavaPrimitive[O](implicit shape: OptionShape[A, O]): O = | ||
scala.jdk.OptionConverters.RichOption(o).toJavaPrimitive | ||
} | ||
|
||
implicit class RichOptionalDouble(private val o: OptionalDouble) extends AnyVal { | ||
|
||
/** Convert a Java `OptionalDouble` to a Scala `Option` */ | ||
inline def toScala: Option[Double] = scala.jdk.OptionConverters.RichOptionalDouble(o).toScala | ||
|
||
/** Convert a Java `OptionalDouble` to a generic Java `Optional` */ | ||
inline def toJavaGeneric: Optional[Double] = scala.jdk.OptionConverters.RichOptionalDouble(o).toJavaGeneric | ||
} | ||
|
||
/** Provides conversions from `OptionalInt` to Scala `Option` and the generic `Optional` */ | ||
implicit class RichOptionalInt(private val o: OptionalInt) extends AnyVal { | ||
|
||
/** Convert a Java `OptionalInt` to a Scala `Option` */ | ||
inline def toScala: Option[Int] = scala.jdk.OptionConverters.RichOptionalInt(o).toScala | ||
|
||
/** Convert a Java `OptionalInt` to a generic Java `Optional` */ | ||
inline def toJavaGeneric: Optional[Int] = scala.jdk.OptionConverters.RichOptionalInt(o).toJavaGeneric | ||
} | ||
|
||
/** Provides conversions from `OptionalLong` to Scala `Option` and the generic `Optional` */ | ||
implicit class RichOptionalLong(private val o: OptionalLong) extends AnyVal { | ||
|
||
/** Convert a Java `OptionalLong` to a Scala `Option` */ | ||
inline def toScala: Option[Long] = scala.jdk.OptionConverters.RichOptionalLong(o).toScala | ||
|
||
/** Convert a Java `OptionalLong` to a generic Java `Optional` */ | ||
inline def toJavaGeneric: Optional[Long] = scala.jdk.OptionConverters.RichOptionalLong(o).toJavaGeneric | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.