=act #13966 Change wrong default discardOld in UntypedActor become

(cherry picked from commit 2aada3b5a857552f9d7854a19cd72d77e6a52b9b)
This commit is contained in:
Patrik Nordwall 2014-04-29 08:29:41 +02:00
parent 164050ad4c
commit 2bf81a0e15

View file

@ -74,7 +74,7 @@ trait ActorContext extends ActorRefFactory {
* Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler.
* Replaces the current behavior on the top of the behavior stack.
*/
def become(behavior: Actor.Receive): Unit = become(behavior, true)
def become(behavior: Actor.Receive): Unit = become(behavior, discardOld = true)
/**
* Changes the Actor's behavior to become the new 'Receive' (PartialFunction[Any, Unit]) handler.
@ -528,7 +528,7 @@ private[akka] class ActorCell(
def become(behavior: Actor.Receive, discardOld: Boolean = true): Unit =
behaviorStack = behavior :: (if (discardOld && behaviorStack.nonEmpty) behaviorStack.tail else behaviorStack)
def become(behavior: Procedure[Any]): Unit = become(behavior, false)
def become(behavior: Procedure[Any]): Unit = become(behavior, discardOld = true)
def become(behavior: Procedure[Any], discardOld: Boolean): Unit =
become({ case msg behavior.apply(msg) }: Actor.Receive, discardOld)