-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix remaining missing inline statements/annotations
- Loading branch information
1 parent
8cb7d25
commit 7fa861f
Showing
9 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
actor/src/main/mima-filters/1.1.0.backwards.excludes/java-duration-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,4 @@ | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.JavaDurationConverters#JavaDurationOps.asScala$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.JavaDurationConverters#JavaDurationOps.asScala") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.JavaDurationConverters#ScalaDurationOps.asJava$extension") | ||
ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.util.JavaDurationConverters#ScalaDurationOps.asJava") |
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
29 changes: 29 additions & 0 deletions
29
...r/src/main/scala-2.13/org/apache/pekko/dispatch/internal/SameThreadExecutionContext.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,29 @@ | ||
/* | ||
* 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, which was derived from Akka. | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package org.apache.pekko.dispatch.internal | ||
|
||
import scala.concurrent.ExecutionContext | ||
|
||
import org.apache.pekko | ||
import pekko.annotation.InternalApi | ||
|
||
/** | ||
* Factory to create same thread ec. Not intended to be called from any other site than to create [[pekko.dispatch.ExecutionContexts#parasitic]] | ||
* | ||
* INTERNAL API | ||
*/ | ||
@InternalApi | ||
private[dispatch] object SameThreadExecutionContext { | ||
@inline def apply(): ExecutionContext = ExecutionContext.parasitic | ||
} |
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
31 changes: 31 additions & 0 deletions
31
actor/src/main/scala-3/org/apache/pekko/compat/PartialFunction.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,31 @@ | ||
/* | ||
* 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, which was derived from Akka. | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package org.apache.pekko.compat | ||
|
||
import org.apache.pekko.annotation.InternalApi | ||
|
||
/** | ||
* INTERNAL API | ||
* | ||
* Compatibility wrapper for `scala.PartialFunction` to be able to compile the same code | ||
* against Scala 2.12, 2.13, 3.0 | ||
* | ||
* Remove these classes as soon as support for Scala 2.12 is dropped! | ||
*/ | ||
@InternalApi private[pekko] object PartialFunction { | ||
|
||
inline def fromFunction[A, B](f: A => B): scala.PartialFunction[A, B] = | ||
scala.PartialFunction.fromFunction(f) | ||
|
||
} |
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
38 changes: 38 additions & 0 deletions
38
actor/src/main/scala-3/org/apache/pekko/util/JavaDurationConverters.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,38 @@ | ||
/* | ||
* 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, which was derived from Akka. | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com> | ||
*/ | ||
|
||
package org.apache.pekko.util | ||
import java.time.{ Duration => JDuration } | ||
|
||
import scala.concurrent.duration.{ Duration, FiniteDuration } | ||
|
||
import org.apache.pekko.annotation.InternalStableApi | ||
|
||
/** | ||
* INTERNAL API | ||
*/ | ||
@InternalStableApi | ||
private[pekko] object JavaDurationConverters { | ||
|
||
// Ideally this should have the Scala 3 inline keyword but then Java sources are | ||
// unable to call this method, see https://github.com/lampepfl/dotty/issues/19346 | ||
def asFiniteDuration(duration: JDuration): FiniteDuration = duration.asScala | ||
|
||
final implicit class JavaDurationOps(val self: JDuration) extends AnyVal { | ||
inline def asScala: FiniteDuration = Duration.fromNanos(self.toNanos) | ||
} | ||
|
||
final implicit class ScalaDurationOps(val self: Duration) extends AnyVal { | ||
inline def asJava: JDuration = JDuration.ofNanos(self.toNanos) | ||
} | ||
} |
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