Skip to content

Commit

Permalink
Reformat with 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg committed Mar 6, 2017
1 parent 168261c commit 0173d90
Show file tree
Hide file tree
Showing 844 changed files with 8,473 additions and 6,534 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class ActorDSLSpec extends AkkaSpec {
"support watch" in {
//#watch
val target = // some actor
//#watch
actor(new Act {})
//#watch
actor(new Act {})
//#watch
val i = inbox()
i watch target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ class ActorMailboxSpec(conf: Config)
val q = expectMsgType[MessageQueue]
types foreach
(t
assert(
t isInstance q,
s"Type [${q.getClass.getName}] is not assignable to [${t.getName}]"))
assert(
t isInstance q,
s"Type [${q.getClass.getName}] is not assignable to [${t.getName}]"))
q
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ object ActorSystemSpec {
case n: Int
master = sender()
terminaters = Set() ++
(for (i 1 to n) yield {
(for (i 1 to n) yield {
val man =
context.watch(context.system.actorOf(Props[Terminater]))
man ! "run"
Expand Down Expand Up @@ -343,10 +343,10 @@ class ActorSystemSpec

created filter
(ref
!ref.isTerminated && !ref
.asInstanceOf[ActorRefWithCell]
.underlying
.isInstanceOf[UnstartedCell]) should ===(Seq.empty[ActorRef])
!ref.isTerminated && !ref
.asInstanceOf[ActorRefWithCell]
.underlying
.isInstanceOf[UnstartedCell]) should ===(Seq.empty[ActorRef])
}

"shut down when /user fails" in {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ class TcpConnectionSpec extends AkkaSpec("""
val writer = TestProbe()
val compoundWrite =
Write(ByteString("test1"), Ack(1)) +: Write(ByteString("test2")) +: Write(
ByteString.empty,
Ack(3)) +: Write(ByteString("test4"), Ack(4))
ByteString.empty,
Ack(3)) +: Write(ByteString("test4"), Ack(4))

// reply to write commander with Ack
val buffer = ByteBuffer.allocate(100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,11 @@ class ByteStringSpec extends WordSpec with Matchers with Checkers {
"function like a VectorBuilder" when {
"adding various contents using ++= and +=" in {
check {
(array1: Array[Byte], array2: Array[Byte], bs1: ByteString,
bs2: ByteString, bs3: ByteString)
(array1: Array[Byte],
array2: Array[Byte],
bs1: ByteString,
bs2: ByteString,
bs3: ByteString)
likeVecBld { builder
builder ++= array1
bs1 foreach { b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,8 @@ private[akka] class ActorCell(

def become(behavior: Actor.Receive, discardOld: Boolean = true): Unit =
behaviorStack = behavior ::
(if (discardOld && behaviorStack.nonEmpty) behaviorStack.tail
else behaviorStack)
(if (discardOld && behaviorStack.nonEmpty) behaviorStack.tail
else behaviorStack)

def become(behavior: Procedure[Any]): Unit =
become(behavior, discardOld = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ object ActorSelection {
else {
val m = sel.copy(elements = iter.toVector,
wildcardFanOut = sel.wildcardFanOut ||
matchingChildren.size > 1)
matchingChildren.size > 1)
matchingChildren.foreach(
c
deliverSelection(c.asInstanceOf[InternalActorRef],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ case class AllForOneStrategy(maxNrOfRetries: Int = -1,
children.forall(_.requestRestartPermission(retriesWindow)))
children foreach
(crs
restartChild(crs.child,
cause,
suspendFirst = (crs.child != child)))
restartChild(crs.child,
cause,
suspendFirst = (crs.child != child)))
else for (c children) context.stop(c.child)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,21 +311,21 @@ private[akka] trait Children { this: ActorCell ⇒
val ser = SerializationExtension(cell.system)
props.args forall
(arg
arg == null ||
arg.isInstanceOf[NoSerializationVerificationNeeded] || {
val o = arg.asInstanceOf[AnyRef]
val serializer = ser.findSerializerFor(o)
val bytes = serializer.toBinary(o)
serializer match {
case ser2: SerializerWithStringManifest
val manifest = ser2.manifest(o)
ser
.deserialize(bytes, serializer.identifier, manifest)
.get != null
case _
ser.deserialize(bytes, arg.getClass).get != null
}
})
arg == null ||
arg.isInstanceOf[NoSerializationVerificationNeeded] || {
val o = arg.asInstanceOf[AnyRef]
val serializer = ser.findSerializerFor(o)
val bytes = serializer.toBinary(o)
serializer match {
case ser2: SerializerWithStringManifest
val manifest = ser2.manifest(o)
ser
.deserialize(bytes, serializer.identifier, manifest)
.get != null
case _
ser.deserialize(bytes, arg.getClass).get != null
}
})
} catch {
case NonFatal(e)
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ private[akka] trait FaultHandling { this: ActorCell ⇒
// only after parent is up and running again do restart the children which were not stopped
survivors foreach
(child
try child.asInstanceOf[InternalActorRef].restart(cause)
catch handleNonFatalOrInterruptedException { e
publish(
Error(e,
self.path.toString,
clazz(freshActor),
"restarting " + child))
})
try child.asInstanceOf[InternalActorRef].restart(cause)
catch handleNonFatalOrInterruptedException { e
publish(
Error(e,
self.path.toString,
clazz(freshActor),
"restarting " + child))
})
} catch handleNonFatalOrInterruptedException { e
clearActorFields(actor, recreate = false) // in order to prevent preRestart() from happening again
handleInvokeFailure(survivors, new PostRestartException(self, e, cause))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ final case class ThreadPoolConfigBuilder(config: ThreadPoolConfig) {
queue: BlockingQueue[Runnable]): ThreadPoolConfigBuilder =
withNewThreadPoolWithCustomBlockingQueue(reusableQueue(queue))

def withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity: ThreadPoolConfigBuilder =
def withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity
: ThreadPoolConfigBuilder =
this.copy(config = config.copy(queueFactory = linkedBlockingQueue()))

def withNewThreadPoolWithLinkedBlockingQueueWithCapacity(
Expand Down
9 changes: 2 additions & 7 deletions repos/akka/akka-actor/src/main/scala/akka/io/TcpManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,12 @@ private[io] class TcpManager(tcp: TcpExt)
val commander =
sender() // cache because we create a function that will run asynchly
(registry
Props(classOf[TcpOutgoingConnection], tcp, registry, commander, c))
Props(classOf[TcpOutgoingConnection], tcp, registry, commander, c))

case b: Bind
val commander =
sender() // cache because we create a function that will run asynchly
(registry
Props(classOf[TcpListener],
selectorPool,
tcp,
registry,
commander,
b))
Props(classOf[TcpListener], selectorPool, tcp, registry, commander, b))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ object ByteString {
/** Java API */
def createBuilder: ByteStringBuilder = new ByteStringBuilder

implicit val canBuildFrom: CanBuildFrom[TraversableOnce[Byte],
Byte,
ByteString] =
implicit val canBuildFrom
: CanBuildFrom[TraversableOnce[Byte], Byte, ByteString] =
new CanBuildFrom[TraversableOnce[Byte], Byte, ByteString] {
def apply(ignore: TraversableOnce[Byte]): ByteStringBuilder = newBuilder
def apply(): ByteStringBuilder = newBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ trait Consumer extends Actor with CamelSupport {
* return a custom route definition handler. The [[akka.dispatch.Mapper]] is not allowed to close over 'this', meaning it is
* not allowed to refer to the actor instance itself, since that can easily cause concurrent shared state issues.
*/
def getRouteDefinitionHandler: Mapper[RouteDefinition,
ProcessorDefinition[_]] =
def getRouteDefinitionHandler
: Mapper[RouteDefinition, ProcessorDefinition[_]] =
identityRouteMapper
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private[metrics] final case class MetricsGossip(nodes: Set[NodeMetrics]) {
case Some(existingNodeMetrics)
copy(
nodes = nodes - existingNodeMetrics +
(existingNodeMetrics update newNodeMetrics))
(existingNodeMetrics update newNodeMetrics))
case None copy(nodes = nodes + newNodeMetrics)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ class MessageSerializer(val system: ExtendedActorSystem)
val allNodeMetrics = envelope.gossip.nodes
val allAddresses: Vector[Address] = allNodeMetrics.map(_.address)(breakOut)
val addressMapping = allAddresses.zipWithIndex.toMap
val allMetricNames: Vector[String] = allNodeMetrics
.foldLeft(Set.empty[String])((s, n)
s ++ n.metrics.iterator.map(_.name))
.toVector
val allMetricNames: Vector[String] =
allNodeMetrics
.foldLeft(Set.empty[String])((s, n)
s ++ n.metrics.iterator.map(_.name))
.toVector
val metricNamesMapping = allMetricNames.zipWithIndex.toMap
def mapAddress(address: Address) =
mapWithErrorMessage(addressMapping, address, "address")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class EWMASpec
// wait a while between each message to give the metrics a chance to change
Thread.sleep(100)
usedMemory = usedMemory ++ Array.fill(1024)(
ThreadLocalRandom.current.nextInt(127).toByte)
ThreadLocalRandom.current.nextInt(127).toByte)
val changes = collector.sample.metrics.flatMap { latest
streamingDataSet.get(latest.name) match {
case None Some(latest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ class MetricsCollectorSpec
val merged12 =
sample2 flatMap
(latest
sample1 collect {
case peer if latest sameAs peer
val m = peer :+ latest
m.value should ===(latest.value)
m.isSmooth should ===(peer.isSmooth || latest.isSmooth)
m
})
sample1 collect {
case peer if latest sameAs peer
val m = peer :+ latest
m.value should ===(latest.value)
m.isSmooth should ===(peer.isSmooth || latest.isSmooth)
m
})

val sample3 = collector.sample.metrics
val sample4 = collector.sample.metrics
val merged34 =
sample4 flatMap
(latest
sample3 collect {
case peer if latest sameAs peer
val m = peer :+ latest
m.value should ===(latest.value)
m.isSmooth should ===(peer.isSmooth || latest.isSmooth)
m
})
sample3 collect {
case peer if latest sameAs peer
val m = peer :+ latest
m.value should ===(latest.value)
m.isSmooth should ===(peer.isSmooth || latest.isSmooth)
m
})
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ abstract class ClusterShardingSpec(config: ClusterShardingSpecConfig)
entityProps = qualifiedCounterProps(typeName),
settings = settings,
coordinatorPath = "/user/" +
typeName + "Coordinator/singleton/coordinator",
typeName + "Coordinator/singleton/coordinator",
extractEntityId = extractEntityId,
extractShardId = extractShardId,
handOffStopMessage = PoisonPill
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ class DistributedPubSubMediator(settings: DistributedPubSubSettings)
registry +=
(selfAddress -> bucket.copy(version = v,
content = bucket.content +
(key -> ValueHolder(v, valueOption))))
(key -> ValueHolder(v, valueOption))))
}

def getCurrentTopics(): Set[String] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ object ClusterSingletonManager {

def handleInitial(state: CurrentClusterState): Unit = {
membersByAge = immutable.SortedSet.empty(ageOrdering) union state.members
.filter(
m
(m.status == MemberStatus.Up ||
m.status == MemberStatus.Leaving) && matchingRole(m))
.filter(
m
(m.status == MemberStatus.Up ||
m.status == MemberStatus.Leaving) && matchingRole(m))
val safeToBeOldest = !state.members.exists { m
(m.status == MemberStatus.Down || m.status == MemberStatus.Exiting)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ final class ClusterSingletonProxy(singletonManagerPath: String,
def handleInitial(state: CurrentClusterState): Unit = {
trackChange { ()
membersByAge = immutable.SortedSet.empty(ageOrdering) union state.members
.collect {
.collect {
case m if m.status == MemberStatus.Up && matchingRole(m) m
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ private[cluster] class ClusterCoreDaemon(publisher: ActorRef)
// is only used for comparing age of current cluster members (Member.isOlderThan)
val youngest = localGossip.youngestMember
upNumber = 1 +
(if (youngest.upNumber == Int.MaxValue) 0
else youngest.upNumber)
(if (youngest.upNumber == Int.MaxValue) 0
else youngest.upNumber)
} else {
upNumber += 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private[cluster] final case class ClusterHeartbeatSenderState(
if (newState.oldReceiversNowUnreachable(node))
newState.copy(
oldReceiversNowUnreachable = newState.oldReceiversNowUnreachable -
node)
node)
else newState
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private[cluster] final case class MetricsGossip(nodes: Set[NodeMetrics]) {
case Some(existingNodeMetrics)
copy(
nodes = nodes - existingNodeMetrics +
(existingNodeMetrics merge newNodeMetrics))
(existingNodeMetrics merge newNodeMetrics))
case None copy(nodes = nodes + newNodeMetrics)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private[akka] class ClusterReadView(cluster: Cluster) extends Closeable {
case MemberRemoved(member, _)
_state = _state.copy(members = _state.members - member,
unreachable = _state.unreachable -
member)
member)
case UnreachableMember(member)
// replace current member with new member (might have different status, only address is used in equals)
_state = _state.copy(
Expand All @@ -79,7 +79,7 @@ private[akka] class ClusterReadView(cluster: Cluster) extends Closeable {
_state.unreachable - event.member + event.member
else _state.unreachable
_state = _state.copy(members = _state.members -
event.member + event.member,
event.member + event.member,
unreachable = newUnreachable)
case LeaderChanged(leader)
_state = _state.copy(leader = leader)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ object MemberStatus {
/**
* INTERNAL API
*/
private[cluster] val allowedTransitions: Map[MemberStatus, Set[MemberStatus]] =
private[cluster] val allowedTransitions
: Map[MemberStatus, Set[MemberStatus]] =
Map(
Joining -> Set(WeaklyUp, Up, Down, Removed),
WeaklyUp -> Set(Up, Down, Removed),
Expand Down
Loading

0 comments on commit 0173d90

Please sign in to comment.