fix warnings in contrib, docs, osgi, persistence and slf4j

This commit is contained in:
Roland Kuhn 2015-01-30 18:34:03 +01:00
parent 82b8238a9c
commit a029a90502
17 changed files with 116 additions and 89 deletions

View file

@ -92,7 +92,7 @@ class ActorWithMessagesWrapper {
import MyActor._
def receive = {
case Greeting(greeter) => log.info(s"I was greeted by $greeter.")
case Goodbye => log.info("Someone said goodbye to me.")
case Goodbye => log.info("Someone said goodbye to me.")
}
}
//#messages-in-companion
@ -229,7 +229,7 @@ class Consumer extends Actor with ActorLogging with ConsumerBehavior {
class ProducerConsumer extends Actor with ActorLogging
with ProducerBehavior with ConsumerBehavior {
def receive = producerBehavior orElse consumerBehavior
def receive = producerBehavior.orElse[Any, Unit](consumerBehavior)
}
// protocol

View file

@ -12,13 +12,10 @@ import akka.util.ByteString
import akka.actor.Props
import scala.collection.immutable
class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
//#fsm-code-elided
//#simple-imports
import akka.actor.{ ActorRef, FSM }
import scala.concurrent.duration._
//#simple-imports
object FSMDocSpec {
// messages and data types
//#test-code
import akka.actor.ActorRef
//#simple-events
// received events
final case class SetTarget(ref: ActorRef)
@ -38,6 +35,17 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
case object Uninitialized extends Data
final case class Todo(target: ActorRef, queue: immutable.Seq[Any]) extends Data
//#simple-state
//#test-code
}
class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
import FSMDocSpec._
//#fsm-code-elided
//#simple-imports
import akka.actor.{ ActorRef, FSM }
import scala.concurrent.duration._
//#simple-imports
//#simple-fsm
class Buncher extends FSM[State, Data] {
@ -56,6 +64,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
case Active -> Idle =>
stateData match {
case Todo(ref, queue) => ref ! Batch(queue)
case _ => // nothing to do
}
}
//#transition-elided

View file

@ -113,7 +113,8 @@ class Worker extends Actor with ActorLogging {
//#messages
object CounterService {
final case class Increment(n: Int)
case object GetCurrentCount
sealed abstract class GetCurrentCount
case object GetCurrentCount extends GetCurrentCount
final case class CurrentCount(key: String, count: Long)
class ServiceUnavailable(msg: String) extends RuntimeException(msg)
@ -176,9 +177,9 @@ class CounterService extends Actor {
for ((replyTo, msg) <- backlog) c.tell(msg, sender = replyTo)
backlog = IndexedSeq.empty
case msg @ Increment(n) => forwardOrPlaceInBacklog(msg)
case msg: Increment => forwardOrPlaceInBacklog(msg)
case msg @ GetCurrentCount => forwardOrPlaceInBacklog(msg)
case msg: GetCurrentCount => forwardOrPlaceInBacklog(msg)
case Terminated(actorRef) if Some(actorRef) == storage =>
// After 3 restarts the storage child is stopped.

View file

@ -108,7 +108,7 @@ class FaultHandlingDocSpec extends TestKit(ActorSystem("FaultHandlingDocSpec", t
}
"A supervisor" must "apply the chosen strategy for its child" in {
//#testkit
//#testkit
//#create
val supervisor = system.actorOf(Props[Supervisor], "supervisor")

View file

@ -143,7 +143,7 @@ class TypedActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
//#typed-actor-call-strict
//#typed-actor-calls
Await.result(fSquare, 3 seconds) should be(100)
Await.result(fSquare, 3.seconds) should be(100)
oSquare should be(Some(100))
@ -193,7 +193,7 @@ class TypedActorDocSpec extends AkkaSpec(Map("akka.loglevel" -> "INFO")) {
TypedActor(system).poisonPill(awesomeFooBar)
//#typed-actor-supercharge-usage
Await.result(f, 3 seconds) should be("YES")
Await.result(f, 3.seconds) should be("YES")
}
"typed router pattern" in {