replace unicode arrows

* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
This commit is contained in:
Patrik Nordwall 2019-02-09 15:25:39 +01:00
parent e4d38f92a4
commit 5c96a5f556
1521 changed files with 18846 additions and 18786 deletions

View file

@ -192,7 +192,7 @@ import akka.stream.snapshot._
val log: LoggingAdapter,
val logics: Array[GraphStageLogic], // Array of stage logics
val connections: Array[GraphInterpreter.Connection],
val onAsyncInput: (GraphStageLogic, Any, Promise[Done], (Any) Unit) Unit,
val onAsyncInput: (GraphStageLogic, Any, Promise[Done], (Any) => Unit) => Unit,
val fuzzingMode: Boolean,
val context: ActorRef) {
@ -210,7 +210,7 @@ import akka.stream.snapshot._
private[this] var runningStages = logics.length
// Counts how many active connections a stage has. Once it reaches zero, the stage is automatically stopped.
private[this] val shutdownCounter = Array.tabulate(logics.length) { i
private[this] val shutdownCounter = Array.tabulate(logics.length) { i =>
logics(i).handlers.length
}
@ -229,7 +229,7 @@ import akka.stream.snapshot._
private[this] var chasedPull: Connection = NoEvent
private def queueStatus: String = {
val contents = (queueHead until queueTail).map(idx {
val contents = (queueHead until queueTail).map(idx => {
val conn = eventQueue(idx & mask)
conn
})
@ -290,7 +290,7 @@ import akka.stream.snapshot._
logic.beforePreStart()
logic.preStart()
} catch {
case NonFatal(e)
case NonFatal(e) =>
log.error(e, "Error during preStart in [{}]: {}", logic.originalStage.getOrElse(logic), e.getMessage)
logic.failStage(e)
}
@ -324,7 +324,7 @@ import akka.stream.snapshot._
private def outLogicName(connection: Connection): String = logics(connection.outOwner.stageId).toString
private def shutdownCounters: String =
shutdownCounter.map(x if (x >= KeepGoingFlag) s"${x & KeepGoingMask}(KeepGoing)" else x.toString).mkString(",")
shutdownCounter.map(x => if (x >= KeepGoingFlag) s"${x & KeepGoingMask}(KeepGoing)" else x.toString).mkString(",")
/**
* Executes pending events until the given limit is met. If there were remaining events, isSuspended will return
@ -346,8 +346,8 @@ import akka.stream.snapshot._
if (activeStage == null) throw e
else {
val loggingEnabled = activeStage.attributes.get[LogLevels] match {
case Some(levels) levels.onFailure != LogLevels.Off
case None true
case Some(levels) => levels.onFailure != LogLevels.Off
case None => true
}
if (loggingEnabled)
log.error(e, "Error in stage [{}]: {}", activeStage.originalStage.getOrElse(activeStage), e.getMessage)
@ -373,7 +373,7 @@ import akka.stream.snapshot._
*/
try processEvent(connection)
catch {
case NonFatal(e) reportStageError(e)
case NonFatal(e) => reportStageError(e)
}
afterStageHasRun(activeStage)
@ -406,7 +406,7 @@ import akka.stream.snapshot._
chasedPush = NoEvent
try processPush(connection)
catch {
case NonFatal(e) reportStageError(e)
case NonFatal(e) => reportStageError(e)
}
afterStageHasRun(activeStage)
}
@ -417,7 +417,7 @@ import akka.stream.snapshot._
chasedPull = NoEvent
try processPull(connection)
catch {
case NonFatal(e) reportStageError(e)
case NonFatal(e) => reportStageError(e)
}
afterStageHasRun(activeStage)
}
@ -438,7 +438,7 @@ import akka.stream.snapshot._
eventsRemaining
}
def runAsyncInput(logic: GraphStageLogic, evt: Any, promise: Promise[Done], handler: (Any) Unit): Unit =
def runAsyncInput(logic: GraphStageLogic, evt: Any, promise: Promise[Done], handler: (Any) => Unit): Unit =
if (!isStageCompleted(logic)) {
if (GraphInterpreter.Debug) println(s"$Name ASYNC $evt ($handler) [$logic]")
val currentInterpreterHolder = _currentInterpreter.get()
@ -453,7 +453,7 @@ import akka.stream.snapshot._
logic.onFeedbackDispatched()
}
} catch {
case NonFatal(ex)
case NonFatal(ex) =>
if (promise ne GraphStageLogic.NoPromise) {
promise.failure(ex)
logic.onFeedbackDispatched()
@ -567,7 +567,7 @@ import akka.stream.snapshot._
logic.postStop()
logic.afterPostStop()
} catch {
case NonFatal(e)
case NonFatal(e) =>
log.error(e, s"Error during postStop in [{}]: {}", logic.originalStage.getOrElse(logic), e.getMessage)
}
}
@ -645,21 +645,21 @@ import akka.stream.snapshot._
def toSnapshot: RunningInterpreter = {
val logicSnapshots = logics.zipWithIndex.map {
case (logic, idx)
case (logic, idx) =>
val label = logic.originalStage.getOrElse(logic).toString
LogicSnapshotImpl(idx, label, logic.attributes)
}
val logicIndexes = logics.zipWithIndex.map { case (stage, idx) stage idx }.toMap
val logicIndexes = logics.zipWithIndex.map { case (stage, idx) => stage -> idx }.toMap
val connectionSnapshots = connections.filter(_ != null)
.map { connection
.map { connection =>
ConnectionSnapshotImpl(
connection.id,
logicSnapshots(logicIndexes(connection.inOwner)),
logicSnapshots(logicIndexes(connection.outOwner)),
connection.portState match {
case InReady ConnectionSnapshot.ShouldPull
case OutReady ConnectionSnapshot.ShouldPush
case x if (x | InClosed | OutClosed) == (InClosed | OutClosed) ConnectionSnapshot.Closed
case InReady => ConnectionSnapshot.ShouldPull
case OutReady => ConnectionSnapshot.ShouldPush
case x if (x | InClosed | OutClosed) == (InClosed | OutClosed) => ConnectionSnapshot.Closed
}
)
}
@ -669,7 +669,7 @@ import akka.stream.snapshot._
connectionSnapshots.toVector,
queueStatus,
runningStages,
shutdownCounter.toList.map(n logicSnapshots(n)))
shutdownCounter.toList.map(n => logicSnapshots(n)))
}
}