Skip to content

Commit

Permalink
unnecessary warn annotations breaking build
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Oct 2, 2024
1 parent c9d4a0f commit 5ac5e91
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.Duration
import scala.runtime.BoxedUnit

import scala.annotation.nowarn

import org.apache.pekko
import pekko.annotation.DoNotInherit
import pekko.japi.pf.ReceiveBuilder
Expand Down Expand Up @@ -282,7 +280,6 @@ abstract class AbstractActor extends Actor {
// TODO In Pekko 1.1.0, we can remove deprecation and make the method final
@deprecated("Override preRestart with message parameter with Optional type instead", "Akka 2.5.0")
@throws(classOf[Exception])
@nowarn("msg=deprecated")
override def preRestart(reason: Throwable, message: Option[Any]): Unit = {
import pekko.util.OptionConverters._
preRestart(reason, message.toJava)
Expand Down
4 changes: 1 addition & 3 deletions actor/src/main/scala/org/apache/pekko/actor/ActorCell.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ package org.apache.pekko.actor
import java.io.{ NotSerializableException, ObjectOutputStream }
import java.util.concurrent.ThreadLocalRandom

import scala.annotation.{ switch, tailrec }
import scala.annotation.nowarn
import scala.annotation.{ nowarn, switch, tailrec }
import scala.collection.immutable
import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.Duration
Expand Down Expand Up @@ -416,7 +415,6 @@ private[pekko] object ActorCell {
* supported APIs in this place. This is not the API you were looking
* for! (waves hand)
*/
@nowarn("msg=deprecated")
private[pekko] class ActorCell(
val system: ActorSystemImpl,
val self: InternalActorRef,
Expand Down
5 changes: 2 additions & 3 deletions actor/src/main/scala/org/apache/pekko/actor/ActorRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ package org.apache.pekko.actor

import java.util.concurrent.ConcurrentHashMap

import scala.annotation.tailrec
import scala.annotation.nowarn
import scala.annotation.tailrec
import scala.collection.immutable
import scala.util.control.NonFatal

Expand Down Expand Up @@ -114,7 +114,6 @@ object ActorRef {
* about the exact actor incarnation you can use the ``ActorPath`` as key because
* the unique id of the actor is not taken into account when comparing actor paths.
*/
@nowarn("msg=deprecated")
abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable {
scalaRef: InternalActorRef with ActorRefScope =>

Expand Down Expand Up @@ -261,7 +260,7 @@ private[pekko] trait RepointableRef extends ActorRefScope {
* Internal trait for assembling all the functionality needed internally on
* ActorRefs. NOTE THAT THIS IS NOT A STABLE EXTERNAL INTERFACE!
*
* DO NOT USE THIS UNLESS INTERNALLY WITHIN AKKA!
* DO NOT USE THIS UNLESS INTERNALLY WITHIN PEKKO!
*/
@nowarn("msg=deprecated")
@InternalApi private[pekko] abstract class InternalActorRef extends ActorRef with ScalaActorRef { this: ActorRefScope =>
Expand Down
1 change: 0 additions & 1 deletion actor/src/main/scala/org/apache/pekko/actor/Deployer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ abstract class LocalScope extends Scope
* which do not set a different scope. It is also the only scope handled by
* the LocalActorRefProvider.
*/
@nowarn("msg=@SerialVersionUID has no effect")
@SerialVersionUID(1L)
case object LocalScope extends LocalScope {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import java.io.Closeable
import java.util.concurrent.ThreadFactory
import java.util.concurrent.atomic.{ AtomicLong, AtomicReference }

import scala.annotation.{ nowarn, tailrec }
import scala.annotation.tailrec
import scala.collection.immutable
import scala.concurrent.{ Await, ExecutionContext, Future, Promise }
import scala.concurrent.duration._
Expand Down Expand Up @@ -350,7 +350,6 @@ class LightArrayRevolverScheduler(config: Config, log: LoggingAdapter, threadFac
}

object LightArrayRevolverScheduler {
@nowarn("msg=deprecated")
private[this] val taskOffset = unsafe.objectFieldOffset(classOf[TaskHolder].getDeclaredField("task"))

private class TaskQueue extends AbstractNodeQueue[TaskHolder]
Expand Down
5 changes: 1 addition & 4 deletions actor/src/main/scala/org/apache/pekko/actor/Scheduler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ package org.apache.pekko.actor

import java.util.concurrent.atomic.AtomicReference

import scala.annotation.nowarn
import scala.annotation.tailrec
import scala.annotation.{ nowarn, tailrec }
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import scala.util.control.NoStackTrace
Expand Down Expand Up @@ -145,7 +144,6 @@ trait Scheduler {
*
* Note: For scheduling within actors `with Timers` should be preferred.
*/
@nowarn("msg=deprecated")
final def scheduleWithFixedDelay(
initialDelay: FiniteDuration,
delay: FiniteDuration,
Expand Down Expand Up @@ -342,7 +340,6 @@ trait Scheduler {
"Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as " +
"scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred.",
since = "Akka 2.6.0")
@nowarn("msg=deprecated")
final def schedule(initialDelay: FiniteDuration, interval: FiniteDuration, receiver: ActorRef, message: Any)(
implicit
executor: ExecutionContext,
Expand Down
3 changes: 0 additions & 3 deletions actor/src/main/scala/org/apache/pekko/actor/TypedActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
*
* Java API
*/
@nowarn("msg=deprecated")
def get(context: ActorContext): TypedActorFactory = apply(context)

/**
Expand Down Expand Up @@ -297,7 +296,6 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
}
}

@nowarn("msg=deprecated")
override def postStop(): Unit =
try {
withContext {
Expand Down Expand Up @@ -516,7 +514,6 @@ object TypedActor extends ExtensionId[TypedActorExtension] with ExtensionIdProvi
case some => toTypedActorInvocationHandler(some)
}

@nowarn("msg=deprecated")
def toTypedActorInvocationHandler(system: ActorSystem): TypedActorInvocationHandler =
new TypedActorInvocationHandler(pekko.actor.TypedActor(system), new AtomVar[ActorRef](actor),
new Timeout(timeout))
Expand Down
1 change: 0 additions & 1 deletion actor/src/main/scala/org/apache/pekko/io/Dns.scala
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ object Dns extends ExtensionId[DnsExt] with ExtensionIdProvider {
* trigger a resolve and return None.
*/
@deprecated("use resolve(DnsProtocol.Resolve)", "Akka 2.6.0")
@nowarn("msg=deprecated")
def resolve(name: String)(system: ActorSystem, sender: ActorRef): Option[Resolved] = {
Dns(system).cache.resolve(name)(system, sender)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
package org.apache.pekko.io.dns.internal

import java.net.{ InetAddress, InetSocketAddress }
import scala.annotation.tailrec
import scala.collection.{ immutable => im }
import scala.concurrent.duration._
import scala.util.Try
import scala.annotation.{ nowarn, tailrec }
import org.apache.pekko
import pekko.actor.{ Actor, ActorLogging, ActorRef, NoSerializationVerificationNeeded, Props, Stash }
import pekko.actor.Status.Failure
Expand Down Expand Up @@ -90,7 +90,6 @@ import pekko.pattern.{ BackoffOpts, BackoffSupervisor }
/**
* Silent to allow map update syntax
*/
@nowarn()
def ready(socket: ActorRef): Receive = {
case DropRequest(msg) =>
inflightRequests.get(msg.id).foreach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ package org.apache.pekko.routing

import java.util.concurrent.ThreadLocalRandom

import scala.annotation.tailrec
import scala.annotation.{ nowarn, tailrec }
import scala.collection.immutable

import scala.annotation.nowarn
import com.typesafe.config.Config

import org.apache.pekko
Expand Down Expand Up @@ -93,7 +92,6 @@ class SmallestMailboxRoutingLogic extends RoutingLogic {
}

// TODO should we rewrite this not to use isTerminated?
@nowarn("msg=deprecated")
protected def isTerminated(a: Routee): Boolean = a match {
case ActorRefRoutee(ref) => ref.isTerminated
case _ => false
Expand Down Expand Up @@ -191,7 +189,6 @@ class SmallestMailboxRoutingLogic extends RoutingLogic {
* @param routerDispatcher dispatcher to use for the router head actor, which handles
* supervision, death watch and router management messages
*/
@nowarn("msg=@SerialVersionUID has no effect")
@SerialVersionUID(1L)
final case class SmallestMailboxPool(
nrOfInstances: Int,
Expand Down

0 comments on commit 5ac5e91

Please sign in to comment.