Fix warnings in akka-actor-typed (#26738)

This commit is contained in:
Arnout Engelen 2019-04-16 15:55:36 +02:00 committed by Johan Andrén
parent 1820b982bf
commit e500dda6b7
4 changed files with 13 additions and 11 deletions

View file

@ -7,7 +7,7 @@ package akka.actor.typed.internal.adapter
import akka.actor.typed.{ LogMarker, Logger }
import akka.annotation.InternalApi
import akka.event.Logging._
import akka.event.{ LoggingBus, LoggingFilter, LoggingFilterWithMarker, LogMarker => UntypedLM }
import akka.event.{ LoggingBus, LoggingFilterWithMarker, LogMarker => UntypedLM }
import akka.util.OptionVal
import scala.collection.JavaConverters._
@ -347,8 +347,8 @@ private[akka] abstract class AbstractLogger extends Logger {
* there are more than four arguments.
*/
private def format(t: String, arg1: Any): String = arg1 match {
case a: Array[_] if !a.getClass.getComponentType.isPrimitive => formatArray(t, a: _*)
case a: Array[_] => formatArray(t, a.map(_.asInstanceOf[AnyRef]): _*)
case a: Array[_] if !a.getClass.getComponentType.isPrimitive => formatArrayImpl(t, a.toSeq)
case a: Array[_] => formatArrayImpl(t, a.map(_.asInstanceOf[AnyRef]).toSeq)
case x => formatArray(t, x)
}
private def format(t: String, arg1: Any, arg2: Any): String = formatArray(t, arg1, arg2)
@ -356,7 +356,10 @@ private[akka] abstract class AbstractLogger extends Logger {
private def format(t: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): String =
formatArray(t, arg1, arg2, arg3, arg4)
private def formatArray(t: String, arg: Any*): String = {
private def formatArray(t: String, arg: Any*): String =
formatArrayImpl(t, arg)
private def formatArrayImpl(t: String, arg: Seq[Any]): String = {
val sb = new java.lang.StringBuilder(64)
var p = 0
var startIndex = 0

View file

@ -9,7 +9,6 @@ import akka.actor.typed.Behavior.DeferredBehavior
import akka.actor.typed.internal.routing.GroupRouterBuilder
import akka.actor.typed.internal.routing.PoolRouterBuilder
import akka.actor.typed.receptionist.ServiceKey
import akka.actor.typed.scaladsl.PoolRouter
import akka.annotation.DoNotInherit
object Routers {

View file

@ -7,15 +7,15 @@ package akka.actor.typed.scaladsl
import java.util.concurrent.TimeoutException
import scala.concurrent.Future
import akka.actor.{ Address, RootActorPath, Scheduler }
import akka.actor.typed.ActorRef
import akka.actor.typed.internal.{ adapter => adapt }
import akka.annotation.InternalApi
import akka.pattern.PromiseActorRef
import akka.util.{ unused, Timeout }
import akka.util.Timeout
import akka.actor.typed.RecipientRef
import akka.actor.typed.internal.InternalRecipientRef
import com.github.ghik.silencer.silent
/**
* The ask-pattern implements the initiator side of a requestreply protocol.
@ -59,7 +59,7 @@ object AskPattern {
* Note: it is preferrable to use the non-symbolic ask method as it easier allows for wildcards for
* the `ActorRef`.
*/
def ?[U](replyTo: ActorRef[U] => T)(implicit timeout: Timeout, @unused scheduler: Scheduler): Future[U] = {
def ?[U](replyTo: ActorRef[U] => T)(implicit timeout: Timeout, scheduler: Scheduler): Future[U] = {
ask(replyTo)(timeout, scheduler)
}
@ -91,8 +91,9 @@ object AskPattern {
* // to understand the type of the wildcard
* }}}
*/
def ask[U](replyTo: ActorRef[U] => T)(implicit timeout: Timeout, @unused scheduler: Scheduler): Future[U] = {
// We do not currently use the implicit scheduler, but want to require it
@silent
def ask[U](replyTo: ActorRef[U] => T)(implicit timeout: Timeout, scheduler: Scheduler): Future[U] = {
// We do not currently use the implicit sched, but want to require it
// because it might be needed when we move to a 'native' typed runtime, see #24219
ref match {
case a: InternalRecipientRef[_] => askUntyped(a, timeout, replyTo)

View file

@ -25,7 +25,6 @@ object AkkaDisciplinePlugin extends AutoPlugin with ScalafixSupport {
"akka-camel",
"akka-contrib",
// To be reviewed
"akka-actor-typed",
"akka-actor-typed-tests",
"akka-cluster",
"akka-cluster-sharding-typed",