diff --git a/repos/PredictionIO/core/src/main/scala/io/prediction/workflow/CreateWorkflow.scala b/repos/PredictionIO/core/src/main/scala/io/prediction/workflow/CreateWorkflow.scala index a969252337b..7ec9212f0a0 100644 --- a/repos/PredictionIO/core/src/main/scala/io/prediction/workflow/CreateWorkflow.scala +++ b/repos/PredictionIO/core/src/main/scala/io/prediction/workflow/CreateWorkflow.scala @@ -172,7 +172,7 @@ object CreateWorkflow extends Logging { p.split('=') match { case Array(k, v) => List(k -> v) case _ => Nil - }) + }) .toMap) .getOrElse(Map()) diff --git a/repos/PredictionIO/core/src/test/scala/io/prediction/controller/MetricTest.scala b/repos/PredictionIO/core/src/test/scala/io/prediction/controller/MetricTest.scala index 9ea76af4208..546eb83c190 100644 --- a/repos/PredictionIO/core/src/test/scala/io/prediction/controller/MetricTest.scala +++ b/repos/PredictionIO/core/src/test/scala/io/prediction/controller/MetricTest.scala @@ -37,7 +37,11 @@ object MetricDevSuite { class QOptionAverageMetric extends OptionAverageMetric[EmptyParams, Int, Int, Int] { def calculate(q: Int, p: Int, a: Int): Option[Double] = { - if (q < 0) { None } else { Some(q.toDouble) } + if (q < 0) { + None + } else { + Some(q.toDouble) + } } } @@ -48,7 +52,11 @@ object MetricDevSuite { class QOptionStdevMetric extends OptionStdevMetric[EmptyParams, Int, Int, Int] { def calculate(q: Int, p: Int, a: Int): Option[Double] = { - if (q < 0) { None } else { Some(q.toDouble) } + if (q < 0) { + None + } else { + Some(q.toDouble) + } } } } diff --git a/repos/PredictionIO/data/src/main/scala/io/prediction/data/api/Stats.scala b/repos/PredictionIO/data/src/main/scala/io/prediction/data/api/Stats.scala index 1c51b55cd71..0a7a1b04256 100644 --- a/repos/PredictionIO/data/src/main/scala/io/prediction/data/api/Stats.scala +++ b/repos/PredictionIO/data/src/main/scala/io/prediction/data/api/Stats.scala @@ -60,7 +60,11 @@ class Stats(val startTime: DateTime) { m: mutable.Map[(Int, K), V]): Seq[KV[K, V]] = { m.toSeq.flatMap { case (k, v) => - if (k._1 == appId) { Seq(KV(k._2, v)) } else { Seq() } + if (k._1 == appId) { + Seq(KV(k._2, v)) + } else { + Seq() + } } } diff --git a/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EngineManifests.scala b/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EngineManifests.scala index c5a9354c94a..5114215e7f3 100644 --- a/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EngineManifests.scala +++ b/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EngineManifests.scala @@ -94,7 +94,7 @@ class EngineManifestSerializer t match { case JString(file) => file case _ => "" - })) + })) case JField("engineFactory", JString(engineFactory)) => enginemanifest.copy(engineFactory = engineFactory) case _ => enginemanifest @@ -113,9 +113,10 @@ class EngineManifestSerializer .map(x => JString(x)) .getOrElse(JNothing)) :: JField( "files", - JArray(enginemanifest.files - .map(x => JString(x)) - .toList)) :: JField( + JArray( + enginemanifest.files + .map(x => JString(x)) + .toList)) :: JField( "engineFactory", JString(enginemanifest.engineFactory)) :: Nil) })) diff --git a/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EventJson4sSupport.scala b/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EventJson4sSupport.scala index 4832ef2855c..3de6092176f 100644 --- a/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EventJson4sSupport.scala +++ b/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/EventJson4sSupport.scala @@ -132,8 +132,8 @@ object EventJson4sSupport { // disable tags from API for now JField("prId", d.prId.map(JString(_)).getOrElse(JNothing)) :: // don't show creationTime for now JField( - "creationTime", - JString(DataUtils.dateTimeToString(d.creationTime))) :: Nil) + "creationTime", + JString(DataUtils.dateTimeToString(d.creationTime))) :: Nil) } } diff --git a/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/Storage.scala b/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/Storage.scala index 2fc2bb58e3a..9187dd10953 100644 --- a/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/Storage.scala +++ b/repos/PredictionIO/data/src/main/scala/io/prediction/data/storage/Storage.scala @@ -184,7 +184,7 @@ object Storage extends Logging { error(e.getMessage) errors += 1 r -> DataObjectMeta("", "") - }) + }) .toMap if (errors > 0) { diff --git a/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/Evaluation.scala b/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/Evaluation.scala index 1f1b42d5a8a..3b7f65fa250 100644 --- a/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/Evaluation.scala +++ b/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/Evaluation.scala @@ -36,7 +36,7 @@ object CommonParams { itemSimilarity = "LogLikelihoodSimilarity", weighted = false, nearestN = 10, - threshold = 4.9E-324, + threshold = 4.9e-324, numSimilarItems = 50, numUserActions = 50, freshness = 0, @@ -75,8 +75,8 @@ object Evaluation1 { val engineParams = new EngineParams( dataSourceParams = dsp, preparatorParams = CommonParams.PreparatorParams, - algorithmParamsList = - Seq(("mahoutItemBased", CommonParams.MahoutAlgoParams0)) + algorithmParamsList = Seq( + ("mahoutItemBased", CommonParams.MahoutAlgoParams0)) ) // Evaluator Setting @@ -107,8 +107,8 @@ object Evaluation2 { val engineParams = new EngineParams( dataSourceParams = CommonParams.CompleteDataSourceParams, preparatorParams = CommonParams.PreparatorParams, - algorithmParamsList = - Seq(("mahoutItemBased", CommonParams.MahoutAlgoParams0)) + algorithmParamsList = Seq( + ("mahoutItemBased", CommonParams.MahoutAlgoParams0)) ) // Evaluator Setting diff --git a/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/ItemRecEvaluation.scala b/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/ItemRecEvaluation.scala index 4adeda1f30f..5cf9d6c8ac8 100644 --- a/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/ItemRecEvaluation.scala +++ b/repos/PredictionIO/examples/experimental/scala-local-movielens-evaluation/src/main/scala/ItemRecEvaluation.scala @@ -44,7 +44,7 @@ object ItemRecEvaluation1 { booleanData = true, itemSimilarity = "LogLikelihoodSimilarity", weighted = false, - threshold = 4.9E-324, + threshold = 4.9e-324, nearestN = 10, unseenOnly = false, freshness = 0, diff --git a/repos/PredictionIO/tools/src/main/scala/io/prediction/tools/Runner.scala b/repos/PredictionIO/tools/src/main/scala/io/prediction/tools/Runner.scala index 4f6d0b3da2f..56a6a0bbb24 100644 --- a/repos/PredictionIO/tools/src/main/scala/io/prediction/tools/Runner.scala +++ b/repos/PredictionIO/tools/src/main/scala/io/prediction/tools/Runner.scala @@ -34,7 +34,7 @@ object Runner extends Logging { p.split('=') match { case Array(k, v) => List(k -> v) case _ => Nil - }) + }) .toMap def argumentValue( diff --git a/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala b/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala index 33db4609a66..726359671de 100644 --- a/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala +++ b/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorDSLSpec.scala @@ -205,7 +205,7 @@ class ActorDSLSpec extends AkkaSpec { //#supervise-with val child = actor("child")(new Act { whenFailing { (_, _) ⇒ - } + } become { case ref: ActorRef ⇒ whenStopping(ref ! "stopped") case ex: Exception ⇒ throw ex diff --git a/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala b/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala index baa7a386a9d..61b7c88a2fa 100644 --- a/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala +++ b/repos/akka/akka-actor-tests/src/test/scala/akka/actor/ActorWithBoundedStashSpec.scala @@ -38,7 +38,9 @@ object ActorWithBoundedStashSpec { def receive = { case msg: String if msg.startsWith("hello") ⇒ numStashed += 1 - try { stash(); sender() ! "ok" } catch { + try { + stash(); sender() ! "ok" + } catch { case _: StashOverflowException ⇒ if (numStashed == 21) { sender() ! "STASHOVERFLOW" diff --git a/repos/akka/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/repos/akka/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index bcc6ea63d0b..bf1df8a2817 100644 --- a/repos/akka/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/repos/akka/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -156,7 +156,7 @@ class LocalActorRefProviderSpec case Some(Success(a: ActorRef)) ⇒ 1 case Some(Failure(ex: InvalidActorNameException)) ⇒ 2 case x ⇒ x - }) + }) set should ===(Set[Any](1, 2)) } } diff --git a/repos/akka/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/repos/akka/akka-actor/src/main/scala/akka/actor/ActorCell.scala index e8c227d0372..1dd2f5733c9 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -569,7 +569,7 @@ private[akka] class ActorCell( def become(behavior: Actor.Receive, discardOld: Boolean = true): Unit = behaviorStack = behavior :: (if (discardOld && behaviorStack.nonEmpty) behaviorStack.tail - else behaviorStack) + else behaviorStack) def become(behavior: Procedure[Any]): Unit = become(behavior, discardOld = true) diff --git a/repos/akka/akka-actor/src/main/scala/akka/actor/LightArrayRevolverScheduler.scala b/repos/akka/akka-actor/src/main/scala/akka/actor/LightArrayRevolverScheduler.scala index 4b41e51df28..c8203a7b621 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/actor/LightArrayRevolverScheduler.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/actor/LightArrayRevolverScheduler.scala @@ -61,7 +61,7 @@ class LightArrayRevolverScheduler( import LightArrayRevolverScheduler._ - private val oneNs = Duration.fromNanos(1l) + private val oneNs = Duration.fromNanos(1L) private def roundUp(d: FiniteDuration): FiniteDuration = try { ((d + TickDuration - oneNs) / TickDuration).toLong * TickDuration diff --git a/repos/akka/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/repos/akka/akka-actor/src/main/scala/akka/actor/TypedActor.scala index 83d5bea50ed..222632dcf52 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -509,7 +509,9 @@ object TypedActor } case m if m.returnsJOption || m.returnsOption ⇒ val f = ask(actor, m)(timeout) - (try { Await.ready(f, timeout.duration).value } catch { + (try { + Await.ready(f, timeout.duration).value + } catch { case _: TimeoutException ⇒ None }) match { case None | Some(Success(NullResponse)) | Some( diff --git a/repos/akka/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala b/repos/akka/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala index 13ba56407ea..c1113e549a0 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala @@ -505,18 +505,21 @@ object ForkJoinExecutorConfigurator { final class AkkaForkJoinTask(runnable: Runnable) extends ForkJoinTask[Unit] { override def getRawResult(): Unit = () override def setRawResult(unit: Unit): Unit = () - final override def exec(): Boolean = try { runnable.run(); true } catch { - case ie: InterruptedException ⇒ - Thread.currentThread.interrupt() - false - case anything: Throwable ⇒ - val t = Thread.currentThread - t.getUncaughtExceptionHandler match { - case null ⇒ - case some ⇒ some.uncaughtException(t, anything) - } - throw anything - } + final override def exec(): Boolean = + try { + runnable.run(); true + } catch { + case ie: InterruptedException ⇒ + Thread.currentThread.interrupt() + false + case anything: Throwable ⇒ + val t = Thread.currentThread + t.getUncaughtExceptionHandler match { + case null ⇒ + case some ⇒ some.uncaughtException(t, anything) + } + throw anything + } } } diff --git a/repos/akka/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala b/repos/akka/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala index 244341493bf..9f756a12eab 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala @@ -276,18 +276,21 @@ private[akka] abstract class Mailbox(val messageQueue: MessageQueue) override final def getRawResult(): Unit = () override final def setRawResult(unit: Unit): Unit = () - final override def exec(): Boolean = try { run(); false } catch { - case ie: InterruptedException ⇒ - Thread.currentThread.interrupt() - false - case anything: Throwable ⇒ - val t = Thread.currentThread - t.getUncaughtExceptionHandler match { - case null ⇒ - case some ⇒ some.uncaughtException(t, anything) - } - throw anything - } + final override def exec(): Boolean = + try { + run(); false + } catch { + case ie: InterruptedException ⇒ + Thread.currentThread.interrupt() + false + case anything: Throwable ⇒ + val t = Thread.currentThread + t.getUncaughtExceptionHandler match { + case null ⇒ + case some ⇒ some.uncaughtException(t, anything) + } + throw anything + } /** * Process the messages in the mailbox diff --git a/repos/akka/akka-actor/src/main/scala/akka/event/EventBus.scala b/repos/akka/akka-actor/src/main/scala/akka/event/EventBus.scala index 4f21e14837e..efea8c54108 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/event/EventBus.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/event/EventBus.scala @@ -377,7 +377,11 @@ trait ManagedActorClassification { } } - try { dissociateAsMonitored(actor) } finally { dissociateAsMonitor(actor) } + try { + dissociateAsMonitored(actor) + } finally { + dissociateAsMonitor(actor) + } } @tailrec @@ -528,7 +532,9 @@ trait ActorClassification { } } - try { dissociateAsMonitored(monitored) } finally { + try { + dissociateAsMonitored(monitored) + } finally { dissociateAsMonitor(monitored) } } diff --git a/repos/akka/akka-actor/src/main/scala/akka/event/Logging.scala b/repos/akka/akka-actor/src/main/scala/akka/event/Logging.scala index a6f75bcd990..91d37dca415 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/event/Logging.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/event/Logging.scala @@ -1,6 +1,6 @@ /** - * Copyright (C) 2009-2016 Lightbend Inc. - */ + * Copyright (C) 2009-2016 Lightbend Inc. + */ package akka.event import java.util.Locale @@ -11,22 +11,22 @@ import akka.actor.ActorSystem.Settings import akka.actor._ import akka.dispatch.RequiresMessageQueue import akka.util.ReentrantGuard -import akka.{ AkkaException, ConfigurationException } +import akka.{AkkaException, ConfigurationException} import scala.annotation.implicitNotFound import scala.collection.immutable import scala.concurrent.Await import scala.language.existentials -import scala.util.control.{ NoStackTrace, NonFatal } +import scala.util.control.{NoStackTrace, NonFatal} /** - * This trait brings log level handling to the EventStream: it reads the log - * levels for the initial logging (StandardOutLogger) and the loggers & level - * for after-init logging, possibly keeping the StandardOutLogger enabled if - * it is part of the configured loggers. All configured loggers are treated as - * system services and managed by this trait, i.e. subscribed/unsubscribed in - * response to changes of LoggingBus.logLevel. - */ + * This trait brings log level handling to the EventStream: it reads the log + * levels for the initial logging (StandardOutLogger) and the loggers & level + * for after-init logging, possibly keeping the StandardOutLogger enabled if + * it is part of the configured loggers. All configured loggers are treated as + * system services and managed by this trait, i.e. subscribed/unsubscribed in + * response to changes of LoggingBus.logLevel. + */ trait LoggingBus extends ActorEventBus { type Event >: Logging.LogEvent @@ -39,20 +39,20 @@ trait LoggingBus extends ActorEventBus { @volatile private var _logLevel: LogLevel = _ /** - * Query currently set log level. See object Logging for more information. - */ + * Query currently set log level. See object Logging for more information. + */ def logLevel = _logLevel /** - * Change log level: default loggers (i.e. from configuration file) are - * subscribed/unsubscribed as necessary so that they listen to all levels - * which are at least as severe as the given one. See object Logging for - * more information. - * - * NOTE: if the StandardOutLogger is configured also as normal logger, it - * will not participate in the automatic management of log level - * subscriptions! - */ + * Change log level: default loggers (i.e. from configuration file) are + * subscribed/unsubscribed as necessary so that they listen to all levels + * which are at least as severe as the given one. See object Logging for + * more information. + * + * NOTE: if the StandardOutLogger is configured also as normal logger, it + * will not participate in the automatic management of log level + * subscriptions! + */ def setLogLevel(level: LogLevel): Unit = guard.withGuard { val logLvl = _logLevel // saves (2 * AllLogLevel.size - 1) volatile reads (because of the loops below) for { @@ -73,10 +73,16 @@ trait LoggingBus extends ActorEventBus { private def setUpStdoutLogger(config: Settings) { val level = levelFor(config.StdoutLogLevel) getOrElse { // only log initialization errors directly with StandardOutLogger.print - StandardOutLogger.print(Error(new LoggerException, simpleName(this), this.getClass, "unknown akka.stdout-loglevel " + config.StdoutLogLevel)) + StandardOutLogger.print( + Error( + new LoggerException, + simpleName(this), + this.getClass, + "unknown akka.stdout-loglevel " + config.StdoutLogLevel)) ErrorLevel } - AllLogLevels filter (level >= _) foreach (l ⇒ subscribe(StandardOutLogger, classFor(l))) + AllLogLevels filter (level >= _) foreach (l ⇒ + subscribe(StandardOutLogger, classFor(l))) guard.withGuard { loggers :+= StandardOutLogger _logLevel = level @@ -84,26 +90,31 @@ trait LoggingBus extends ActorEventBus { } /** - * Internal Akka use only - */ + * Internal Akka use only + */ private[akka] def startStdoutLogger(config: Settings) { setUpStdoutLogger(config) publish(Debug(simpleName(this), this.getClass, "StandardOutLogger started")) } /** - * Internal Akka use only - */ + * Internal Akka use only + */ private[akka] def startDefaultLoggers(system: ActorSystemImpl) { val logName = simpleName(this) + "(" + system + ")" val level = levelFor(system.settings.LogLevel) getOrElse { // only log initialization errors directly with StandardOutLogger.print - StandardOutLogger.print(Error(new LoggerException, logName, this.getClass, "unknown akka.loglevel " + system.settings.LogLevel)) + StandardOutLogger.print( + Error( + new LoggerException, + logName, + this.getClass, + "unknown akka.loglevel " + system.settings.LogLevel)) ErrorLevel } try { val defaultLoggers = system.settings.Loggers match { - case Nil ⇒ classOf[DefaultLogger].getName :: Nil + case Nil ⇒ classOf[DefaultLogger].getName :: Nil case loggers ⇒ loggers } val myloggers = @@ -111,13 +122,19 @@ trait LoggingBus extends ActorEventBus { loggerName ← defaultLoggers if loggerName != StandardOutLogger.getClass.getName } yield { - system.dynamicAccess.getClassFor[Actor](loggerName).map({ - case actorClass ⇒ addLogger(system, actorClass, level, logName) - }).recover({ - case e ⇒ throw new ConfigurationException( - "Logger specified in config can't be loaded [" + loggerName + - "] due to [" + e.toString + "]", e) - }).get + system.dynamicAccess + .getClassFor[Actor](loggerName) + .map({ + case actorClass ⇒ addLogger(system, actorClass, level, logName) + }) + .recover({ + case e ⇒ + throw new ConfigurationException( + "Logger specified in config can't be loaded [" + loggerName + + "] due to [" + e.toString + "]", + e) + }) + .get } guard.withGuard { loggers = myloggers @@ -125,12 +142,22 @@ trait LoggingBus extends ActorEventBus { } try { if (system.settings.DebugUnhandledMessage) - subscribe(system.systemActorOf(Props(new Actor { - def receive = { - case UnhandledMessage(msg, sender, rcp) ⇒ - publish(Debug(rcp.path.toString, rcp.getClass, "unhandled message from " + sender + ": " + msg)) - } - }), "UnhandledMessageForwarder"), classOf[UnhandledMessage]) + subscribe( + system.systemActorOf( + Props(new Actor { + def receive = { + case UnhandledMessage(msg, sender, rcp) ⇒ + publish( + Debug( + rcp.path.toString, + rcp.getClass, + "unhandled message from " + sender + ": " + msg)) + } + }), + "UnhandledMessageForwarder" + ), + classOf[UnhandledMessage] + ) } catch { case _: InvalidActorNameException ⇒ // ignore if it is already running } @@ -142,18 +169,23 @@ trait LoggingBus extends ActorEventBus { case e: Exception ⇒ System.err.println("error while starting up loggers") e.printStackTrace() - throw new ConfigurationException("Could not start logger due to [" + e.toString + "]") + throw new ConfigurationException( + "Could not start logger due to [" + e.toString + "]") } } /** - * Internal Akka use only - */ + * Internal Akka use only + */ private[akka] def stopDefaultLoggers(system: ActorSystem) { val level = _logLevel // volatile access before reading loggers if (!(loggers contains StandardOutLogger)) { setUpStdoutLogger(system.settings) - publish(Debug(simpleName(this), this.getClass, "shutting down: StandardOutLogger started")) + publish( + Debug( + simpleName(this), + this.getClass, + "shutting down: StandardOutLogger started")) } for { logger ← loggers @@ -163,27 +195,39 @@ trait LoggingBus extends ActorEventBus { unsubscribe(logger) logger match { case ref: InternalActorRef ⇒ ref.stop() - case _ ⇒ + case _ ⇒ } } - publish(Debug(simpleName(this), this.getClass, "all default loggers stopped")) + publish( + Debug(simpleName(this), this.getClass, "all default loggers stopped")) } /** - * INTERNAL API - */ - private def addLogger(system: ActorSystemImpl, clazz: Class[_ <: Actor], level: LogLevel, logName: String): ActorRef = { + * INTERNAL API + */ + private def addLogger( + system: ActorSystemImpl, + clazz: Class[_ <: Actor], + level: LogLevel, + logName: String): ActorRef = { val name = "log" + Extension(system).id() + "-" + simpleName(clazz) val actor = system.systemActorOf(Props(clazz), name) implicit def timeout = system.settings.LoggerStartTimeout import akka.pattern.ask - val response = try Await.result(actor ? InitializeLogger(this), timeout.duration) catch { - case _: TimeoutException ⇒ - publish(Warning(logName, this.getClass, "Logger " + name + " did not respond within " + timeout + " to InitializeLogger(bus)")) - "[TIMEOUT]" - } + val response = + try Await.result(actor ? InitializeLogger(this), timeout.duration) + catch { + case _: TimeoutException ⇒ + publish( + Warning( + logName, + this.getClass, + "Logger " + name + " did not respond within " + timeout + " to InitializeLogger(bus)")) + "[TIMEOUT]" + } if (response != LoggerInitialized) - throw new LoggerInitializationException("Logger " + name + " did not respond with LoggerInitialized, sent instead " + response) + throw new LoggerInitializationException( + "Logger " + name + " did not respond with LoggerInitialized, sent instead " + response) AllLogLevels filter (level >= _) foreach (l ⇒ subscribe(actor, classFor(l))) publish(Debug(logName, this.getClass, "logger " + name + " started")) actor @@ -192,203 +236,211 @@ trait LoggingBus extends ActorEventBus { } /** - * This trait defines the interface to be provided by a “log source formatting - * rule” as used by [[akka.event.Logging]]’s `apply`/`create` method. - * - * See the companion object for default implementations. - * - * Example: - * {{{ - * trait MyType { // as an example - * def name: String - * } - * - * implicit val myLogSourceType: LogSource[MyType] = new LogSource[MyType] { - * def genString(a: MyType) = a.name - * } - * - * class MyClass extends MyType { - * val log = Logging(eventStream, this) // will use "hallo" as logSource - * def name = "hallo" - * } - * }}} - * - * The second variant is used for including the actor system’s address: - * {{{ - * trait MyType { // as an example - * def name: String - * } - * - * implicit val myLogSourceType: LogSource[MyType] = new LogSource[MyType] { - * def genString(a: MyType) = a.name - * def genString(a: MyType, s: ActorSystem) = a.name + "," + s - * } - * - * class MyClass extends MyType { - * val sys = ActorSystem("sys") - * val log = Logging(sys, this) // will use "hallo,akka://sys" as logSource - * def name = "hallo" - * } - * }}} - * - * The default implementation of the second variant will just call the first. - */ -@implicitNotFound("Cannot find LogSource for ${T} please see ScalaDoc for LogSource for how to obtain or construct one.") trait LogSource[-T] { + * This trait defines the interface to be provided by a “log source formatting + * rule” as used by [[akka.event.Logging]]’s `apply`/`create` method. + * + * See the companion object for default implementations. + * + * Example: + * {{{ + * trait MyType { // as an example + * def name: String + * } + * + * implicit val myLogSourceType: LogSource[MyType] = new LogSource[MyType] { + * def genString(a: MyType) = a.name + * } + * + * class MyClass extends MyType { + * val log = Logging(eventStream, this) // will use "hallo" as logSource + * def name = "hallo" + * } + * }}} + * + * The second variant is used for including the actor system’s address: + * {{{ + * trait MyType { // as an example + * def name: String + * } + * + * implicit val myLogSourceType: LogSource[MyType] = new LogSource[MyType] { + * def genString(a: MyType) = a.name + * def genString(a: MyType, s: ActorSystem) = a.name + "," + s + * } + * + * class MyClass extends MyType { + * val sys = ActorSystem("sys") + * val log = Logging(sys, this) // will use "hallo,akka://sys" as logSource + * def name = "hallo" + * } + * }}} + * + * The default implementation of the second variant will just call the first. + */ +@implicitNotFound( + "Cannot find LogSource for ${T} please see ScalaDoc for LogSource for how to obtain or construct one.") trait LogSource[ + -T] { def genString(t: T): String def genString(t: T, system: ActorSystem): String = genString(t) def getClazz(t: T): Class[_] = t.getClass } /** - * This is a “marker” class which is inserted as originator class into - * [[akka.event.Logging.LogEvent]] when the string representation was supplied - * directly. - */ + * This is a “marker” class which is inserted as originator class into + * [[akka.event.Logging.LogEvent]] when the string representation was supplied + * directly. + */ class DummyClassForStringSources /** - * This object holds predefined formatting rules for log sources. - * - * In case an [[akka.actor.ActorSystem]] is provided, the following apply: - * - * - * In case a [[akka.event.LoggingBus]] is provided, the following apply: - * - */ + * This object holds predefined formatting rules for log sources. + * + * In case an [[akka.actor.ActorSystem]] is provided, the following apply: + * + * + * In case a [[akka.event.LoggingBus]] is provided, the following apply: + * + */ object LogSource { implicit val fromString: LogSource[String] = new LogSource[String] { def genString(s: String) = s - override def genString(s: String, system: ActorSystem) = s + "(" + system + ")" + override def genString(s: String, system: ActorSystem) = + s + "(" + system + ")" override def getClazz(s: String) = classOf[DummyClassForStringSources] } implicit val fromActor: LogSource[Actor] = new LogSource[Actor] { def genString(a: Actor) = fromActorRef.genString(a.self) - override def genString(a: Actor, system: ActorSystem) = fromActorRef.genString(a.self, system) + override def genString(a: Actor, system: ActorSystem) = + fromActorRef.genString(a.self, system) } implicit val fromActorRef: LogSource[ActorRef] = new LogSource[ActorRef] { def genString(a: ActorRef) = a.path.toString - override def genString(a: ActorRef, system: ActorSystem) = try { - a.path.toStringWithAddress(system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress) - } catch { - // it can fail if the ActorSystem (remoting) is not completely started yet - case NonFatal(_) ⇒ a.path.toString - } + override def genString(a: ActorRef, system: ActorSystem) = + try { + a.path.toStringWithAddress( + system.asInstanceOf[ExtendedActorSystem].provider.getDefaultAddress) + } catch { + // it can fail if the ActorSystem (remoting) is not completely started yet + case NonFatal(_) ⇒ a.path.toString + } } // this one unfortunately does not work as implicit, because existential types have some weird behavior val fromClass: LogSource[Class[_]] = new LogSource[Class[_]] { def genString(c: Class[_]): String = Logging.simpleName(c) - override def genString(c: Class[_], system: ActorSystem): String = genString(c) + "(" + system + ")" + override def genString(c: Class[_], system: ActorSystem): String = + genString(c) + "(" + system + ")" override def getClazz(c: Class[_]): Class[_] = c } - implicit def fromAnyClass[T]: LogSource[Class[T]] = fromClass.asInstanceOf[LogSource[Class[T]]] + implicit def fromAnyClass[T]: LogSource[Class[T]] = + fromClass.asInstanceOf[LogSource[Class[T]]] /** - * Convenience converter access: given an implicit `LogSource`, generate the - * string representation and originating class. - */ + * Convenience converter access: given an implicit `LogSource`, generate the + * string representation and originating class. + */ def apply[T: LogSource](o: T): (String, Class[_]) = { val ls = implicitly[LogSource[T]] (ls.genString(o), ls.getClazz(o)) } /** - * Convenience converter access: given an implicit `LogSource` and - * [[akka.actor.ActorSystem]], generate the string representation and - * originating class. - */ + * Convenience converter access: given an implicit `LogSource` and + * [[akka.actor.ActorSystem]], generate the string representation and + * originating class. + */ def apply[T: LogSource](o: T, system: ActorSystem): (String, Class[_]) = { val ls = implicitly[LogSource[T]] (ls.genString(o, system), ls.getClazz(o)) } /** - * construct string representation for any object according to - * rules above with fallback to its `Class`’s simple name. - */ + * construct string representation for any object according to + * rules above with fallback to its `Class`’s simple name. + */ def fromAnyRef(o: AnyRef): (String, Class[_]) = o match { case c: Class[_] ⇒ apply(c) - case a: Actor ⇒ apply(a) + case a: Actor ⇒ apply(a) case a: ActorRef ⇒ apply(a) - case s: String ⇒ apply(s) - case x ⇒ (Logging.simpleName(x), x.getClass) + case s: String ⇒ apply(s) + case x ⇒ (Logging.simpleName(x), x.getClass) } /** - * construct string representation for any object according to - * rules above (including the actor system’s address) with fallback to its - * `Class`’s simple name. - */ + * construct string representation for any object according to + * rules above (including the actor system’s address) with fallback to its + * `Class`’s simple name. + */ def fromAnyRef(o: AnyRef, system: ActorSystem): (String, Class[_]) = o match { case c: Class[_] ⇒ apply(c) - case a: Actor ⇒ apply(a) + case a: Actor ⇒ apply(a) case a: ActorRef ⇒ apply(a) - case s: String ⇒ apply(s) - case x ⇒ (Logging.simpleName(x) + "(" + system + ")", x.getClass) + case s: String ⇒ apply(s) + case x ⇒ (Logging.simpleName(x) + "(" + system + ")", x.getClass) } } /** - * Main entry point for Akka logging: log levels and message types (aka - * channels) defined for the main transport medium, the main event bus. The - * recommended use is to obtain an implementation of the Logging trait with - * suitable and efficient methods for generating log events: - * - *

- * val log = Logging(<bus>, <source object>)
- * ...
- * log.info("hello world!")
- * 
- * - * The source object is used in two fashions: its `Class[_]` will be part of - * all log events produced by this logger, plus a string representation is - * generated which may contain per-instance information, see `apply` or `create` - * below. - * - * Loggers are attached to the level-specific channels Error, - * Warning, Info and Debug as - * appropriate for the configured (or set) log level. If you want to implement - * your own, make sure to handle these four event types plus the InitializeLogger - * message which is sent before actually attaching it to the logging bus. - * - * Logging is configured by setting (some of) the following: - * - *

- * akka {
- *   loggers = ["akka.slf4j.Slf4jLogger"] # for example
- *   loglevel = "INFO"        # used when normal logging ("loggers") has been started
- *   stdout-loglevel = "WARN" # used during application start-up until normal logging is available
- * }
- * 
- */ + * Main entry point for Akka logging: log levels and message types (aka + * channels) defined for the main transport medium, the main event bus. The + * recommended use is to obtain an implementation of the Logging trait with + * suitable and efficient methods for generating log events: + * + *

+  * val log = Logging(<bus>, <source object>)
+  * ...
+  * log.info("hello world!")
+  * 
+ * + * The source object is used in two fashions: its `Class[_]` will be part of + * all log events produced by this logger, plus a string representation is + * generated which may contain per-instance information, see `apply` or `create` + * below. + * + * Loggers are attached to the level-specific channels Error, + * Warning, Info and Debug as + * appropriate for the configured (or set) log level. If you want to implement + * your own, make sure to handle these four event types plus the InitializeLogger + * message which is sent before actually attaching it to the logging bus. + * + * Logging is configured by setting (some of) the following: + * + *

+  * akka {
+  *   loggers = ["akka.slf4j.Slf4jLogger"] # for example
+  *   loglevel = "INFO"        # used when normal logging ("loggers") has been started
+  *   stdout-loglevel = "WARN" # used during application start-up until normal logging is available
+  * }
+  * 
+ */ object Logging { /** - * Returns a 'safe' getSimpleName for the provided object's Class - * @param obj - * @return the simple name of the given object's Class - */ + * Returns a 'safe' getSimpleName for the provided object's Class + * @param obj + * @return the simple name of the given object's Class + */ def simpleName(obj: AnyRef): String = simpleName(obj.getClass) /** - * Returns a 'safe' getSimpleName for the provided Class - * @param clazz - * @return the simple name of the given Class - */ + * Returns a 'safe' getSimpleName for the provided Class + * @param clazz + * @return the simple name of the given Class + */ def simpleName(clazz: Class[_]): String = { val n = clazz.getName val i = n.lastIndexOf('.') @@ -396,21 +448,21 @@ object Logging { } /** - * INTERNAL API - */ + * INTERNAL API + */ private[akka] object Extension extends ExtensionKey[LogExt] /** - * INTERNAL API - */ + * INTERNAL API + */ private[akka] class LogExt(system: ExtendedActorSystem) extends Extension { private val loggerId = new AtomicInteger def id() = loggerId.incrementAndGet() } /** - * Marker trait for annotating LogLevel, which must be Int after erasure. - */ + * Marker trait for annotating LogLevel, which must be Int after erasure. + */ final case class LogLevel(asInt: Int) extends AnyVal { @inline final def >=(other: LogLevel): Boolean = asInt >= other.asInt @inline final def <=(other: LogLevel): Boolean = asInt <= other.asInt @@ -419,42 +471,42 @@ object Logging { } /** - * Log level in numeric form, used when deciding whether a certain log - * statement should generate a log event. Predefined levels are ErrorLevel (1) - * to DebugLevel (4). In case you want to add more levels, loggers need to - * be subscribed to their event bus channels manually. - */ + * Log level in numeric form, used when deciding whether a certain log + * statement should generate a log event. Predefined levels are ErrorLevel (1) + * to DebugLevel (4). In case you want to add more levels, loggers need to + * be subscribed to their event bus channels manually. + */ final val ErrorLevel = LogLevel(1) final val WarningLevel = LogLevel(2) final val InfoLevel = LogLevel(3) final val DebugLevel = LogLevel(4) /** - * Internal Akka use only - * - * Don't include the OffLevel in the AllLogLevels since we should never subscribe - * to some kind of OffEvent. - */ + * Internal Akka use only + * + * Don't include the OffLevel in the AllLogLevels since we should never subscribe + * to some kind of OffEvent. + */ private final val OffLevel = LogLevel(Int.MinValue) /** - * Returns the LogLevel associated with the given string, - * valid inputs are upper or lowercase (not mixed) versions of: - * "error", "warning", "info" and "debug" - */ + * Returns the LogLevel associated with the given string, + * valid inputs are upper or lowercase (not mixed) versions of: + * "error", "warning", "info" and "debug" + */ def levelFor(s: String): Option[LogLevel] = s.toLowerCase(Locale.ROOT) match { - case "off" ⇒ Some(OffLevel) - case "error" ⇒ Some(ErrorLevel) + case "off" ⇒ Some(OffLevel) + case "error" ⇒ Some(ErrorLevel) case "warning" ⇒ Some(WarningLevel) - case "info" ⇒ Some(InfoLevel) - case "debug" ⇒ Some(DebugLevel) - case unknown ⇒ None + case "info" ⇒ Some(InfoLevel) + case "debug" ⇒ Some(DebugLevel) + case unknown ⇒ None } /** - * Returns the LogLevel associated with the given event class. - * Defaults to DebugLevel. - */ + * Returns the LogLevel associated with the given event class. + * Defaults to DebugLevel. + */ def levelFor(eventClass: Class[_ <: LogEvent]): LogLevel = { if (classOf[Error].isAssignableFrom(eventClass)) ErrorLevel else if (classOf[Warning].isAssignableFrom(eventClass)) WarningLevel @@ -464,179 +516,192 @@ object Logging { } /** - * Returns the event class associated with the given LogLevel - */ + * Returns the event class associated with the given LogLevel + */ def classFor(level: LogLevel): Class[_ <: LogEvent] = level match { - case ErrorLevel ⇒ classOf[Error] + case ErrorLevel ⇒ classOf[Error] case WarningLevel ⇒ classOf[Warning] - case InfoLevel ⇒ classOf[Info] - case DebugLevel ⇒ classOf[Debug] + case InfoLevel ⇒ classOf[Info] + case DebugLevel ⇒ classOf[Debug] } // these type ascriptions/casts are necessary to avoid CCEs during construction while retaining correct type - val AllLogLevels: immutable.Seq[LogLevel] = Vector(ErrorLevel, WarningLevel, InfoLevel, DebugLevel) - - /** - * Obtain LoggingAdapter for the given actor system and source object. This - * will use the system’s event stream and include the system’s address in the - * log source string. - * - * Do not use this if you want to supply a log category string (like - * “com.example.app.whatever”) unaltered, supply `system.eventStream` in this - * case or use - * - * {{{ - * Logging(system, this.getClass) - * }}} - * - * The source is used to identify the source of this logging channel and - * must have a corresponding implicit LogSource[T] instance in scope; by - * default these are provided for Class[_], Actor, ActorRef and String types. - * See the companion object of [[akka.event.LogSource]] for details. - * - * You can add your own rules quite easily, see [[akka.event.LogSource]]. - */ + val AllLogLevels: immutable.Seq[LogLevel] = + Vector(ErrorLevel, WarningLevel, InfoLevel, DebugLevel) + + /** + * Obtain LoggingAdapter for the given actor system and source object. This + * will use the system’s event stream and include the system’s address in the + * log source string. + * + * Do not use this if you want to supply a log category string (like + * “com.example.app.whatever”) unaltered, supply `system.eventStream` in this + * case or use + * + * {{{ + * Logging(system, this.getClass) + * }}} + * + * The source is used to identify the source of this logging channel and + * must have a corresponding implicit LogSource[T] instance in scope; by + * default these are provided for Class[_], Actor, ActorRef and String types. + * See the companion object of [[akka.event.LogSource]] for details. + * + * You can add your own rules quite easily, see [[akka.event.LogSource]]. + */ def apply[T: LogSource](system: ActorSystem, logSource: T): LoggingAdapter = { val (str, clazz) = LogSource(logSource, system) - new BusLogging(system.eventStream, str, clazz, system.asInstanceOf[ExtendedActorSystem].logFilter) - } - - /** - * Obtain LoggingAdapter for the given logging bus and source object. - * - * The source is used to identify the source of this logging channel and - * must have a corresponding implicit LogSource[T] instance in scope; by - * default these are provided for Class[_], Actor, ActorRef and String types. - * See the companion object of [[akka.event.LogSource]] for details. - * - * You can add your own rules quite easily, see [[akka.event.LogSource]]. - * - * Note that this `LoggingAdapter` will use the [[akka.event.DefaultLoggingFilter]], - * and not the [[akka.event.LoggingFilter]] configured for the system - * (if different from `DefaultLoggingFilter`). - */ + new BusLogging( + system.eventStream, + str, + clazz, + system.asInstanceOf[ExtendedActorSystem].logFilter) + } + + /** + * Obtain LoggingAdapter for the given logging bus and source object. + * + * The source is used to identify the source of this logging channel and + * must have a corresponding implicit LogSource[T] instance in scope; by + * default these are provided for Class[_], Actor, ActorRef and String types. + * See the companion object of [[akka.event.LogSource]] for details. + * + * You can add your own rules quite easily, see [[akka.event.LogSource]]. + * + * Note that this `LoggingAdapter` will use the [[akka.event.DefaultLoggingFilter]], + * and not the [[akka.event.LoggingFilter]] configured for the system + * (if different from `DefaultLoggingFilter`). + */ def apply[T: LogSource](bus: LoggingBus, logSource: T): LoggingAdapter = { val (str, clazz) = LogSource(logSource) new BusLogging(bus, str, clazz) } /** - * Obtain LoggingAdapter with MDC support for the given actor. - * Don't use it outside its specific Actor as it isn't thread safe - */ + * Obtain LoggingAdapter with MDC support for the given actor. + * Don't use it outside its specific Actor as it isn't thread safe + */ def apply(logSource: Actor): DiagnosticLoggingAdapter = { val (str, clazz) = LogSource(logSource) val system = logSource.context.system.asInstanceOf[ExtendedActorSystem] - new BusLogging(system.eventStream, str, clazz, system.logFilter) with DiagnosticLoggingAdapter - } - - /** - * Obtain LoggingAdapter for the given actor system and source object. This - * will use the system’s event stream and include the system’s address in the - * log source string. - * - * Do not use this if you want to supply a log category string (like - * “com.example.app.whatever”) unaltered, supply `system.eventStream` in this - * case or use - * - * {{{ - * Logging.getLogger(system, this.getClass()); - * }}} - * - * The source is used to identify the source of this logging channel and - * must have a corresponding implicit LogSource[T] instance in scope; by - * default these are provided for Class[_], Actor, ActorRef and String types. - * See the companion object of [[akka.event.LogSource]] for details. - */ + new BusLogging(system.eventStream, str, clazz, system.logFilter) + with DiagnosticLoggingAdapter + } + + /** + * Obtain LoggingAdapter for the given actor system and source object. This + * will use the system’s event stream and include the system’s address in the + * log source string. + * + * Do not use this if you want to supply a log category string (like + * “com.example.app.whatever”) unaltered, supply `system.eventStream` in this + * case or use + * + * {{{ + * Logging.getLogger(system, this.getClass()); + * }}} + * + * The source is used to identify the source of this logging channel and + * must have a corresponding implicit LogSource[T] instance in scope; by + * default these are provided for Class[_], Actor, ActorRef and String types. + * See the companion object of [[akka.event.LogSource]] for details. + */ def getLogger(system: ActorSystem, logSource: AnyRef): LoggingAdapter = { val (str, clazz) = LogSource.fromAnyRef(logSource, system) - new BusLogging(system.eventStream, str, clazz, system.asInstanceOf[ExtendedActorSystem].logFilter) + new BusLogging( + system.eventStream, + str, + clazz, + system.asInstanceOf[ExtendedActorSystem].logFilter) } /** - * Obtain LoggingAdapter for the given logging bus and source object. - * - * The source is used to identify the source of this logging channel and - * must have a corresponding implicit LogSource[T] instance in scope; by - * default these are provided for Class[_], Actor, ActorRef and String types. - * See the companion object of [[akka.event.LogSource]] for details. - * - * Note that this `LoggingAdapter` will use the [[akka.event.DefaultLoggingFilter]], - * and not the [[akka.event.LoggingFilter]] configured for the system - * (if different from `DefaultLoggingFilter`). - */ + * Obtain LoggingAdapter for the given logging bus and source object. + * + * The source is used to identify the source of this logging channel and + * must have a corresponding implicit LogSource[T] instance in scope; by + * default these are provided for Class[_], Actor, ActorRef and String types. + * See the companion object of [[akka.event.LogSource]] for details. + * + * Note that this `LoggingAdapter` will use the [[akka.event.DefaultLoggingFilter]], + * and not the [[akka.event.LoggingFilter]] configured for the system + * (if different from `DefaultLoggingFilter`). + */ def getLogger(bus: LoggingBus, logSource: AnyRef): LoggingAdapter = { val (str, clazz) = LogSource.fromAnyRef(logSource) new BusLogging(bus, str, clazz) } /** - * Obtain LoggingAdapter with MDC support for the given actor. - * Don't use it outside its specific Actor as it isn't thread safe - */ + * Obtain LoggingAdapter with MDC support for the given actor. + * Don't use it outside its specific Actor as it isn't thread safe + */ def getLogger(logSource: UntypedActor): DiagnosticLoggingAdapter = { val (str, clazz) = LogSource.fromAnyRef(logSource) val system = logSource.getContext().system.asInstanceOf[ExtendedActorSystem] - new BusLogging(system.eventStream, str, clazz, system.logFilter) with DiagnosticLoggingAdapter + new BusLogging(system.eventStream, str, clazz, system.logFilter) + with DiagnosticLoggingAdapter } /** - * Artificial exception injected into Error events if no Throwable is - * supplied; used for getting a stack dump of error locations. - */ + * Artificial exception injected into Error events if no Throwable is + * supplied; used for getting a stack dump of error locations. + */ class LoggerException extends AkkaException("") /** - * Exception that wraps a LogEvent. - */ - class LogEventException(val event: LogEvent, cause: Throwable) extends NoStackTrace { + * Exception that wraps a LogEvent. + */ + class LogEventException(val event: LogEvent, cause: Throwable) + extends NoStackTrace { override def getMessage: String = event.toString override def getCause: Throwable = cause } /** - * Base type of LogEvents - */ + * Base type of LogEvents + */ sealed trait LogEvent extends NoSerializationVerificationNeeded { + /** - * The thread that created this log event - */ + * The thread that created this log event + */ @transient val thread: Thread = Thread.currentThread /** - * When this LogEvent was created according to System.currentTimeMillis - */ + * When this LogEvent was created according to System.currentTimeMillis + */ val timestamp: Long = System.currentTimeMillis /** - * The LogLevel of this LogEvent - */ + * The LogLevel of this LogEvent + */ def level: LogLevel /** - * The source of this event - */ + * The source of this event + */ def logSource: String /** - * The class of the source of this event - */ + * The class of the source of this event + */ def logClass: Class[_] /** - * The message, may be any object or null. - */ + * The message, may be any object or null. + */ def message: Any /** - * Extra values for adding to MDC - */ + * Extra values for adding to MDC + */ def mdc: MDC = emptyMDC /** - * Java API: Retrieve the contents of the MDC. - */ + * Java API: Retrieve the contents of the MDC. + */ def getMDC: java.util.Map[String, Any] = { import scala.collection.JavaConverters._ mdc.asJava @@ -644,20 +709,40 @@ object Logging { } /** - * For ERROR Logging - */ - case class Error(cause: Throwable, logSource: String, logClass: Class[_], message: Any = "") extends LogEvent { - def this(logSource: String, logClass: Class[_], message: Any) = this(Error.NoCause, logSource, logClass, message) + * For ERROR Logging + */ + case class Error( + cause: Throwable, + logSource: String, + logClass: Class[_], + message: Any = "") + extends LogEvent { + def this(logSource: String, logClass: Class[_], message: Any) = + this(Error.NoCause, logSource, logClass, message) override def level = ErrorLevel } - class Error2(cause: Throwable, logSource: String, logClass: Class[_], message: Any = "", override val mdc: MDC) extends Error(cause, logSource, logClass, message) { - def this(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = this(Error.NoCause, logSource, logClass, message, mdc) + class Error2( + cause: Throwable, + logSource: String, + logClass: Class[_], + message: Any = "", + override val mdc: MDC) + extends Error(cause, logSource, logClass, message) { + def this(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = + this(Error.NoCause, logSource, logClass, message, mdc) } object Error { - def apply(logSource: String, logClass: Class[_], message: Any) = new Error(NoCause, logSource, logClass, message) - def apply(cause: Throwable, logSource: String, logClass: Class[_], message: Any, mdc: MDC) = new Error2(cause, logSource, logClass, message, mdc) - def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = new Error2(NoCause, logSource, logClass, message, mdc) + def apply(logSource: String, logClass: Class[_], message: Any) = + new Error(NoCause, logSource, logClass, message) + def apply( + cause: Throwable, + logSource: String, + logClass: Class[_], + message: Any, + mdc: MDC) = new Error2(cause, logSource, logClass, message, mdc) + def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = + new Error2(NoCause, logSource, logClass, message, mdc) /** Null Object used for errors without cause Throwable */ object NoCause extends NoStackTrace @@ -665,71 +750,94 @@ object Logging { def noCause = Error.NoCause /** - * For WARNING Logging - */ - case class Warning(logSource: String, logClass: Class[_], message: Any = "") extends LogEvent { + * For WARNING Logging + */ + case class Warning(logSource: String, logClass: Class[_], message: Any = "") + extends LogEvent { override def level = WarningLevel } - class Warning2(logSource: String, logClass: Class[_], message: Any, override val mdc: MDC) extends Warning(logSource, logClass, message) + class Warning2( + logSource: String, + logClass: Class[_], + message: Any, + override val mdc: MDC) + extends Warning(logSource, logClass, message) object Warning { - def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = new Warning2(logSource, logClass, message, mdc) + def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = + new Warning2(logSource, logClass, message, mdc) } /** - * For INFO Logging - */ - case class Info(logSource: String, logClass: Class[_], message: Any = "") extends LogEvent { + * For INFO Logging + */ + case class Info(logSource: String, logClass: Class[_], message: Any = "") + extends LogEvent { override def level = InfoLevel } - class Info2(logSource: String, logClass: Class[_], message: Any, override val mdc: MDC) extends Info(logSource, logClass, message) + class Info2( + logSource: String, + logClass: Class[_], + message: Any, + override val mdc: MDC) + extends Info(logSource, logClass, message) object Info { - def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = new Info2(logSource, logClass, message, mdc) + def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = + new Info2(logSource, logClass, message, mdc) } /** - * For DEBUG Logging - */ - case class Debug(logSource: String, logClass: Class[_], message: Any = "") extends LogEvent { + * For DEBUG Logging + */ + case class Debug(logSource: String, logClass: Class[_], message: Any = "") + extends LogEvent { override def level = DebugLevel } - class Debug2(logSource: String, logClass: Class[_], message: Any, override val mdc: MDC) extends Debug(logSource, logClass, message) + class Debug2( + logSource: String, + logClass: Class[_], + message: Any, + override val mdc: MDC) + extends Debug(logSource, logClass, message) object Debug { - def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = new Debug2(logSource, logClass, message, mdc) + def apply(logSource: String, logClass: Class[_], message: Any, mdc: MDC) = + new Debug2(logSource, logClass, message, mdc) } /** - * Message which is sent to each default logger (i.e. from configuration file) - * after its creation but before attaching it to the logging bus. The logger - * actor must handle this message, it can be used e.g. to register for more - * channels. When done, the logger must respond with a LoggerInitialized - * message. This is necessary to ensure that additional subscriptions are in - * effect when the logging system finished starting. - */ - final case class InitializeLogger(bus: LoggingBus) extends NoSerializationVerificationNeeded + * Message which is sent to each default logger (i.e. from configuration file) + * after its creation but before attaching it to the logging bus. The logger + * actor must handle this message, it can be used e.g. to register for more + * channels. When done, the logger must respond with a LoggerInitialized + * message. This is necessary to ensure that additional subscriptions are in + * effect when the logging system finished starting. + */ + final case class InitializeLogger(bus: LoggingBus) + extends NoSerializationVerificationNeeded /** - * Response message each logger must send within 1 second after receiving the - * InitializeLogger request. If initialization takes longer, send the reply - * as soon as subscriptions are set-up. - */ + * Response message each logger must send within 1 second after receiving the + * InitializeLogger request. If initialization takes longer, send the reply + * as soon as subscriptions are set-up. + */ abstract class LoggerInitialized case object LoggerInitialized extends LoggerInitialized { + /** - * Java API: get the singleton instance - */ + * Java API: get the singleton instance + */ def getInstance = this } /** - * Java API to create a LoggerInitialized message. - */ + * Java API to create a LoggerInitialized message. + */ // weird return type due to binary compatibility def loggerInitialized(): LoggerInitialized.type = LoggerInitialized /** - * LoggerInitializationException is thrown to indicate that there was a problem initializing a logger - * @param msg - */ + * LoggerInitializationException is thrown to indicate that there was a problem initializing a logger + * @param msg + */ class LoggerInitializationException(msg: String) extends AkkaException(msg) trait StdOutLogger { @@ -750,57 +858,72 @@ object Logging { } // SDF isn't threadsafe def print(event: Any): Unit = event match { - case e: Error ⇒ error(e) + case e: Error ⇒ error(e) case e: Warning ⇒ warning(e) - case e: Info ⇒ info(e) - case e: Debug ⇒ debug(e) - case e ⇒ warning(Warning(simpleName(this), this.getClass, "received unexpected event of class " + e.getClass + ": " + e)) + case e: Info ⇒ info(e) + case e: Debug ⇒ debug(e) + case e ⇒ + warning( + Warning( + simpleName(this), + this.getClass, + "received unexpected event of class " + e.getClass + ": " + e)) } def error(event: Error): Unit = { - val f = if (event.cause == Error.NoCause) errorFormatWithoutCause else errorFormat - println(f.format( - timestamp(event), - event.thread.getName, - event.logSource, - event.message, - stackTraceFor(event.cause))) + val f = + if (event.cause == Error.NoCause) errorFormatWithoutCause + else errorFormat + println( + f.format( + timestamp(event), + event.thread.getName, + event.logSource, + event.message, + stackTraceFor(event.cause))) } def warning(event: Warning): Unit = - println(warningFormat.format( - timestamp(event), - event.thread.getName, - event.logSource, - event.message)) + println( + warningFormat.format( + timestamp(event), + event.thread.getName, + event.logSource, + event.message)) def info(event: Info): Unit = - println(infoFormat.format( - timestamp(event), - event.thread.getName, - event.logSource, - event.message)) + println( + infoFormat.format( + timestamp(event), + event.thread.getName, + event.logSource, + event.message)) def debug(event: Debug): Unit = - println(debugFormat.format( - timestamp(event), - event.thread.getName, - event.logSource, - event.message)) + println( + debugFormat.format( + timestamp(event), + event.thread.getName, + event.logSource, + event.message)) } /** - * Actor-less logging implementation for synchronous logging to standard - * output. This logger is always attached first in order to be able to log - * failures during application start-up, even before normal logging is - * started. Its log level can be defined by configuration setting - * akka.stdout-loglevel. - */ + * Actor-less logging implementation for synchronous logging to standard + * output. This logger is always attached first in order to be able to log + * failures during application start-up, even before normal logging is + * started. Its log level can be defined by configuration setting + * akka.stdout-loglevel. + */ class StandardOutLogger extends MinimalActorRef with StdOutLogger { - val path: ActorPath = new RootActorPath(Address("akka", "all-systems"), "/StandardOutLogger") - def provider: ActorRefProvider = throw new UnsupportedOperationException("StandardOutLogger does not provide") + val path: ActorPath = + new RootActorPath(Address("akka", "all-systems"), "/StandardOutLogger") + def provider: ActorRefProvider = + throw new UnsupportedOperationException( + "StandardOutLogger does not provide") override val toString = "StandardOutLogger" - override def !(message: Any)(implicit sender: ActorRef = Actor.noSender): Unit = + override def !(message: Any)( + implicit sender: ActorRef = Actor.noSender): Unit = if (message == null) throw new InvalidMessageException("Message is null") else print(message) @@ -811,9 +934,10 @@ object Logging { private val serializedStandardOutLogger = new SerializedStandardOutLogger /** - * INTERNAL API - */ - @SerialVersionUID(1L) private[akka] class SerializedStandardOutLogger extends Serializable { + * INTERNAL API + */ + @SerialVersionUID(1L) private[akka] class SerializedStandardOutLogger + extends Serializable { @throws(classOf[java.io.ObjectStreamException]) private def readResolve(): AnyRef = Logging.StandardOutLogger } @@ -821,23 +945,26 @@ object Logging { val StandardOutLogger = new StandardOutLogger /** - * Actor wrapper around the standard output logger. If - * akka.loggers is not set, it defaults to just this - * logger. - */ - class DefaultLogger extends Actor with StdOutLogger with RequiresMessageQueue[LoggerMessageQueueSemantics] { + * Actor wrapper around the standard output logger. If + * akka.loggers is not set, it defaults to just this + * logger. + */ + class DefaultLogger + extends Actor + with StdOutLogger + with RequiresMessageQueue[LoggerMessageQueueSemantics] { override def receive: Receive = { case InitializeLogger(_) ⇒ sender() ! LoggerInitialized - case event: LogEvent ⇒ print(event) + case event: LogEvent ⇒ print(event) } } /** - * Returns the StackTrace for the given Throwable as a String - */ + * Returns the StackTrace for the given Throwable as a String + */ def stackTraceFor(e: Throwable): String = e match { case null | Error.NoCause ⇒ "" - case _: NoStackTrace ⇒ " (" + e.getClass.getName + ")" + case _: NoStackTrace ⇒ " (" + e.getClass.getName + ")" case other ⇒ val sw = new java.io.StringWriter val pw = new java.io.PrintWriter(sw) @@ -853,24 +980,24 @@ object Logging { } /** - * Logging wrapper to make nicer and optimize: provide template versions which - * evaluate .toString only if the log level is actually enabled. Typically used - * by obtaining an implementation from the Logging object: - * - * {{{ - * val log = Logging(<bus>, <source object>) - * ... - * log.info("hello world!") - * }}} - * - * All log-level methods support simple interpolation templates with up to four - * arguments placed by using {} within the template (first string - * argument): - * - * {{{ - * log.error(exception, "Exception while processing {} in state {}", msg, state) - * }}} - */ + * Logging wrapper to make nicer and optimize: provide template versions which + * evaluate .toString only if the log level is actually enabled. Typically used + * by obtaining an implementation from the Logging object: + * + * {{{ + * val log = Logging(<bus>, <source object>) + * ... + * log.info("hello world!") + * }}} + * + * All log-level methods support simple interpolation templates with up to four + * arguments placed by using {} within the template (first string + * argument): + * + * {{{ + * log.error(exception, "Exception while processing {} in state {}", msg, state) + * }}} + */ trait LoggingAdapter { type MDC = Logging.MDC @@ -900,175 +1027,306 @@ trait LoggingAdapter { */ /** - * Log message at error level, including the exception that caused the error. - * @see [[LoggingAdapter]] - */ - def error(cause: Throwable, message: String): Unit = { if (isErrorEnabled) notifyError(cause, message) } + * Log message at error level, including the exception that caused the error. + * @see [[LoggingAdapter]] + */ + def error(cause: Throwable, message: String): Unit = { + if (isErrorEnabled) notifyError(cause, message) + } + /** - * Message template with 1 replacement argument. - * @see [[LoggingAdapter]] - */ - def error(cause: Throwable, template: String, arg1: Any): Unit = { if (isErrorEnabled) notifyError(cause, format1(template, arg1)) } + * Message template with 1 replacement argument. + * @see [[LoggingAdapter]] + */ + def error(cause: Throwable, template: String, arg1: Any): Unit = { + if (isErrorEnabled) notifyError(cause, format1(template, arg1)) + } + /** - * Message template with 2 replacement arguments. - * @see [[LoggingAdapter]] - */ - def error(cause: Throwable, template: String, arg1: Any, arg2: Any): Unit = { if (isErrorEnabled) notifyError(cause, format(template, arg1, arg2)) } + * Message template with 2 replacement arguments. + * @see [[LoggingAdapter]] + */ + def error(cause: Throwable, template: String, arg1: Any, arg2: Any): Unit = { + if (isErrorEnabled) notifyError(cause, format(template, arg1, arg2)) + } + /** - * Message template with 3 replacement arguments. - * @see [[LoggingAdapter]] - */ - def error(cause: Throwable, template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { if (isErrorEnabled) notifyError(cause, format(template, arg1, arg2, arg3)) } + * Message template with 3 replacement arguments. + * @see [[LoggingAdapter]] + */ + def error( + cause: Throwable, + template: String, + arg1: Any, + arg2: Any, + arg3: Any): Unit = { + if (isErrorEnabled) notifyError(cause, format(template, arg1, arg2, arg3)) + } + /** - * Message template with 4 replacement arguments. - * @see [[LoggingAdapter]] - */ - def error(cause: Throwable, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit = { if (isErrorEnabled) notifyError(cause, format(template, arg1, arg2, arg3, arg4)) } + * Message template with 4 replacement arguments. + * @see [[LoggingAdapter]] + */ + def error( + cause: Throwable, + template: String, + arg1: Any, + arg2: Any, + arg3: Any, + arg4: Any): Unit = { + if (isErrorEnabled) + notifyError(cause, format(template, arg1, arg2, arg3, arg4)) + } /** - * Log message at error level, without providing the exception that caused the error. - * @see [[LoggingAdapter]] - */ - def error(message: String): Unit = { if (isErrorEnabled) notifyError(message) } + * Log message at error level, without providing the exception that caused the error. + * @see [[LoggingAdapter]] + */ + def error(message: String): Unit = { + if (isErrorEnabled) notifyError(message) + } + /** - * Message template with 1 replacement argument. - * @see [[LoggingAdapter]] - */ - def error(template: String, arg1: Any): Unit = { if (isErrorEnabled) notifyError(format1(template, arg1)) } + * Message template with 1 replacement argument. + * @see [[LoggingAdapter]] + */ + def error(template: String, arg1: Any): Unit = { + if (isErrorEnabled) notifyError(format1(template, arg1)) + } + /** - * Message template with 2 replacement arguments. - * @see [[LoggingAdapter]] - */ - def error(template: String, arg1: Any, arg2: Any): Unit = { if (isErrorEnabled) notifyError(format(template, arg1, arg2)) } + * Message template with 2 replacement arguments. + * @see [[LoggingAdapter]] + */ + def error(template: String, arg1: Any, arg2: Any): Unit = { + if (isErrorEnabled) notifyError(format(template, arg1, arg2)) + } + /** - * Message template with 3 replacement arguments. - * @see [[LoggingAdapter]] - */ - def error(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { if (isErrorEnabled) notifyError(format(template, arg1, arg2, arg3)) } + * Message template with 3 replacement arguments. + * @see [[LoggingAdapter]] + */ + def error(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { + if (isErrorEnabled) notifyError(format(template, arg1, arg2, arg3)) + } + /** - * Message template with 4 replacement arguments. - * @see [[LoggingAdapter]] - */ - def error(template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit = { if (isErrorEnabled) notifyError(format(template, arg1, arg2, arg3, arg4)) } + * Message template with 4 replacement arguments. + * @see [[LoggingAdapter]] + */ + def error( + template: String, + arg1: Any, + arg2: Any, + arg3: Any, + arg4: Any): Unit = { + if (isErrorEnabled) notifyError(format(template, arg1, arg2, arg3, arg4)) + } /** - * Log message at warning level. - * @see [[LoggingAdapter]] - */ - def warning(message: String): Unit = { if (isWarningEnabled) notifyWarning(message) } + * Log message at warning level. + * @see [[LoggingAdapter]] + */ + def warning(message: String): Unit = { + if (isWarningEnabled) notifyWarning(message) + } + /** - * Message template with 1 replacement argument. - * @see [[LoggingAdapter]] - */ - def warning(template: String, arg1: Any): Unit = { if (isWarningEnabled) notifyWarning(format1(template, arg1)) } + * Message template with 1 replacement argument. + * @see [[LoggingAdapter]] + */ + def warning(template: String, arg1: Any): Unit = { + if (isWarningEnabled) notifyWarning(format1(template, arg1)) + } + /** - * Message template with 2 replacement arguments. - * @see [[LoggingAdapter]] - */ - def warning(template: String, arg1: Any, arg2: Any): Unit = { if (isWarningEnabled) notifyWarning(format(template, arg1, arg2)) } + * Message template with 2 replacement arguments. + * @see [[LoggingAdapter]] + */ + def warning(template: String, arg1: Any, arg2: Any): Unit = { + if (isWarningEnabled) notifyWarning(format(template, arg1, arg2)) + } + /** - * Message template with 3 replacement arguments. - * @see [[LoggingAdapter]] - */ - def warning(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { if (isWarningEnabled) notifyWarning(format(template, arg1, arg2, arg3)) } + * Message template with 3 replacement arguments. + * @see [[LoggingAdapter]] + */ + def warning(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { + if (isWarningEnabled) notifyWarning(format(template, arg1, arg2, arg3)) + } + /** - * Message template with 4 replacement arguments. - * @see [[LoggingAdapter]] - */ - def warning(template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit = { if (isWarningEnabled) notifyWarning(format(template, arg1, arg2, arg3, arg4)) } + * Message template with 4 replacement arguments. + * @see [[LoggingAdapter]] + */ + def warning( + template: String, + arg1: Any, + arg2: Any, + arg3: Any, + arg4: Any): Unit = { + if (isWarningEnabled) + notifyWarning(format(template, arg1, arg2, arg3, arg4)) + } /** - * Log message at info level. - * @see [[LoggingAdapter]] - */ + * Log message at info level. + * @see [[LoggingAdapter]] + */ def info(message: String) { if (isInfoEnabled) notifyInfo(message) } + /** - * Message template with 1 replacement argument. - * @see [[LoggingAdapter]] - */ - def info(template: String, arg1: Any): Unit = { if (isInfoEnabled) notifyInfo(format1(template, arg1)) } + * Message template with 1 replacement argument. + * @see [[LoggingAdapter]] + */ + def info(template: String, arg1: Any): Unit = { + if (isInfoEnabled) notifyInfo(format1(template, arg1)) + } + /** - * Message template with 2 replacement arguments. - * @see [[LoggingAdapter]] - */ - def info(template: String, arg1: Any, arg2: Any): Unit = { if (isInfoEnabled) notifyInfo(format(template, arg1, arg2)) } + * Message template with 2 replacement arguments. + * @see [[LoggingAdapter]] + */ + def info(template: String, arg1: Any, arg2: Any): Unit = { + if (isInfoEnabled) notifyInfo(format(template, arg1, arg2)) + } + /** - * Message template with 3 replacement arguments. - * @see [[LoggingAdapter]] - */ - def info(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { if (isInfoEnabled) notifyInfo(format(template, arg1, arg2, arg3)) } + * Message template with 3 replacement arguments. + * @see [[LoggingAdapter]] + */ + def info(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { + if (isInfoEnabled) notifyInfo(format(template, arg1, arg2, arg3)) + } + /** - * Message template with 4 replacement arguments. - * @see [[LoggingAdapter]] - */ - def info(template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit = { if (isInfoEnabled) notifyInfo(format(template, arg1, arg2, arg3, arg4)) } + * Message template with 4 replacement arguments. + * @see [[LoggingAdapter]] + */ + def info( + template: String, + arg1: Any, + arg2: Any, + arg3: Any, + arg4: Any): Unit = { + if (isInfoEnabled) notifyInfo(format(template, arg1, arg2, arg3, arg4)) + } /** - * Log message at debug level. - * @see [[LoggingAdapter]] - */ + * Log message at debug level. + * @see [[LoggingAdapter]] + */ def debug(message: String) { if (isDebugEnabled) notifyDebug(message) } + /** - * Message template with 1 replacement argument. - * @see [[LoggingAdapter]] - */ - def debug(template: String, arg1: Any): Unit = { if (isDebugEnabled) notifyDebug(format1(template, arg1)) } + * Message template with 1 replacement argument. + * @see [[LoggingAdapter]] + */ + def debug(template: String, arg1: Any): Unit = { + if (isDebugEnabled) notifyDebug(format1(template, arg1)) + } + /** - * Message template with 2 replacement arguments. - * @see [[LoggingAdapter]] - */ - def debug(template: String, arg1: Any, arg2: Any): Unit = { if (isDebugEnabled) notifyDebug(format(template, arg1, arg2)) } + * Message template with 2 replacement arguments. + * @see [[LoggingAdapter]] + */ + def debug(template: String, arg1: Any, arg2: Any): Unit = { + if (isDebugEnabled) notifyDebug(format(template, arg1, arg2)) + } + /** - * Message template with 3 replacement arguments. - * @see [[LoggingAdapter]] - */ - def debug(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { if (isDebugEnabled) notifyDebug(format(template, arg1, arg2, arg3)) } + * Message template with 3 replacement arguments. + * @see [[LoggingAdapter]] + */ + def debug(template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { + if (isDebugEnabled) notifyDebug(format(template, arg1, arg2, arg3)) + } + /** - * Message template with 4 replacement arguments. - * @see [[LoggingAdapter]] - */ - def debug(template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit = { if (isDebugEnabled) notifyDebug(format(template, arg1, arg2, arg3, arg4)) } + * Message template with 4 replacement arguments. + * @see [[LoggingAdapter]] + */ + def debug( + template: String, + arg1: Any, + arg2: Any, + arg3: Any, + arg4: Any): Unit = { + if (isDebugEnabled) notifyDebug(format(template, arg1, arg2, arg3, arg4)) + } /** - * Log message at the specified log level. - */ - def log(level: Logging.LogLevel, message: String) { if (isEnabled(level)) notifyLog(level, message) } + * Log message at the specified log level. + */ + def log(level: Logging.LogLevel, message: String) { + if (isEnabled(level)) notifyLog(level, message) + } + /** - * Message template with 1 replacement argument. - */ - def log(level: Logging.LogLevel, template: String, arg1: Any): Unit = { if (isEnabled(level)) notifyLog(level, format1(template, arg1)) } + * Message template with 1 replacement argument. + */ + def log(level: Logging.LogLevel, template: String, arg1: Any): Unit = { + if (isEnabled(level)) notifyLog(level, format1(template, arg1)) + } + /** - * Message template with 2 replacement arguments. - */ - def log(level: Logging.LogLevel, template: String, arg1: Any, arg2: Any): Unit = { if (isEnabled(level)) notifyLog(level, format(template, arg1, arg2)) } + * Message template with 2 replacement arguments. + */ + def log( + level: Logging.LogLevel, + template: String, + arg1: Any, + arg2: Any): Unit = { + if (isEnabled(level)) notifyLog(level, format(template, arg1, arg2)) + } + /** - * Message template with 3 replacement arguments. - */ - def log(level: Logging.LogLevel, template: String, arg1: Any, arg2: Any, arg3: Any): Unit = { if (isEnabled(level)) notifyLog(level, format(template, arg1, arg2, arg3)) } + * Message template with 3 replacement arguments. + */ + def log( + level: Logging.LogLevel, + template: String, + arg1: Any, + arg2: Any, + arg3: Any): Unit = { + if (isEnabled(level)) notifyLog(level, format(template, arg1, arg2, arg3)) + } + /** - * Message template with 4 replacement arguments. - */ - def log(level: Logging.LogLevel, template: String, arg1: Any, arg2: Any, arg3: Any, arg4: Any): Unit = { if (isEnabled(level)) notifyLog(level, format(template, arg1, arg2, arg3, arg4)) } + * Message template with 4 replacement arguments. + */ + def log( + level: Logging.LogLevel, + template: String, + arg1: Any, + arg2: Any, + arg3: Any, + arg4: Any): Unit = { + if (isEnabled(level)) + notifyLog(level, format(template, arg1, arg2, arg3, arg4)) + } /** - * @return true if the specified log level is enabled - */ + * @return true if the specified log level is enabled + */ final def isEnabled(level: Logging.LogLevel): Boolean = level match { - case Logging.ErrorLevel ⇒ isErrorEnabled + case Logging.ErrorLevel ⇒ isErrorEnabled case Logging.WarningLevel ⇒ isWarningEnabled - case Logging.InfoLevel ⇒ isInfoEnabled - case Logging.DebugLevel ⇒ isDebugEnabled + case Logging.InfoLevel ⇒ isInfoEnabled + case Logging.DebugLevel ⇒ isDebugEnabled } - final def notifyLog(level: Logging.LogLevel, message: String): Unit = level match { - case Logging.ErrorLevel ⇒ if (isErrorEnabled) notifyError(message) - case Logging.WarningLevel ⇒ if (isWarningEnabled) notifyWarning(message) - case Logging.InfoLevel ⇒ if (isInfoEnabled) notifyInfo(message) - case Logging.DebugLevel ⇒ if (isDebugEnabled) notifyDebug(message) - } + final def notifyLog(level: Logging.LogLevel, message: String): Unit = + level match { + case Logging.ErrorLevel ⇒ if (isErrorEnabled) notifyError(message) + case Logging.WarningLevel ⇒ if (isWarningEnabled) notifyWarning(message) + case Logging.InfoLevel ⇒ if (isInfoEnabled) notifyInfo(message) + case Logging.DebugLevel ⇒ if (isDebugEnabled) notifyDebug(message) + } private def format1(t: String, arg: Any): String = arg match { - case a: Array[_] if !a.getClass.getComponentType.isPrimitive ⇒ format(t, a: _*) + case a: Array[_] if !a.getClass.getComponentType.isPrimitive ⇒ + format(t, a: _*) case a: Array[_] ⇒ format(t, (a map (_.asInstanceOf[AnyRef]): _*)) case x ⇒ format(t, x) } @@ -1080,7 +1338,9 @@ trait LoggingAdapter { while (p < arg.length) { val index = rest.indexOf("{}") if (index == -1) { - sb.append(rest).append(" WARNING arguments left: ").append(arg.length - p) + sb.append(rest) + .append(" WARNING arguments left: ") + .append(arg.length - p) rest = "" p = arg.length } else { @@ -1094,15 +1354,15 @@ trait LoggingAdapter { } /** - * Filter of log events that is used by the `LoggingAdapter` before - * publishing log events to the `eventStream`. It can perform - * fine grained filtering based on the log source. - * - * Note that the [[EventStream]] will only subscribe `loggers` to the events - * corresponding to the `logLevel` of the `EventStream`. Therefore it is good - * practice that the `LoggingFilter` implementation first filters using the - * `logLevel` of the `EventStream` before applying more fine grained filters. - */ + * Filter of log events that is used by the `LoggingAdapter` before + * publishing log events to the `eventStream`. It can perform + * fine grained filtering based on the log source. + * + * Note that the [[EventStream]] will only subscribe `loggers` to the events + * corresponding to the `logLevel` of the `EventStream`. Therefore it is good + * practice that the `LoggingFilter` implementation first filters using the + * `logLevel` of the `EventStream` before applying more fine grained filters. + */ trait LoggingFilter { def isErrorEnabled(logClass: Class[_], logSource: String): Boolean def isWarningEnabled(logClass: Class[_], logSource: String): Boolean @@ -1111,28 +1371,34 @@ trait LoggingFilter { } /** - * Default [[LoggingFilter]] that uses the logLevel of the `eventStream`, which - * initial value is defined in configuration. The logLevel `eventStream` can be - * changed while the system is running. - */ -class DefaultLoggingFilter(logLevel: () ⇒ Logging.LogLevel) extends LoggingFilter { + * Default [[LoggingFilter]] that uses the logLevel of the `eventStream`, which + * initial value is defined in configuration. The logLevel `eventStream` can be + * changed while the system is running. + */ +class DefaultLoggingFilter(logLevel: () ⇒ Logging.LogLevel) + extends LoggingFilter { - def this(settings: Settings, eventStream: EventStream) = this(() ⇒ eventStream.logLevel) + def this(settings: Settings, eventStream: EventStream) = + this(() ⇒ eventStream.logLevel) import Logging._ - def isErrorEnabled(logClass: Class[_], logSource: String) = logLevel() >= ErrorLevel - def isWarningEnabled(logClass: Class[_], logSource: String) = logLevel() >= WarningLevel - def isInfoEnabled(logClass: Class[_], logSource: String) = logLevel() >= InfoLevel - def isDebugEnabled(logClass: Class[_], logSource: String) = logLevel() >= DebugLevel + def isErrorEnabled(logClass: Class[_], logSource: String) = + logLevel() >= ErrorLevel + def isWarningEnabled(logClass: Class[_], logSource: String) = + logLevel() >= WarningLevel + def isInfoEnabled(logClass: Class[_], logSource: String) = + logLevel() >= InfoLevel + def isDebugEnabled(logClass: Class[_], logSource: String) = + logLevel() >= DebugLevel } /** - * LoggingAdapter extension which adds MDC support. - * Only recommended to be used within Actors as it isn't thread safe. - */ + * LoggingAdapter extension which adds MDC support. + * Only recommended to be used within Actors as it isn't thread safe. + */ trait DiagnosticLoggingAdapter extends LoggingAdapter { - import java.{ util ⇒ ju } + import java.{util ⇒ ju} import Logging._ @@ -1141,62 +1407,67 @@ trait DiagnosticLoggingAdapter extends LoggingAdapter { private var _mdc = emptyMDC /** - * Scala API: - * Mapped Diagnostic Context for application defined values - * which can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. - * Visit Logback Docs: MDC for more information. - * - * @return A Map containing the MDC values added by the application, or empty Map if no value was added. - */ + * Scala API: + * Mapped Diagnostic Context for application defined values + * which can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. + * Visit Logback Docs: MDC for more information. + * + * @return A Map containing the MDC values added by the application, or empty Map if no value was added. + */ override def mdc: MDC = _mdc /** - * Scala API: - * Sets the values to be added to the MDC (Mapped Diagnostic Context) before the log is appended. - * These values can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. - * Visit Logback Docs: MDC for more information. - */ + * Scala API: + * Sets the values to be added to the MDC (Mapped Diagnostic Context) before the log is appended. + * These values can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. + * Visit Logback Docs: MDC for more information. + */ def mdc(mdc: MDC): Unit = _mdc = if (mdc != null) mdc else emptyMDC /** - * Java API: - * Mapped Diagnostic Context for application defined values - * which can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. - * Visit Logback Docs: MDC for more information. - * Note tha it returns a COPY of the actual MDC values. - * You cannot modify any value by changing the returned Map. - * Code like the following won't have any effect unless you set back the modified Map. - * - * {{{ - * Map mdc = log.getMDC(); - * mdc.put("key", value); - * // NEEDED - * log.setMDC(mdc); - * }}} - * - * @return A copy of the actual MDC values - */ + * Java API: + * Mapped Diagnostic Context for application defined values + * which can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. + * Visit Logback Docs: MDC for more information. + * Note tha it returns a COPY of the actual MDC values. + * You cannot modify any value by changing the returned Map. + * Code like the following won't have any effect unless you set back the modified Map. + * + * {{{ + * Map mdc = log.getMDC(); + * mdc.put("key", value); + * // NEEDED + * log.setMDC(mdc); + * }}} + * + * @return A copy of the actual MDC values + */ def getMDC: ju.Map[String, Any] = mdc.asJava /** - * Java API: - * Sets the values to be added to the MDC (Mapped Diagnostic Context) before the log is appended. - * These values can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. - * Visit Logback Docs: MDC for more information. - */ - def setMDC(jMdc: java.util.Map[String, Any]): Unit = mdc(if (jMdc != null) jMdc.asScala.toMap else emptyMDC) + * Java API: + * Sets the values to be added to the MDC (Mapped Diagnostic Context) before the log is appended. + * These values can be used in PatternLayout when `akka.event.slf4j.Slf4jLogger` is configured. + * Visit Logback Docs: MDC for more information. + */ + def setMDC(jMdc: java.util.Map[String, Any]): Unit = + mdc(if (jMdc != null) jMdc.asScala.toMap else emptyMDC) /** - * Clear all entries in the MDC - */ + * Clear all entries in the MDC + */ def clearMDC(): Unit = mdc(emptyMDC) } /** - * [[akka.event.LoggingAdapter]] that publishes [[akka.event.Logging.LogEvent]] to event stream. - */ -class BusLogging(val bus: LoggingBus, val logSource: String, val logClass: Class[_], loggingFilter: LoggingFilter) - extends LoggingAdapter { + * [[akka.event.LoggingAdapter]] that publishes [[akka.event.Logging.LogEvent]] to event stream. + */ +class BusLogging( + val bus: LoggingBus, + val logSource: String, + val logClass: Class[_], + loggingFilter: LoggingFilter) + extends LoggingAdapter { // For backwards compatibility, and when LoggingAdapter is created without direct // association to an ActorSystem @@ -1210,22 +1481,27 @@ class BusLogging(val bus: LoggingBus, val logSource: String, val logClass: Class def isInfoEnabled = loggingFilter.isInfoEnabled(logClass, logSource) def isDebugEnabled = loggingFilter.isDebugEnabled(logClass, logSource) - protected def notifyError(message: String): Unit = bus.publish(Error(logSource, logClass, message, mdc)) - protected def notifyError(cause: Throwable, message: String): Unit = bus.publish(Error(cause, logSource, logClass, message, mdc)) - protected def notifyWarning(message: String): Unit = bus.publish(Warning(logSource, logClass, message, mdc)) - protected def notifyInfo(message: String): Unit = bus.publish(Info(logSource, logClass, message, mdc)) - protected def notifyDebug(message: String): Unit = bus.publish(Debug(logSource, logClass, message, mdc)) + protected def notifyError(message: String): Unit = + bus.publish(Error(logSource, logClass, message, mdc)) + protected def notifyError(cause: Throwable, message: String): Unit = + bus.publish(Error(cause, logSource, logClass, message, mdc)) + protected def notifyWarning(message: String): Unit = + bus.publish(Warning(logSource, logClass, message, mdc)) + protected def notifyInfo(message: String): Unit = + bus.publish(Info(logSource, logClass, message, mdc)) + protected def notifyDebug(message: String): Unit = + bus.publish(Debug(logSource, logClass, message, mdc)) } /** - * NoLogging is a LoggingAdapter that does absolutely nothing – no logging at all. - */ + * NoLogging is a LoggingAdapter that does absolutely nothing – no logging at all. + */ object NoLogging extends LoggingAdapter { /** - * Java API to return the reference to NoLogging - * @return The NoLogging instance - */ + * Java API to return the reference to NoLogging + * @return The NoLogging instance + */ def getInstance = this final override def isErrorEnabled = false @@ -1234,7 +1510,9 @@ object NoLogging extends LoggingAdapter { final override def isDebugEnabled = false final protected override def notifyError(message: String): Unit = () - final protected override def notifyError(cause: Throwable, message: String): Unit = () + final protected override def notifyError( + cause: Throwable, + message: String): Unit = () final protected override def notifyWarning(message: String): Unit = () final protected override def notifyInfo(message: String): Unit = () final protected override def notifyDebug(message: String): Unit = () diff --git a/repos/akka/akka-actor/src/main/scala/akka/io/UdpConnectedManager.scala b/repos/akka/akka-actor/src/main/scala/akka/io/UdpConnectedManager.scala index 260a298c951..9dbe6c13d53 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/io/UdpConnectedManager.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/io/UdpConnectedManager.scala @@ -18,7 +18,6 @@ private[io] class UdpConnectedManager(udpConn: UdpConnectedExt) case c: Connect ⇒ val commander = sender() // cache because we create a function that will run asynchly - registry ⇒ - Props(classOf[UdpConnection], udpConn, registry, commander, c) + registry ⇒ Props(classOf[UdpConnection], udpConn, registry, commander, c) } } diff --git a/repos/akka/akka-actor/src/main/scala/akka/japi/JavaAPI.scala b/repos/akka/akka-actor/src/main/scala/akka/japi/JavaAPI.scala index 1560c9c3da1..35277c1f871 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/japi/JavaAPI.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/japi/JavaAPI.scala @@ -129,9 +129,12 @@ abstract class JavaPartialFunction[A, B] extends AbstractPartialFunction[A, B] { @throws(classOf[Exception]) def apply(x: A, isCheck: Boolean): B - final def isDefinedAt(x: A): Boolean = try { apply(x, true); true } catch { - case NoMatch ⇒ false - } + final def isDefinedAt(x: A): Boolean = + try { + apply(x, true); true + } catch { + case NoMatch ⇒ false + } final override def apply(x: A): B = try apply(x, false) catch { diff --git a/repos/akka/akka-actor/src/main/scala/akka/pattern/AskSupport.scala b/repos/akka/akka-actor/src/main/scala/akka/pattern/AskSupport.scala index 34120b88985..0bbb8f51f7b 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/pattern/AskSupport.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/pattern/AskSupport.scala @@ -631,7 +631,9 @@ private[akka] final class PromiseActorRef private ( p = provider.tempPath() provider.registerTempActor(this, p) p - } finally { setState(p) } + } finally { + setState(p) + } } else path case p: ActorPath ⇒ p case StoppedWithPath(p) ⇒ p diff --git a/repos/akka/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala b/repos/akka/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala index a516a0ad5b9..2331edef4bf 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala @@ -180,9 +180,9 @@ final case class ConsistentHashingRoutingLogic( // tuple of routees and the ConsistentHash, updated together in updateConsistentHash private val consistentHashRef = - new AtomicReference[( - immutable.IndexedSeq[Routee], - ConsistentHash[ConsistentRoutee])]((null, null)) + new AtomicReference[ + (immutable.IndexedSeq[Routee], ConsistentHash[ConsistentRoutee])]( + (null, null)) override def select( message: Any, diff --git a/repos/akka/akka-actor/src/main/scala/akka/routing/SmallestMailbox.scala b/repos/akka/akka-actor/src/main/scala/akka/routing/SmallestMailbox.scala index 0a599607a84..e40b6befede 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/routing/SmallestMailbox.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/routing/SmallestMailbox.scala @@ -66,8 +66,8 @@ class SmallestMailboxRoutingLogic extends RoutingLogic { if (isSuspended(target)) Long.MaxValue - 1 else { //Just about better than the DeadLetters - (if (isProcessingMessage(target)) 1l else 0l) + - (if (!hasMessages(target)) 0l + (if (isProcessingMessage(target)) 1L else 0L) + + (if (!hasMessages(target)) 0L else { //Race between hasMessages and numberOfMessages here, unfortunate the numberOfMessages returns 0 if unknown val noOfMsgs: Long = if (deep) numberOfMessages(target) else 0 diff --git a/repos/akka/akka-actor/src/main/scala/akka/util/ByteIterator.scala b/repos/akka/akka-actor/src/main/scala/akka/util/ByteIterator.scala index e60e9db32e1..768cbf98ec3 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/util/ByteIterator.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/util/ByteIterator.scala @@ -40,7 +40,9 @@ object ByteIterator { final def next(): Byte = { if (!hasNext) Iterator.empty.next - else { val i = from; from = from + 1; array(i) } + else { + val i = from; from = from + 1; array(i) + } } def clear(): Unit = { @@ -94,7 +96,11 @@ object ByteIterator { final override def dropWhile(p: Byte ⇒ Boolean): this.type = { var stop = false while (!stop && hasNext) { - if (p(array(from))) { from = from + 1 } else { stop = true } + if (p(array(from))) { + from = from + 1 + } else { + stop = true + } } this } @@ -512,7 +518,9 @@ abstract class ByteIterator extends BufferedIterator[Byte] { override def indexWhere(p: Byte ⇒ Boolean): Int = { var index = 0 var found = false - while (!found && hasNext) if (p(next())) { found = true } else { + while (!found && hasNext) if (p(next())) { + found = true + } else { index += 1 } if (found) index else -1 diff --git a/repos/akka/akka-actor/src/main/scala/akka/util/Helpers.scala b/repos/akka/akka-actor/src/main/scala/akka/util/Helpers.scala index 6ce763e283f..30d26cd69ee 100644 --- a/repos/akka/akka-actor/src/main/scala/akka/util/Helpers.scala +++ b/repos/akka/akka-actor/src/main/scala/akka/util/Helpers.scala @@ -31,8 +31,8 @@ object Helpers { * sequence which cyclically is monotone without end. */ val diff = - ((System.identityHashCode(a) & 0xffffffffL) - - (System.identityHashCode(b) & 0xffffffffL)) + ((System.identityHashCode(a) & 0XFFFFFFFFL) - + (System.identityHashCode(b) & 0XFFFFFFFFL)) if (diff > 0) 1 else if (diff < 0) -1 else 0 } diff --git a/repos/akka/akka-bench-jmh/src/main/scala/akka/persistence/PersistenceActorDeferBenchmark.scala b/repos/akka/akka-bench-jmh/src/main/scala/akka/persistence/PersistenceActorDeferBenchmark.scala index 21db3b31f47..44004a90b2f 100644 --- a/repos/akka/akka-bench-jmh/src/main/scala/akka/persistence/PersistenceActorDeferBenchmark.scala +++ b/repos/akka/akka-bench-jmh/src/main/scala/akka/persistence/PersistenceActorDeferBenchmark.scala @@ -90,7 +90,7 @@ class `persistAsync, defer`(respondAfter: Int) extends PersistentActor { override def receiveCommand = { case n: Int => persistAsync(Evt(n)) { e => - } + } deferAsync(Evt(n)) { e => if (e.i == respondAfter) sender() ! e.i } @@ -107,9 +107,9 @@ class `persistAsync, defer, respond ASAP`(respondAfter: Int) override def receiveCommand = { case n: Int => persistAsync(Evt(n)) { e => - } + } deferAsync(Evt(n)) { e => - } + } if (n == respondAfter) sender() ! n } override def receiveRecover = { diff --git a/repos/akka/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala b/repos/akka/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala index 02bfd99d28b..05b9463c2b4 100644 --- a/repos/akka/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala +++ b/repos/akka/akka-camel/src/main/scala/akka/camel/internal/component/ActorComponent.scala @@ -220,7 +220,9 @@ private[camel] class ActorProducer(val endpoint: ActorEndpoint, camel: Camel) private def fireAndForget( message: CamelMessage, exchange: CamelExchangeAdapter): Unit = - try { actorFor(endpoint.path) ! message } catch { + try { + actorFor(endpoint.path) ! message + } catch { case NonFatal(e) ⇒ exchange.setFailure(new FailureResult(e)) } diff --git a/repos/akka/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/ClusterMetricsRouting.scala b/repos/akka/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/ClusterMetricsRouting.scala index 1c8a539b553..3907aad1a49 100644 --- a/repos/akka/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/ClusterMetricsRouting.scala +++ b/repos/akka/akka-cluster-metrics/src/main/scala/akka/cluster/metrics/ClusterMetricsRouting.scala @@ -44,10 +44,9 @@ final case class AdaptiveLoadBalancingRoutingLogic( // The current weighted routees, if any. Weights are produced by the metricsSelector // via the metricsListener Actor. It's only updated by the actor, but accessed from // the threads of the sender()s. - private val weightedRouteesRef = new AtomicReference[( - immutable.IndexedSeq[Routee], - Set[NodeMetrics], - Option[WeightedRoutees])]((Vector.empty, Set.empty, None)) + private val weightedRouteesRef = new AtomicReference[ + (immutable.IndexedSeq[Routee], Set[NodeMetrics], Option[WeightedRoutees])]( + (Vector.empty, Set.empty, None)) @tailrec final def metricsChanged(event: ClusterMetricsChanged): Unit = { val oldValue = weightedRouteesRef.get diff --git a/repos/akka/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala b/repos/akka/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala index 3db0c01d193..554630dda03 100644 --- a/repos/akka/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala +++ b/repos/akka/akka-cluster-metrics/src/test/scala/akka/cluster/metrics/MetricSpec.scala @@ -339,7 +339,7 @@ class MetricValuesSpec n.copy(metrics = collector.sample.metrics.flatMap(latest ⇒ n.metrics.collect { case streaming if latest sameAs streaming ⇒ streaming :+ latest - })) + })) } } } diff --git a/repos/akka/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ShardCoordinator.scala b/repos/akka/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ShardCoordinator.scala index eb2bff88859..e683ba84d99 100644 --- a/repos/akka/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ShardCoordinator.scala +++ b/repos/akka/akka-cluster-sharding/src/main/scala/akka/cluster/sharding/ShardCoordinator.scala @@ -264,7 +264,7 @@ object ShardCoordinator { /** * `ShardRegion` replies with this message for [[HostShard]] requests which lead to it hosting the shard */ - @SerialVersionUID(1l) + @SerialVersionUID(1L) final case class ShardStarted(shard: ShardId) extends CoordinatorMessage /** diff --git a/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala b/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala index eb7dd9da741..9b3803fd246 100644 --- a/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala +++ b/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingCustomShardAllocationSpec.scala @@ -40,7 +40,7 @@ object ClusterShardingCustomShardAllocationSpec { val extractShardId: ShardRegion.ExtractShardId = msg ⇒ msg match { case id: Int ⇒ id.toString - } + } case object AllocateReq case class UseRegion(region: ActorRef) diff --git a/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala b/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala index 95bbbe4c50b..6c89be9cedc 100644 --- a/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala +++ b/repos/akka/akka-cluster-sharding/src/multi-jvm/scala/akka/cluster/sharding/ClusterShardingGracefulShutdownSpec.scala @@ -40,7 +40,7 @@ object ClusterShardingGracefulShutdownSpec { val extractShardId: ShardRegion.ExtractShardId = msg ⇒ msg match { case id: Int ⇒ id.toString - } + } //#graceful-shutdown class IllustrateGracefulShutdown extends Actor { diff --git a/repos/akka/akka-cluster-tools/src/main/scala/akka/cluster/pubsub/DistributedPubSubMediator.scala b/repos/akka/akka-cluster-tools/src/main/scala/akka/cluster/pubsub/DistributedPubSubMediator.scala index 0136b00a76c..4f3fdb391f3 100644 --- a/repos/akka/akka-cluster-tools/src/main/scala/akka/cluster/pubsub/DistributedPubSubMediator.scala +++ b/repos/akka/akka-cluster-tools/src/main/scala/akka/cluster/pubsub/DistributedPubSubMediator.scala @@ -567,12 +567,11 @@ class DistributedPubSubMediator(settings: DistributedPubSubSettings) // the version is a timestamp because it is also used when pruning removed entries val nextVersion = { var version = 0L - () ⇒ - { - val current = System.currentTimeMillis - version = if (current > version) current else version + 1 - version - } + () ⇒ { + val current = System.currentTimeMillis + version = if (current > version) current else version + 1 + version + } } override def preStart(): Unit = { diff --git a/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/AdaptiveLoadBalancing.scala b/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/AdaptiveLoadBalancing.scala index 86f1eea3064..6a7a5268379 100644 --- a/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/AdaptiveLoadBalancing.scala +++ b/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/AdaptiveLoadBalancing.scala @@ -56,10 +56,9 @@ final case class AdaptiveLoadBalancingRoutingLogic( // The current weighted routees, if any. Weights are produced by the metricsSelector // via the metricsListener Actor. It's only updated by the actor, but accessed from // the threads of the sender()s. - private val weightedRouteesRef = new AtomicReference[( - immutable.IndexedSeq[Routee], - Set[NodeMetrics], - Option[WeightedRoutees])]((Vector.empty, Set.empty, None)) + private val weightedRouteesRef = new AtomicReference[ + (immutable.IndexedSeq[Routee], Set[NodeMetrics], Option[WeightedRoutees])]( + (Vector.empty, Set.empty, None)) @tailrec final def metricsChanged(event: ClusterMetricsChanged): Unit = { val oldValue = weightedRouteesRef.get diff --git a/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/ClusterRouterConfig.scala b/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/ClusterRouterConfig.scala index edfc4b90bc2..19a48adb7d2 100644 --- a/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/ClusterRouterConfig.scala +++ b/repos/akka/akka-cluster/src/main/scala/akka/cluster/routing/ClusterRouterConfig.scala @@ -79,7 +79,7 @@ final case class ClusterRouterGroupSettings( case _ ⇒ throw new IllegalArgumentException( s"routeesPaths [$p] is not a valid actor path without address information") - }) + }) } object ClusterRouterPoolSettings { diff --git a/repos/akka/akka-cluster/src/test/scala/akka/cluster/MetricValuesSpec.scala b/repos/akka/akka-cluster/src/test/scala/akka/cluster/MetricValuesSpec.scala index 4eedba7bc95..dcd27ba929e 100644 --- a/repos/akka/akka-cluster/src/test/scala/akka/cluster/MetricValuesSpec.scala +++ b/repos/akka/akka-cluster/src/test/scala/akka/cluster/MetricValuesSpec.scala @@ -32,7 +32,7 @@ class MetricValuesSpec n.copy(metrics = collector.sample.metrics.flatMap(latest ⇒ n.metrics.collect { case streaming if latest sameAs streaming ⇒ streaming :+ latest - })) + })) } } } diff --git a/repos/akka/akka-contrib/src/test/scala/akka/contrib/pattern/ReceivePipelineSpec.scala b/repos/akka/akka-contrib/src/test/scala/akka/contrib/pattern/ReceivePipelineSpec.scala index 8b895a52778..f303978af25 100644 --- a/repos/akka/akka-contrib/src/test/scala/akka/contrib/pattern/ReceivePipelineSpec.scala +++ b/repos/akka/akka-contrib/src/test/scala/akka/contrib/pattern/ReceivePipelineSpec.scala @@ -135,7 +135,7 @@ class ReceivePipelineSpec extends AkkaSpec with ImplicitSender { with AdderInterceptor with ToStringInterceptor)) replier ! 8L // unhandled by all interceptors but still replied expectMsg(8L) - replier ! Set(8F) // unhandled by all but ToString Interceptor, so replied as String + replier ! Set(8f) // unhandled by all but ToString Interceptor, so replied as String expectMsg("Set(8.0)") } diff --git a/repos/akka/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala b/repos/akka/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala index 80fac590002..8649c7cf952 100644 --- a/repos/akka/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala +++ b/repos/akka/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala @@ -118,7 +118,7 @@ class HttpServerExampleSpec Flow[IncomingConnection].watchTermination()((_, termination) => termination.onFailure { case cause => failureMonitor ! cause - }) + }) serverSource .via(reactToTopLevelFailures) diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolSlot.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolSlot.scala index d21bb02817d..fc5f678a5d5 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolSlot.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/client/PoolSlot.scala @@ -175,7 +175,9 @@ private object PoolSlot { context.become(running(connInport, connOutport)) case FromConnection(Cancel) ⇒ - if (!isActive) { cancel(); shutdown() } // else ignore and wait for accompanying OnComplete or OnError + if (!isActive) { + cancel(); shutdown() + } // else ignore and wait for accompanying OnComplete or OnError case FromConnection(OnComplete) ⇒ handleDisconnect(sender(), None, Some(firstRequest)) case FromConnection(OnError(e)) ⇒ @@ -193,7 +195,9 @@ private object PoolSlot { case FromConnection(Request(n)) ⇒ request(n) case FromConnection(Cancel) ⇒ - if (!isActive) { cancel(); shutdown() } // else ignore and wait for accompanying OnComplete or OnError + if (!isActive) { + cancel(); shutdown() + } // else ignore and wait for accompanying OnComplete or OnError case FromConnection(OnNext(response: HttpResponse)) ⇒ val requestContext = inflightRequests.head diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/parsing/BodyPartParser.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/parsing/BodyPartParser.scala index 0047062a647..22e807b556a 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/parsing/BodyPartParser.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/parsing/BodyPartParser.scala @@ -275,8 +275,7 @@ private[http] final class BodyPartParser( next: (ByteString, Int) ⇒ StateResult): StateResult = { state = math.signum(offset - input.length) match { case -1 ⇒ - more ⇒ - next(input ++ more, offset) + more ⇒ next(input ++ more, offset) case 0 ⇒ next(_, 0) case 1 ⇒ throw new IllegalStateException } diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/rendering/HttpResponseRendererFactory.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/rendering/HttpResponseRendererFactory.scala index b2b30d29788..d878684a366 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/rendering/HttpResponseRendererFactory.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/rendering/HttpResponseRendererFactory.scala @@ -33,8 +33,7 @@ private[http] class HttpResponseRendererFactory( val bytes = (new ByteArrayRendering(32) ~~ h ~~ CrLf).get _ ~~ bytes case None ⇒ - _ ⇒ - () + _ ⇒ () } // as an optimization we cache the Date header of the last second here diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/server/HttpServerBluePrint.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/server/HttpServerBluePrint.scala index 3940c80e306..26823570690 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/server/HttpServerBluePrint.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/server/HttpServerBluePrint.scala @@ -714,7 +714,7 @@ private[http] object HttpServerBluePrint { } ctx.pull() } - }) + }) .named("expect100continueTrigger")) } } diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/Rendering.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/Rendering.scala index abbbe1d8cc9..e45068a56b2 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/Rendering.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/Rendering.scala @@ -52,7 +52,9 @@ private[http] trait LazyValueBytesRenderable extends Renderable { private[this] var _valueBytes: Array[Byte] = _ private def valueBytes = if (_valueBytes != null) _valueBytes - else { _valueBytes = value.asciiBytes; _valueBytes } + else { + _valueBytes = value.asciiBytes; _valueBytes + } def value: String def render[R <: Rendering](r: R): r.type = r ~~ valueBytes @@ -181,14 +183,18 @@ private[http] trait Rendering { def ~~(string: String): this.type = { @tailrec def rec(ix: Int = 0): this.type = - if (ix < string.length) { this ~~ string.charAt(ix); rec(ix + 1) } else + if (ix < string.length) { + this ~~ string.charAt(ix); rec(ix + 1) + } else this rec() } def ~~(chars: Array[Char]): this.type = { @tailrec def rec(ix: Int = 0): this.type = - if (ix < chars.length) { this ~~ chars(ix); rec(ix + 1) } else this + if (ix < chars.length) { + this ~~ chars(ix); rec(ix + 1) + } else this rec() } diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/StreamUtils.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/StreamUtils.scala index bf1fb58b2c9..74f5e22e2e4 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/StreamUtils.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/StreamUtils.scala @@ -299,8 +299,7 @@ private[http] object StreamUtils { ctx.absorbTermination() } else super.onUpstreamFailure(cause, ctx) } - () ⇒ - stage + () ⇒ stage } /** diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/package.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/package.scala index b1a7b2a7279..55a87410ce5 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/package.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/util/package.scala @@ -76,7 +76,7 @@ package object util { println(s"$marker: Cancel") super.onDownstreamFinish(ctx) } - }) + }) private[this] var eventStreamLogger: ActorRef = _ private[http] def installEventStreamLoggerFor(channel: Class[_])( diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/DateTime.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/DateTime.scala index bae25ce38da..4eacd434cb7 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/DateTime.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/DateTime.scala @@ -225,19 +225,25 @@ object DateTime { var dn = (s / 86400).toInt s %= 86400 // positive seconds since beginning of day - if (s < 0) { s += 86400; dn -= 1 } + if (s < 0) { + s += 86400; dn -= 1 + } dn += 1969 * 365 + 492 - 19 + 4 // days since "1 Jan, year 1" // convert days since 1 Jan, year 1 to year/yearday var y = 400 * (dn / 146097) + 1 var d = dn % 146097 - if (d == 146096) { y += 399; d = 365 } // last year of 400 is long + if (d == 146096) { + y += 399; d = 365 + } // last year of 400 is long else { y += 100 * (d / 36524) d %= 36524 y += (d / 1461) << 2 d %= 1461 - if (d == 1460) { y += 3; d = 365 } // last year out of 4 is long + if (d == 1460) { + y += 3; d = 365 + } // last year out of 4 is long else { y += d / 365 d %= 365 diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/Uri.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/Uri.scala index 46252f0720a..6433e9b3106 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/Uri.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/Uri.scala @@ -1151,7 +1151,9 @@ object UriRendering { def append(s: String) = s.getBytes(charset).foreach(appendEncoded) if (Character.isHighSurrogate(c)) { append(new String(Array(string codePointAt ix), 0, 1)); 2 - } else { append(c.toString); 1 } + } else { + append(c.toString); 1 + } } rec(ix + charSize) } else r diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/headers/HttpCredentials.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/headers/HttpCredentials.scala index 19b87dc0387..d56abe88fe2 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/headers/HttpCredentials.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/scaladsl/model/headers/HttpCredentials.scala @@ -66,7 +66,9 @@ final case class GenericHttpCredentials( var first = true def apply(kvp: (String, String)): Unit = { val (k, v) = kvp - if (first) { r ~~ ' '; first = false } else r ~~ ',' + if (first) { + r ~~ ' '; first = false + } else r ~~ ',' if (!k.isEmpty) r ~~ k ~~ '=' r ~~# v } diff --git a/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala b/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala index 59abc45dcbb..e2139c35041 100644 --- a/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala +++ b/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala @@ -675,7 +675,7 @@ class ResponseRendererSpec |${if (resCD) "" else "Content-Length: 6\n"} |${if (headReq) "" else "ENTITY"}""", close - )) + )) } } diff --git a/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/ws/FramingSpec.scala b/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/ws/FramingSpec.scala index 7d1b5cba91b..bc51ca8132b 100644 --- a/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/ws/FramingSpec.scala +++ b/repos/akka/akka-http-core/src/test/scala/akka/http/impl/engine/ws/FramingSpec.scala @@ -199,7 +199,7 @@ class FramingSpec extends FreeSpec with Matchers with WithMaterializerSpec { xxxxxxxx xxxxxxxx=0000000123456789 # length64 """ should parseTo( - FrameHeader(Opcode.Continuation, None, 0x123456789L, fin = false)) + FrameHeader(Opcode.Continuation, None, 0X123456789L, fin = false)) } "Long.MaxValue" in { b"""0000 # flags @@ -249,7 +249,7 @@ class FramingSpec extends FreeSpec with Matchers with WithMaterializerSpec { Seq(header, data) should parseMultipleTo( FrameStart( - FrameHeader(Opcode.Continuation, None, 0xFFFFFFFFL, fin = false), + FrameHeader(Opcode.Continuation, None, 0XFFFFFFFFL, fin = false), ByteString.empty), FrameData(data, lastPart = false)) } diff --git a/repos/akka/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTestResultComponent.scala b/repos/akka/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTestResultComponent.scala index 3a4fa99a03c..62d07ccaa73 100644 --- a/repos/akka/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTestResultComponent.scala +++ b/repos/akka/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTestResultComponent.scala @@ -88,8 +88,7 @@ trait RouteTestResultComponent { private[this] lazy val entityRecreator: () ⇒ ResponseEntity = rawResponse.entity match { case s: HttpEntity.Strict ⇒ - () ⇒ - s + () ⇒ s case HttpEntity.Default(contentType, contentLength, data) ⇒ val dataChunks = awaitAllElements(data); diff --git a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/DecoderSpec.scala b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/DecoderSpec.scala index 396798178bd..ecb8261b0cf 100644 --- a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/DecoderSpec.scala +++ b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/DecoderSpec.scala @@ -61,6 +61,6 @@ class DecoderSpec extends WordSpec with CodecSpecSupport { override def onPull(): Unit = pull(in) }) } - } + } } } diff --git a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala index e30cdd7196a..a4623f62ee7 100644 --- a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala +++ b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala @@ -48,7 +48,7 @@ object TestServer extends App { } ~ path("secure") { authenticateBasicPF("My very secure site", auth) { user ⇒ complete( - Hello { user }. Access has been granted!) + Hello {user}. Access has been granted!) } } ~ path("ping") { complete("PONG!") diff --git a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/CodingDirectivesSpec.scala b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/CodingDirectivesSpec.scala index f793bc92457..8d58a183594 100644 --- a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/CodingDirectivesSpec.scala +++ b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/CodingDirectivesSpec.scala @@ -236,7 +236,7 @@ class CodingDirectivesSpec extends RoutingSpec with Inside { val textChunks = () ⇒ text.grouped(8).map { chars ⇒ Chunk(chars.mkString): ChunkStreamPart - } + } val chunkedTextEntity = HttpEntity.Chunked( ContentTypes.`text/plain(UTF-8)`, Source.fromIterator(textChunks)) diff --git a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/MarshallingDirectivesSpec.scala b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/MarshallingDirectivesSpec.scala index 5184387b28e..b4be2153bcf 100644 --- a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/MarshallingDirectivesSpec.scala +++ b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/MarshallingDirectivesSpec.scala @@ -33,7 +33,7 @@ class MarshallingDirectivesSpec extends RoutingSpec with Inside { `application/xhtml+xml`, `text/xxml`) { mediaType ⇒ nodeSeqMarshaller(mediaType).wrap(mediaType) { (i: Int) ⇒ - { i } + {i} } } diff --git a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/PathDirectivesSpec.scala b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/PathDirectivesSpec.scala index 5e612b7ce5c..37857b8175e 100644 --- a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/PathDirectivesSpec.scala +++ b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/PathDirectivesSpec.scala @@ -337,7 +337,7 @@ class PathDirectivesSpec extends RoutingSpec with Inside { case None ⇒ failTest( "Example '" + exampleString + "' doesn't contain a test uri") - } + } } import akka.http.scaladsl.model.StatusCodes._ diff --git a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RouteDirectivesSpec.scala b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RouteDirectivesSpec.scala index cb17e293257..a31b9193c2b 100644 --- a/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RouteDirectivesSpec.scala +++ b/repos/akka/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RouteDirectivesSpec.scala @@ -154,7 +154,7 @@ class RouteDirectivesSpec extends FreeSpec with GenericRoutingSpec { val xmlMarshaller: ToEntityMarshaller[Data] = Marshaller.combined { (data: Data) ⇒ - { data.name }{ data.age } + {data.name}{data.age} } implicit val dataMarshaller: ToResponseMarshaller[Data] = diff --git a/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/directives/FileAndResourceDirectives.scala b/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/directives/FileAndResourceDirectives.scala index 2bec7b398a2..e82d314998e 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/directives/FileAndResourceDirectives.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/directives/FileAndResourceDirectives.scala @@ -64,8 +64,8 @@ object FileAndResourceRoute { */ private[http] def forFixedName(fileName: String)( f: ContentType ⇒ Route): FileAndResourceRoute = - new FileAndResourceRouteWithDefaultResolver( - resolver ⇒ f(resolver.resolve(fileName))) with FileAndResourceRoute { + new FileAndResourceRouteWithDefaultResolver(resolver ⇒ + f(resolver.resolve(fileName))) with FileAndResourceRoute { def withContentType(contentType: ContentType): Route = resolveContentTypeWith(StaticContentTypeResolver(contentType)) def resolveContentTypeWith(resolver: ContentTypeResolver): Route = diff --git a/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/values/PathMatchers.scala b/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/values/PathMatchers.scala index 68813063755..84de7e6ff0e 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/values/PathMatchers.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/javadsl/server/values/PathMatchers.scala @@ -144,6 +144,6 @@ object PathMatchers { new PathMatcherImpl[T](scalaMatcher(ScalaPathMatchers)) private def matcher0( scalaMatcher: ScalaPathMatchers.type ⇒ PathMatcher0): PathMatcher[Void] = - new PathMatcherImpl[Void]( - scalaMatcher(ScalaPathMatchers).tmap(_ ⇒ Tuple1(null))) + new PathMatcherImpl[Void](scalaMatcher(ScalaPathMatchers).tmap(_ ⇒ + Tuple1(null))) } diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/common/StrictForm.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/common/StrictForm.scala index 5384753c39e..b2e1301363e 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/common/StrictForm.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/common/StrictForm.scala @@ -57,7 +57,7 @@ object StrictForm { implicit mat ⇒ { case FromString(value) ⇒ um.unmarshalString(value) case FromPart(value) ⇒ um.unmarshalPart(value) - }) + }) def unmarshallerFromFSU[T]( fsu: FromStringUnmarshaller[T]): FromStrictFormFieldUnmarshaller[T] = @@ -71,7 +71,7 @@ object StrictForm { .nioCharset .name fsu(value.entity.data.decodeString(charsetName)) - }) + }) @implicitNotFound("In order to unmarshal a `StrictForm.Field` to type `${T}` you need to supply a " + "`FromStringUnmarshaller[${T}]` and/or a `FromEntityUnmarshaller[${T}]`") diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/marshalling/Marshal.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/marshalling/Marshal.scala index ba6035a1dc4..257f4db301c 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/marshalling/Marshal.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/marshalling/Marshal.scala @@ -66,8 +66,7 @@ class Marshal[A](val value: A) { case Marshalling.WithFixedContentType(`best`, marshal) ⇒ marshal case Marshalling.WithOpenCharset(`bestMT`, marshal) ⇒ - () ⇒ - marshal(bestCS) + () ⇒ marshal(bestCS) } } } else None diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/ExceptionHandler.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/ExceptionHandler.scala index ec10a627283..61583779ac6 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/ExceptionHandler.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/ExceptionHandler.scala @@ -46,24 +46,19 @@ object ExceptionHandler { def default(settings: RoutingSettings): ExceptionHandler = apply(knownToBeSealed = true) { case IllegalRequestException(info, status) ⇒ - ctx ⇒ - { - ctx.log.warning( - "Illegal request {}\n\t{}\n\tCompleting with '{}' response", - ctx.request, - info.formatPretty, - status) - ctx.complete((status, info.format(settings.verboseErrorMessages))) - } + ctx ⇒ { + ctx.log.warning( + "Illegal request {}\n\t{}\n\tCompleting with '{}' response", + ctx.request, + info.formatPretty, + status) + ctx.complete((status, info.format(settings.verboseErrorMessages))) + } case NonFatal(e) ⇒ - ctx ⇒ - { - ctx.log.error( - e, - "Error during processing of request {}", - ctx.request) - ctx.complete(InternalServerError) - } + ctx ⇒ { + ctx.log.error(e, "Error during processing of request {}", ctx.request) + ctx.complete(InternalServerError) + } } /** diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/DebuggingDirectives.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/DebuggingDirectives.scala index 2d71a731b3d..05a3a3a81d5 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/DebuggingDirectives.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/DebuggingDirectives.scala @@ -61,8 +61,7 @@ object LoggingMagnet { // # message-magnets forMessageFromFullShow[T] { val (marker, level) = markerAndLevel - Message ⇒ - LogEntry(Message, marker, level) + Message ⇒ LogEntry(Message, marker, level) } implicit def forMessageFromShow[T]( @@ -86,13 +85,14 @@ object LoggingMagnet { // # request-response-magnets forRequestResponseFromFullShow { val (marker, level) = markerAndLevel - request ⇒ response ⇒ - Some( - LogEntry( - "Response for\n Request : " + request + - "\n Response: " + response, - marker, - level)) + request ⇒ + response ⇒ + Some( + LogEntry( + "Response for\n Request : " + request + + "\n Response: " + response, + marker, + level)) } implicit def forRequestResponseFromFullShow( @@ -101,8 +101,7 @@ object LoggingMagnet { // # request-response-magnets LoggingMagnet { log ⇒ request ⇒ val showResult = show(request) - result ⇒ - showResult(result).foreach(_.logTo(log)) + result ⇒ showResult(result).foreach(_.logTo(log)) } } diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/HeaderDirectives.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/HeaderDirectives.scala index ad6702033d0..146f30d9bb9 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/HeaderDirectives.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/server/directives/HeaderDirectives.scala @@ -30,7 +30,7 @@ trait HeaderDirectives { header.name, e.getMessage.nullAsEmpty, Some(e)))) - } + } extract(_.request.headers.collectFirst(Function.unlift(protectedF))) .flatMap { diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/GenericUnmarshallers.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/GenericUnmarshallers.scala index 6910c61ff9a..c6c257b66c0 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/GenericUnmarshallers.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/GenericUnmarshallers.scala @@ -32,5 +32,5 @@ sealed trait LowerPriorityGenericUnmarshallers { implicit mat ⇒ { case Some(a) ⇒ um(a) case None ⇒ FastFuture.failed(Unmarshaller.NoContentException) - }) + }) } diff --git a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/PredefinedFromEntityUnmarshallers.scala b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/PredefinedFromEntityUnmarshallers.scala index 353164add2f..f93bdbac6e9 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/PredefinedFromEntityUnmarshallers.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/scaladsl/unmarshalling/PredefinedFromEntityUnmarshallers.scala @@ -14,7 +14,7 @@ trait PredefinedFromEntityUnmarshallers extends MultipartUnmarshallers { implicit mat ⇒ { case HttpEntity.Strict(_, data) ⇒ FastFuture.successful(data) case entity ⇒ entity.dataBytes.runFold(ByteString.empty)(_ ++ _) - }) + }) implicit def byteArrayUnmarshaller: FromEntityUnmarshaller[Array[Byte]] = byteStringUnmarshaller.map(_.toArray[Byte]) diff --git a/repos/akka/akka-parsing/src/main/scala/akka/parboiled2/CharUtils.scala b/repos/akka/akka-parsing/src/main/scala/akka/parboiled2/CharUtils.scala index e532f7bff1e..b05c7f55046 100644 --- a/repos/akka/akka-parsing/src/main/scala/akka/parboiled2/CharUtils.scala +++ b/repos/akka/akka-parsing/src/main/scala/akka/parboiled2/CharUtils.scala @@ -40,7 +40,7 @@ object CharUtils { * (fast branchless implementation) */ def lowerHexDigit(long: Long): Char = - lowerHexDigit_internal((long & 0x0FL).toInt) + lowerHexDigit_internal((long & 0X0FL).toInt) /** * Returns the lower-case hex digit corresponding to the last 4 bits of the given Int. @@ -56,7 +56,7 @@ object CharUtils { * (fast branchless implementation) */ def upperHexDigit(long: Long): Char = - upperHexDigit_internal((long & 0x0FL).toInt) + upperHexDigit_internal((long & 0X0FL).toInt) /** * Returns the upper-case hex digit corresponding to the last 4 bits of the given Int. diff --git a/repos/akka/akka-persistence/src/main/scala/akka/persistence/AtLeastOnceDelivery.scala b/repos/akka/akka-persistence/src/main/scala/akka/persistence/AtLeastOnceDelivery.scala index 3d861024530..73037e77dc2 100644 --- a/repos/akka/akka-persistence/src/main/scala/akka/persistence/AtLeastOnceDelivery.scala +++ b/repos/akka/akka-persistence/src/main/scala/akka/persistence/AtLeastOnceDelivery.scala @@ -229,7 +229,9 @@ trait AtLeastOnceDeliveryLike extends Eventsourced { val deliveryId = nextDeliverySequenceNr() val now = - if (recoveryRunning) { System.nanoTime() - redeliverInterval.toNanos } else + if (recoveryRunning) { + System.nanoTime() - redeliverInterval.toNanos + } else System.nanoTime() val d = Delivery(destination, deliveryIdToMessage(deliveryId), now, attempt = 0) diff --git a/repos/akka/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSM.scala b/repos/akka/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSM.scala index 98c62006e4a..4f69a36a555 100644 --- a/repos/akka/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSM.scala +++ b/repos/akka/akka-persistence/src/main/scala/akka/persistence/fsm/PersistentFSM.scala @@ -280,7 +280,7 @@ object PersistentFSM { replies: List[Any] = Nil, domainEvents: Seq[E] = Nil, afterTransitionDo: D ⇒ Unit = { _: D ⇒ - })(private[akka] val notifies: Boolean = true) { + })(private[akka] val notifies: Boolean = true) { /** * Copy object and update values if needed. diff --git a/repos/akka/akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbStore.scala b/repos/akka/akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbStore.scala index 995f3885eb9..e24ab49b875 100644 --- a/repos/akka/akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbStore.scala +++ b/repos/akka/akka-persistence/src/main/scala/akka/persistence/journal/leveldb/LeveldbStore.scala @@ -85,7 +85,7 @@ private[persistence] trait LeveldbStore if (hasPersistenceIdSubscribers) persistenceIds += a.persistenceId } - }) + }) }) if (hasPersistenceIdSubscribers) { diff --git a/repos/akka/akka-persistence/src/main/scala/akka/persistence/serialization/package.scala b/repos/akka/akka-persistence/src/main/scala/akka/persistence/serialization/package.scala index 13642c5bdf7..c63ac50ced5 100644 --- a/repos/akka/akka-persistence/src/main/scala/akka/persistence/serialization/package.scala +++ b/repos/akka/akka-persistence/src/main/scala/akka/persistence/serialization/package.scala @@ -18,7 +18,9 @@ package object serialization { @scala.annotation.tailrec def copy(): Array[Byte] = { val n = inputStream.read(buf, 0, len) - if (n != -1) { out.write(buf, 0, n); copy() } else out.toByteArray + if (n != -1) { + out.write(buf, 0, n); copy() + } else out.toByteArray } copy() diff --git a/repos/akka/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala b/repos/akka/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala index 8ff3dd865e7..dc86f23b6b2 100644 --- a/repos/akka/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala +++ b/repos/akka/akka-persistence/src/main/scala/akka/persistence/snapshot/local/LocalSnapshotStore.scala @@ -143,7 +143,11 @@ private[persistence] class LocalSnapshotStore p) private def withStream[A <: Closeable, B](stream: A, p: A ⇒ B): B = - try { p(stream) } finally { stream.close() } + try { + p(stream) + } finally { + stream.close() + } /** Only by persistenceId and sequenceNr, timestamp is informational - accomodates for 2.13.x series files */ private def snapshotFileForWrite( diff --git a/repos/akka/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryCrashSpec.scala b/repos/akka/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryCrashSpec.scala index d54bde2695c..1c33979a969 100644 --- a/repos/akka/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryCrashSpec.scala +++ b/repos/akka/akka-persistence/src/test/scala/akka/persistence/AtLeastOnceDeliveryCrashSpec.scala @@ -52,7 +52,7 @@ object AtLeastOnceDeliveryCrashSpec { case Message ⇒ persist(Message)(_ ⇒ send()) case CrashMessage ⇒ persist(CrashMessage) { evt ⇒ - } + } } def send() = { diff --git a/repos/akka/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala b/repos/akka/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala index 9cb85dbb915..7c965a847e7 100644 --- a/repos/akka/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala +++ b/repos/akka/akka-persistence/src/test/scala/akka/persistence/fsm/PersistentFSMSpec.scala @@ -31,9 +31,9 @@ abstract class PersistentFSMSpec(config: Config) watch(fsmRef) fsmRef ! SubscribeTransitionCallBack(testActor) - val shirt = Item("1", "Shirt", 59.99F) - val shoes = Item("2", "Shoes", 89.99F) - val coat = Item("3", "Coat", 119.99F) + val shirt = Item("1", "Shirt", 59.99f) + val shoes = Item("2", "Shoes", 89.99f) + val coat = Item("3", "Coat", 119.99f) fsmRef ! GetCurrentCart fsmRef ! AddItem(shirt) @@ -68,7 +68,7 @@ abstract class PersistentFSMSpec(config: Config) watch(fsmRef) fsmRef ! SubscribeTransitionCallBack(testActor) - val shirt = Item("1", "Shirt", 59.99F) + val shirt = Item("1", "Shirt", 59.99f) fsmRef ! AddItem(shirt) @@ -90,9 +90,9 @@ abstract class PersistentFSMSpec(config: Config) watch(fsmRef) fsmRef ! SubscribeTransitionCallBack(testActor) - val shirt = Item("1", "Shirt", 59.99F) - val shoes = Item("2", "Shoes", 89.99F) - val coat = Item("3", "Coat", 119.99F) + val shirt = Item("1", "Shirt", 59.99f) + val shoes = Item("2", "Shoes", 89.99f) + val coat = Item("3", "Coat", 119.99f) fsmRef ! GetCurrentCart fsmRef ! AddItem(shirt) @@ -144,9 +144,9 @@ abstract class PersistentFSMSpec(config: Config) watch(fsmRef) fsmRef ! SubscribeTransitionCallBack(testActor) - val shirt = Item("1", "Shirt", 59.99F) - val shoes = Item("2", "Shoes", 89.99F) - val coat = Item("3", "Coat", 119.99F) + val shirt = Item("1", "Shirt", 59.99f) + val shoes = Item("2", "Shoes", 89.99f) + val coat = Item("3", "Coat", 119.99f) fsmRef ! AddItem(shirt) fsmRef ! AddItem(shoes) @@ -170,9 +170,9 @@ abstract class PersistentFSMSpec(config: Config) watch(fsmRef) fsmRef ! SubscribeTransitionCallBack(testActor) - val shirt = Item("1", "Shirt", 59.99F) - val shoes = Item("2", "Shoes", 89.99F) - val coat = Item("3", "Coat", 119.99F) + val shirt = Item("1", "Shirt", 59.99f) + val shoes = Item("2", "Shoes", 89.99f) + val coat = Item("3", "Coat", 119.99f) fsmRef ! AddItem(shirt) fsmRef ! AddItem(shoes) @@ -193,7 +193,7 @@ abstract class PersistentFSMSpec(config: Config) watch(fsmRef) fsmRef ! SubscribeTransitionCallBack(testActor) - val shirt = Item("1", "Shirt", 59.99F) + val shirt = Item("1", "Shirt", 59.99f) fsmRef ! AddItem(shirt) @@ -251,9 +251,9 @@ abstract class PersistentFSMSpec(config: Config) WebStoreCustomerFSM.props(persistenceId, dummyReportActorRef)) watch(fsmRef) - val shirt = Item("1", "Shirt", 59.99F) - val shoes = Item("2", "Shoes", 89.99F) - val coat = Item("3", "Coat", 119.99F) + val shirt = Item("1", "Shirt", 59.99f) + val shoes = Item("2", "Shoes", 89.99f) + val coat = Item("3", "Coat", 119.99f) fsmRef ! GetCurrentCart fsmRef ! AddItem(shirt) @@ -279,13 +279,13 @@ abstract class PersistentFSMSpec(config: Config) val persistentEventsStreamer = system.actorOf(PersistentEventsStreamer.props(persistenceId, testActor)) - expectMsg(ItemAdded(Item("1", "Shirt", 59.99F))) + expectMsg(ItemAdded(Item("1", "Shirt", 59.99f))) expectMsgType[StateChangeEvent] //because a timeout is defined, State Change is persisted - expectMsg(ItemAdded(Item("2", "Shoes", 89.99F))) + expectMsg(ItemAdded(Item("2", "Shoes", 89.99f))) expectMsgType[StateChangeEvent] //because a timeout is defined, State Change is persisted - expectMsg(ItemAdded(Item("3", "Coat", 119.99F))) + expectMsg(ItemAdded(Item("3", "Coat", 119.99f))) expectMsgType[StateChangeEvent] //because a timeout is defined, State Change is persisted expectMsg(OrderExecuted) diff --git a/repos/akka/akka-remote/src/main/scala/akka/remote/security/provider/InternetSeedGenerator.scala b/repos/akka/akka-remote/src/main/scala/akka/remote/security/provider/InternetSeedGenerator.scala index 011ca32d247..ff7aacd3cb4 100644 --- a/repos/akka/akka-remote/src/main/scala/akka/remote/security/provider/InternetSeedGenerator.scala +++ b/repos/akka/akka-remote/src/main/scala/akka/remote/security/provider/InternetSeedGenerator.scala @@ -63,7 +63,7 @@ final class InternetSeedGenerator extends SeedGenerator { try Option(g.generateSeed(length)) catch { case _: SeedException ⇒ None - }) + }) .headOption .getOrElse(throw new IllegalStateException( "All available seed generation strategies failed.")) diff --git a/repos/akka/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala b/repos/akka/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala index a99c9d1d52f..69bec3f4e9f 100644 --- a/repos/akka/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala +++ b/repos/akka/akka-remote/src/main/scala/akka/remote/transport/netty/NettyTransport.scala @@ -620,7 +620,9 @@ class NettyTransport( log.error( "failed to bind to {}, shutting down Netty transport", address) - try { shutdown() } catch { case NonFatal(e) ⇒ } // ignore possible exception during shutdown + try { + shutdown() + } catch { case NonFatal(e) ⇒ } // ignore possible exception during shutdown throw e } } diff --git a/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/Coroner.scala b/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/Coroner.scala index b85572a746d..a6bce679353 100644 --- a/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/Coroner.scala +++ b/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/Coroner.scala @@ -69,7 +69,9 @@ object Coroner { } override def result(atMost: Duration)(implicit permit: CanAwait): Boolean = - try { Await.result(cancelPromise.future, atMost) } catch { + try { + Await.result(cancelPromise.future, atMost) + } catch { case _: TimeoutException ⇒ false } } diff --git a/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestKitSpec.scala b/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestKitSpec.scala index 79d24349f81..b0529815191 100644 --- a/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestKitSpec.scala +++ b/repos/akka/akka-stream-testkit/src/test/scala/akka/stream/testkit/StreamTestKitSpec.scala @@ -35,7 +35,7 @@ class StreamTestKitSpec extends AkkaSpec { case n ⇒ n } } - }) + }) .runWith(TestSink.probe) .toStrict(300.millis) } diff --git a/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ForeachSinkSubscriberTest.scala b/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ForeachSinkSubscriberTest.scala index aa61f679e9a..c7393e723fb 100644 --- a/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ForeachSinkSubscriberTest.scala +++ b/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ForeachSinkSubscriberTest.scala @@ -12,7 +12,7 @@ class ForeachSinkSubscriberTest override def createSubscriber(): Subscriber[Int] = Flow[Int] .to(Sink.foreach { _ ⇒ - }) + }) .runWith(Source.asSubscriber) override def createElement(element: Int): Int = element diff --git a/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/InputStreamSourceTest.scala b/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/InputStreamSourceTest.scala index d74c705fcad..0c199f248c1 100644 --- a/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/InputStreamSourceTest.scala +++ b/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/InputStreamSourceTest.scala @@ -21,7 +21,7 @@ class InputStreamSourceTest extends AkkaPublisherVerification[ByteString] { num += 1 num } - }) + }) .withAttributes(ActorAttributes.dispatcher("akka.test.stream-dispatcher")) .take(elements) .runWith(Sink.asPublisher(false)) diff --git a/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/TransformProcessorTest.scala b/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/TransformProcessorTest.scala index 66798ed9331..f704451460c 100644 --- a/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/TransformProcessorTest.scala +++ b/repos/akka/akka-stream-tests-tck/src/test/scala/akka/stream/tck/TransformProcessorTest.scala @@ -20,7 +20,7 @@ class TransformProcessorTest extends AkkaIdentityProcessorVerification[Int] { val mkStage = () ⇒ new PushStage[Int, Int] { override def onPush(in: Int, ctx: Context[Int]) = ctx.push(in) - } + } Flow[Int].transform(mkStage).toProcessor.run() } diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala index 1730fa746c6..4f74e2cf6a7 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/DslConsistencySpec.scala @@ -120,8 +120,8 @@ class DslConsistencySpec extends WordSpec with Matchers { ("SubFlow" -> List[Class[_]](sSubFlowClass, jSubFlowClass)) :: ("Sink" -> List[Class[_]](sSinkClass, jSinkClass)) :: ("RunanbleFlow" -> List[Class[_]]( - sRunnableGraphClass, - jRunnableGraphClass)) :: Nil foreach { + sRunnableGraphClass, + jRunnableGraphClass)) :: Nil foreach { case (element, classes) ⇒ s"provide same $element transforming operators" in { val allOps = (for { diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala index 94030993356..1332e4fc7c2 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/InputStreamSourceSpec.scala @@ -29,7 +29,7 @@ class InputStreamSourceSpec extends AkkaSpec(UnboundedMailboxConfig) { val f = StreamConverters.fromInputStream(() ⇒ new InputStream { override def read(): Int = 42 - }) + }) Await.result(f.takeWithin(5.seconds).runForeach(it ⇒ ()), 10.seconds) } @@ -48,7 +48,7 @@ class InputStreamSourceSpec extends AkkaSpec(UnboundedMailboxConfig) { -1 } } - }) + }) .runWith(Sink.head) f.futureValue should ===(ByteString("abc")) @@ -70,7 +70,7 @@ class InputStreamSourceSpec extends AkkaSpec(UnboundedMailboxConfig) { -1 } } - }, + }, chunkSize = 1) .runWith(TestSink.probe) diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSinkSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSinkSpec.scala index 93d24f60264..18b79a2dfcf 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSinkSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/OutputStreamSinkSpec.scala @@ -32,7 +32,7 @@ class OutputStreamSinkSpec extends AkkaSpec(UnboundedMailboxConfig) { override def write(i: Int): Unit = () override def write(bytes: Array[Byte]): Unit = p.ref ! ByteString(bytes).utf8String - })) + })) p.expectMsg(datas(0).utf8String) p.expectMsg(datas(1).utf8String) @@ -48,7 +48,7 @@ class OutputStreamSinkSpec extends AkkaSpec(UnboundedMailboxConfig) { new OutputStream { override def write(i: Int): Unit = () override def close() = p.ref ! "closed" - })) + })) p.expectMsg("closed") } @@ -61,7 +61,7 @@ class OutputStreamSinkSpec extends AkkaSpec(UnboundedMailboxConfig) { override def write(bytes: Array[Byte]): Unit = p.ref ! ByteString(bytes).utf8String override def close() = p.ref ! "closed" - })) + })) p.expectMsg("closed") } diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/TlsSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/TlsSpec.scala index 23fb4adeb1e..37f327a3c0d 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/TlsSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/io/TlsSpec.scala @@ -399,7 +399,7 @@ class TlsSpec system.log.debug("me cancelled") ctx.finish() } - }) + }) .via(debug) .collect { case SessionBytes(_, b) ⇒ b } .scan(ByteString.empty)(_ ++ _) diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowConflateSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowConflateSpec.scala index 5a6796e74ee..ce27301c3fe 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowConflateSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowConflateSpec.scala @@ -258,7 +258,7 @@ class FlowConflateSpec extends AkkaSpec { } else { if (elem == 4) saw4Latch.open() state :+ elem - }) + }) .withAttributes(supervisionStrategy(resumingDecider)) .to(Sink.fromSubscriber(sinkProbe)) .withAttributes(inputBuffer(initial = 1, max = 1)) diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala index 4a3d9675fa5..88cfe62f29b 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncSpec.scala @@ -53,7 +53,7 @@ class FlowMapAsyncSpec extends AkkaSpec { Future { Thread.sleep(ThreadLocalRandom.current().nextInt(1, 10)) n - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -71,7 +71,7 @@ class FlowMapAsyncSpec extends AkkaSpec { Future { probe.ref ! n n - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -102,7 +102,7 @@ class FlowMapAsyncSpec extends AkkaSpec { Await.ready(latch, 10.seconds) n } - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -123,7 +123,7 @@ class FlowMapAsyncSpec extends AkkaSpec { Await.ready(latch, 10.seconds) n } - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -140,7 +140,7 @@ class FlowMapAsyncSpec extends AkkaSpec { Future { if (n == 3) throw new RuntimeException("err3") with NoStackTrace else n - }) + }) .withAttributes(supervisionStrategy(resumingDecider)) .to(Sink.fromSubscriber(c)) .run() @@ -178,7 +178,7 @@ class FlowMapAsyncSpec extends AkkaSpec { if (n == 3) throw new RuntimeException("err3b") with NoStackTrace else n - }) + }) .withAttributes(supervisionStrategy(resumingDecider)) .grouped(10) .runWith(Sink.head), diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala index cfb9b4a4a3b..b7b8fd0aed9 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowMapAsyncUnorderedSpec.scala @@ -39,7 +39,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec { Future { Await.ready(latch(n), 5.seconds) n - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -64,7 +64,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec { Future { probe.ref ! n n - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -96,7 +96,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec { Await.ready(latch, 10.seconds) n } - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -117,7 +117,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec { Await.ready(latch, 10.seconds) n } - }) + }) .to(Sink.fromSubscriber(c)) .run() val sub = c.expectSubscription() @@ -133,7 +133,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec { Future { if (n == 3) throw new RuntimeException("err3") with NoStackTrace else n - }) + }) .withAttributes(supervisionStrategy(resumingDecider)) .runWith(TestSink.probe[Int]) .request(10) @@ -169,7 +169,7 @@ class FlowMapAsyncUnorderedSpec extends AkkaSpec { if (n == 3) throw new RuntimeException("err3b") with NoStackTrace else n - }) + }) .withAttributes(supervisionStrategy(resumingDecider)) .grouped(10) .runWith(Sink.head), diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStageSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStageSpec.scala index caefe2c4c51..70f238dd6f3 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStageSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStageSpec.scala @@ -41,7 +41,7 @@ class FlowStageSpec tot += elem ctx.push(tot) } - }) + }) .runWith(Sink.asPublisher(false)) val subscriber = TestSubscriber.manualProbe[Int]() p2.subscribe(subscriber) @@ -77,7 +77,7 @@ class FlowStageSpec if (current eq waitForNext) ctx.finish() else ctx.absorbTermination() } - }) + }) .runWith(Sink.asPublisher(false)) val subscriber = TestSubscriber.manualProbe[Int]() p2.subscribe(subscriber) @@ -115,7 +115,7 @@ class FlowStageSpec ctx.pull() } else ctx.push(elem) } - }) + }) .runWith(Sink.asPublisher(false)) val subscriber = TestSubscriber.manualProbe[Int]() @@ -153,7 +153,7 @@ class FlowStageSpec if (elem % 2 == 0) ctx.pull() else ctx.push(tot) } - }) + }) .runWith(Sink.asPublisher(false)) val subscriber = TestSubscriber.manualProbe[Int]() p2.subscribe(subscriber) @@ -178,7 +178,7 @@ class FlowStageSpec concat += elem ctx.push(concat.length) } - }) + }) .transform(() ⇒ new PushStage[Int, Int] { var tot = 0 @@ -186,7 +186,7 @@ class FlowStageSpec tot += length ctx.push(tot) } - }) + }) .runWith(Sink.asPublisher(true)) val c1 = TestSubscriber.manualProbe[Int]() p2.subscribe(c1) @@ -224,7 +224,7 @@ class FlowStageSpec } override def onUpstreamFinish(ctx: Context[String]) = terminationEmit(Iterator.single(s + "B"), ctx) - }) + }) .runWith(Sink.asPublisher(false)) val c = TestSubscriber.manualProbe[String]() p2.subscribe(c) @@ -245,7 +245,7 @@ class FlowStageSpec if (s == "1") ctx.pushAndFinish(element) else ctx.push(element) } - }) + }) .toMat(TestSink.probe[Int])(Keep.both) .run p2.request(10) @@ -269,7 +269,7 @@ class FlowStageSpec } } } - }) + }) .runWith(TestSink.probe[Int]) EventFilter[IllegalArgumentException]("two not allowed") intercept { p2.request(100) @@ -302,7 +302,7 @@ class FlowStageSpec ctx: Context[Int]) = { terminationEmit(Iterator(100, 101), ctx) } - }) + }) .filter(elem ⇒ elem != 1) . // it's undefined if element 1 got through before the error or not runWith(TestSink.probe[Int]) @@ -325,7 +325,7 @@ class FlowStageSpec override def onPush(elem: Int, ctx: Context[Int]) = emit(Iterator(elem, elem), ctx) } - }) + }) .runWith(TestSink.probe[Int]) .request(1000) .expectNext(1) @@ -351,7 +351,7 @@ class FlowStageSpec } override def onUpstreamFinish(ctx: Context[Int]) = terminationEmit(Iterator(1, 2, 3), ctx) - }) + }) .runWith(TestSink.probe[Int]) .request(4) .expectNext(1) @@ -382,7 +382,7 @@ class FlowStageSpec with NoStackTrace case _ ⇒ ctx.finish() } - }) + }) .runWith(TestSink.probe[Int]) .request(10) .expectNext(1) @@ -401,7 +401,7 @@ class FlowStageSpec count += 1 ctx.push(count) } - }) + }) flow .runWith(TestSink.probe[Int]) @@ -430,7 +430,7 @@ class FlowStageSpec onDownstreamFinishProbe.ref ! "onDownstreamFinish" ctx.finish() } - }) + }) .to(Sink.fromSubscriber(down)) .run() @@ -458,7 +458,7 @@ class FlowStageSpec override def onUpstreamFinish( ctx: Context[Int]): TerminationDirective = terminationEmit(Iterator(42), ctx) - }) + }) .runWith(Sink.asPublisher(false)) val inSub = in.expectSubscription() @@ -488,7 +488,7 @@ class FlowStageSpec override def onUpstreamFinish(ctx: Context[String]) = { terminationEmit(Iterator("byebye"), ctx) } - }) + }) .runWith(TestSink.probe[String]) .request(1) .expectNext("hi1") diff --git a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStatefulMapConcatSpec.scala b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStatefulMapConcatSpec.scala index f45960ad69b..f79e282898e 100644 --- a/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStatefulMapConcatSpec.scala +++ b/repos/akka/akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowStatefulMapConcatSpec.scala @@ -49,18 +49,17 @@ class FlowStatefulMapConcatSpec extends AkkaSpec with ScriptedTest { Source(List(2, 1, 3, 4, 1)) .statefulMapConcat(() ⇒ { var prev: Option[Int] = None - x ⇒ - { - if (x % 3 == 0) throw ex - prev match { - case Some(e) ⇒ - prev = Some(x) - (1 to e) map (_ ⇒ x) - case None ⇒ - prev = Some(x) - List.empty[Int] - } + x ⇒ { + if (x % 3 == 0) throw ex + prev match { + case Some(e) ⇒ + prev = Some(x) + (1 to e) map (_ ⇒ x) + case None ⇒ + prev = Some(x) + List.empty[Int] } + } }) .withAttributes(ActorAttributes.supervisionStrategy( Supervision.restartingDecider)) @@ -76,18 +75,17 @@ class FlowStatefulMapConcatSpec extends AkkaSpec with ScriptedTest { Source(List(2, 1, 3, 4, 1)) .statefulMapConcat(() ⇒ { var prev: Option[Int] = None - x ⇒ - { - if (x % 3 == 0) throw ex - prev match { - case Some(e) ⇒ - prev = Some(x) - (1 to e) map (_ ⇒ x) - case None ⇒ - prev = Some(x) - List.empty[Int] - } + x ⇒ { + if (x % 3 == 0) throw ex + prev match { + case Some(e) ⇒ + prev = Some(x) + (1 to e) map (_ ⇒ x) + case None ⇒ + prev = Some(x) + List.empty[Int] } + } }) .withAttributes(ActorAttributes.supervisionStrategy( Supervision.resumingDecider)) diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala index a02b54b06e2..17c7ecbb02c 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/impl/Sinks.scala @@ -416,7 +416,7 @@ final private[stream] class QueueSink[T]() if (buffer.used == maxBuffer) tryPull(in) sendDownstream(promise) } - }) + }) def sendDownstream(promise: Requested[T]): Unit = { val e = buffer.dequeue() diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/ByteStringParser.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/ByteStringParser.scala index 2337ad95095..c80a1b4ec81 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/ByteStringParser.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/ByteStringParser.scala @@ -144,12 +144,12 @@ private[akka] object ByteStringParser { def readShortLE(): Int = readByte() | (readByte() << 8) def readIntLE(): Int = readShortLE() | (readShortLE() << 16) def readLongLE(): Long = - (readIntLE() & 0xffffffffL) | ((readIntLE() & 0xffffffffL) << 32) + (readIntLE() & 0XFFFFFFFFL) | ((readIntLE() & 0XFFFFFFFFL) << 32) def readShortBE(): Int = (readByte() << 8) | readByte() def readIntBE(): Int = (readShortBE() << 16) | readShortBE() def readLongBE(): Long = - ((readIntBE() & 0xffffffffL) << 32) | (readIntBE() & 0xffffffffL) + ((readIntBE() & 0XFFFFFFFFL) << 32) | (readIntBE() & 0XFFFFFFFFL) def skip(numBytes: Int): Unit = if (off + numBytes <= input.length) off += numBytes diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamSourceStage.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamSourceStage.scala index 26a178602b3..7876d99724a 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamSourceStage.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/impl/io/OutputStreamSourceStage.scala @@ -188,7 +188,7 @@ private[akka] class OutputStreamAdapter( } catch { case e: IOException ⇒ throw e case NonFatal(e) ⇒ throw new IOException(e) - }) + }) @scala.throws(classOf[IOException]) override def write(b: Int): Unit = { diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala index 52063285e2b..e1e94a8ea6e 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Flow.scala @@ -356,8 +356,7 @@ final class Flow[-In, +Out, +Mat](delegate: scaladsl.Flow[In, Out, Mat]) : javadsl.Flow[In, T, Mat] = new Flow(delegate.statefulMapConcat { () ⇒ val fun = f.create() - elem ⇒ - Util.immutableSeq(fun(elem)) + elem ⇒ Util.immutableSeq(fun(elem)) }) /** diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala index a4fc4236f15..b6e19e41907 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/Source.scala @@ -910,8 +910,7 @@ final class Source[+Out, +Mat](delegate: scaladsl.Source[Out, Mat]) : javadsl.Source[T, Mat] = new Source(delegate.statefulMapConcat { () ⇒ val fun = f.create() - elem ⇒ - Util.immutableSeq(fun(elem)) + elem ⇒ Util.immutableSeq(fun(elem)) }) /** diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubFlow.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubFlow.scala index 7ce7ed16a56..4422d391081 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubFlow.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubFlow.scala @@ -182,8 +182,7 @@ class SubFlow[-In, +Out, +Mat]( : SubFlow[In, T, Mat] = new SubFlow(delegate.statefulMapConcat { () ⇒ val fun = f.create() - elem ⇒ - Util.immutableSeq(fun(elem)) + elem ⇒ Util.immutableSeq(fun(elem)) }) /** diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubSource.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubSource.scala index 52a83f9e63b..8ee1744b314 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubSource.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/javadsl/SubSource.scala @@ -179,8 +179,7 @@ class SubSource[+Out, +Mat]( : SubSource[T, Mat] = new SubSource(delegate.statefulMapConcat { () ⇒ val fun = f.create() - elem ⇒ - Util.immutableSeq(fun(elem)) + elem ⇒ Util.immutableSeq(fun(elem)) }) /** diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Framing.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Framing.scala index 7145bce0886..5b156a7407c 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Framing.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Framing.scala @@ -131,7 +131,7 @@ object Framing { ctx.push(header ++ message) } } - }) + }) class FramingException(msg: String) extends RuntimeException(msg) diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Graph.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Graph.scala index 29a2dcee1f4..5851c0789c3 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Graph.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/scaladsl/Graph.scala @@ -183,8 +183,7 @@ final class MergePreferred[T] private ( val pullMe = Array.tabulate(secondaryPorts)(i ⇒ { val port = in(i) - () ⇒ - tryPull(port) + () ⇒ tryPull(port) }) /* @@ -382,7 +381,9 @@ final class MergeSorted[T: Ordering] extends GraphStage[FanInShape2[T, T, T]] { def nullOut(): Unit = other = null.asInstanceOf[T] def dispatch(l: T, r: T): Unit = - if (l < r) { other = r; emit(out, l, readL) } else { + if (l < r) { + other = r; emit(out, l, readL) + } else { other = l; emit(out, r, readR) } diff --git a/repos/akka/akka-stream/src/main/scala/akka/stream/stage/Stage.scala b/repos/akka/akka-stream/src/main/scala/akka/stream/stage/Stage.scala index aba3c9b25c0..d649c3c8f82 100644 --- a/repos/akka/akka-stream/src/main/scala/akka/stream/stage/Stage.scala +++ b/repos/akka/akka-stream/src/main/scala/akka/stream/stage/Stage.scala @@ -65,7 +65,9 @@ private[stream] object AbstractStage { // No need to refer to the handle in a private val val handler = new InHandler with OutHandler { override def onPush(): Unit = - try { currentStage.onPush(grab(shape.in), ctx) } catch { + try { + currentStage.onPush(grab(shape.in), ctx) + } catch { case NonFatal(ex) ⇒ onSupervision(ex) } diff --git a/repos/akka/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala b/repos/akka/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala index 2721580cb73..6e2a7196ab3 100644 --- a/repos/akka/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala +++ b/repos/akka/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala @@ -68,7 +68,7 @@ private[testkit] class CallingThreadDispatcherQueues extends Extension { private var queues = Map[CallingThreadMailbox, Set[WeakReference[MessageQueue]]]() - private var lastGC = 0l + private var lastGC = 0L // we have to forget about long-gone threads sometime private def gc(): Unit = { @@ -91,7 +91,7 @@ private[testkit] class CallingThreadDispatcherQueues extends Extension { queues += mbox -> Set(new WeakReference(q)) } val now = System.nanoTime - if (now - lastGC > 1000000000l) { + if (now - lastGC > 1000000000L) { lastGC = now gc() } diff --git a/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala b/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala index 34decb1d971..fea7a5a1f0c 100644 --- a/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala +++ b/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestEventListener.scala @@ -617,7 +617,10 @@ class TestEventListener extends Logging.DefaultLogger { } def filter(event: LogEvent): Boolean = - filters exists (f ⇒ try { f(event) } catch { case e: Exception ⇒ false }) + filters exists (f ⇒ + try { + f(event) + } catch { case e: Exception ⇒ false }) def addFilter(filter: EventFilter): Unit = filters ::= filter diff --git a/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestKit.scala b/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestKit.scala index b12ce2cc214..4f1322a3eca 100644 --- a/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestKit.scala +++ b/repos/akka/akka-testkit/src/main/scala/akka/testkit/TestKit.scala @@ -289,7 +289,9 @@ trait TestKitBase { @tailrec def poll(t: Duration) { - val failed = try { a; false } catch { + val failed = try { + a; false + } catch { case NonFatal(e) ⇒ if ((now + t) >= stop) throw e true @@ -989,7 +991,9 @@ private[testkit] abstract class CachingPartialFunction[A, B <: AnyRef] var cache: B = _ final def isDefinedAt(x: A): Boolean = - try { cache = `match`(x); true } catch { + try { + cache = `match`(x); true + } catch { case NoMatch ⇒ cache = null.asInstanceOf[B]; false } final override def apply(x: A): B = cache diff --git a/repos/akka/akka-testkit/src/test/scala/akka/testkit/Coroner.scala b/repos/akka/akka-testkit/src/test/scala/akka/testkit/Coroner.scala index d4df6fc483f..140bdabd5c8 100644 --- a/repos/akka/akka-testkit/src/test/scala/akka/testkit/Coroner.scala +++ b/repos/akka/akka-testkit/src/test/scala/akka/testkit/Coroner.scala @@ -67,7 +67,9 @@ object Coroner { } override def result(atMost: Duration)(implicit permit: CanAwait): Boolean = - try { Await.result(cancelPromise.future, atMost) } catch { + try { + Await.result(cancelPromise.future, atMost) + } catch { case _: TimeoutException ⇒ false } } diff --git a/repos/akka/akka-typed/src/test/scala/akka/typed/PerformanceSpec.scala b/repos/akka/akka-typed/src/test/scala/akka/typed/PerformanceSpec.scala index 4b9e8591f44..a04e0c44b0d 100644 --- a/repos/akka/akka-typed/src/test/scala/akka/typed/PerformanceSpec.scala +++ b/repos/akka/akka-typed/src/test/scala/akka/typed/PerformanceSpec.scala @@ -30,12 +30,12 @@ class PerformanceSpec if (msg.x == 0) { msg.report ! Pong(0, self, msg.report) } else msg.pong ! Pong(msg.x - 1, self, msg.report) - })).withDispatcher(executor) + })).withDispatcher(executor) val ponger = Props(SelfAware[Pong](self ⇒ Static { msg ⇒ msg.ping ! Ping(msg.x, self, msg.report) - })).withDispatcher(executor) + })).withDispatcher(executor) val actors = for (i ← 1 to pairs) yield diff --git a/repos/akka/project/Sample.scala b/repos/akka/project/Sample.scala index 51266a9b211..c679fadd882 100644 --- a/repos/akka/project/Sample.scala +++ b/repos/akka/project/Sample.scala @@ -32,7 +32,7 @@ object Sample { .copy( projects = libraryToProjectDeps(ti.unit.definitions.projects))) case _ => ti.unit - } + } def project(name: String) = ProjectRef(file(s"akka-samples/$name"), name) @@ -62,7 +62,7 @@ object Sample { classpathWithProjectDependencies, dependencies.aggregate) } - ) + ) private val excludeLibraryDependencies = (project: Project) => project.settings( @@ -77,7 +77,7 @@ object Sample { module.excludeAll(ExclusionRule(organization = module.organization)) case module => module } - ) + ) /** * AutoPlugins are not enabled for externally loaded projects. diff --git a/repos/breeze/math/src/main/scala/breeze/collection/mutable/Beam.scala b/repos/breeze/math/src/main/scala/breeze/collection/mutable/Beam.scala index 9e66b19736f..a383c3b6fb4 100644 --- a/repos/breeze/math/src/main/scala/breeze/collection/mutable/Beam.scala +++ b/repos/breeze/math/src/main/scala/breeze/collection/mutable/Beam.scala @@ -52,7 +52,9 @@ class Beam[T](val maxSize: Int, xs: T*)(implicit o: Ordering[T]) private def cat(h: PriorityQueue[T], x: T) { if (h.size < maxSize) h += x - else if (o.compare(h.head, x) < 0) { h.dequeue(); h += x; } + else if (o.compare(h.head, x) < 0) { + h.dequeue(); h += x; + } } def iterator = queue.iterator diff --git a/repos/breeze/math/src/main/scala/breeze/collection/mutable/SparseArray.scala b/repos/breeze/math/src/main/scala/breeze/collection/mutable/SparseArray.scala index 759e0ddd07f..9dbb3934f31 100644 --- a/repos/breeze/math/src/main/scala/breeze/collection/mutable/SparseArray.scala +++ b/repos/breeze/math/src/main/scala/breeze/collection/mutable/SparseArray.scala @@ -320,13 +320,21 @@ final class SparseArray[@specialized(Double, Int, Float, Long) V]( if (used > data.length) { // need to grow array val newLength = { - if (data.length == 0) { 4 } else if (data.length < 0x0400) { + if (data.length == 0) { + 4 + } else if (data.length < 0x0400) { data.length * 2 - } else if (data.length < 0x0800) { data.length + 0x0400 } else if (data.length < 0x1000) { + } else if (data.length < 0x0800) { + data.length + 0x0400 + } else if (data.length < 0x1000) { data.length + 0x0800 - } else if (data.length < 0x2000) { data.length + 0x1000 } else if (data.length < 0x4000) { + } else if (data.length < 0x2000) { + data.length + 0x1000 + } else if (data.length < 0x4000) { data.length + 0x2000 - } else { data.length + 0x4000 } + } else { + data.length + 0x4000 + } } // allocate new arrays diff --git a/repos/breeze/math/src/main/scala/breeze/io/RandomAccessFile.scala b/repos/breeze/math/src/main/scala/breeze/io/RandomAccessFile.scala index 0722f412a6f..3c61572c32e 100644 --- a/repos/breeze/math/src/main/scala/breeze/io/RandomAccessFile.scala +++ b/repos/breeze/math/src/main/scala/breeze/io/RandomAccessFile.scala @@ -1057,8 +1057,8 @@ object ByteConverterBigEndian extends ByteConverter { } def bytesToUInt32(b0: Byte, b1: Byte, b2: Byte, b3: Byte): Long = { - (b0.toLong & 0xFFL) << 24 | (b1.toLong & 0xFFL) << 16 | (b2.toLong & 0xFFL) << 8 | - (b3.toLong & 0xFFL) + (b0.toLong & 0XFFL) << 24 | (b1.toLong & 0XFFL) << 16 | (b2.toLong & 0XFFL) << 8 | + (b3.toLong & 0XFFL) } // def bytesToUInt64(b0: Byte, b1: Byte, b2: Byte, b3: Byte, b4: Byte, b5: Byte, b6: Byte, b7: Byte): ULong = { @@ -1079,9 +1079,9 @@ object ByteConverterBigEndian extends ByteConverter { b5: Byte, b6: Byte, b7: Byte): Long = { - b0.toLong << 56 | (b1.toLong & 0xFFL) << 48 | (b2.toLong & 0xFFL) << 40 | - (b3.toLong & 0xFFL) << 32 | (b4.toLong & 0xFFL) << 24 | (b5.toLong & 0xFFL) << 16 | - (b6.toLong & 0xFFL) << 8 | (b7.toLong & 0xFFL) + b0.toLong << 56 | (b1.toLong & 0XFFL) << 48 | (b2.toLong & 0XFFL) << 40 | + (b3.toLong & 0XFFL) << 32 | (b4.toLong & 0XFFL) << 24 | (b5.toLong & 0XFFL) << 16 | + (b6.toLong & 0XFFL) << 8 | (b7.toLong & 0XFFL) } def bytesToUInt64Shifted( @@ -1093,9 +1093,9 @@ object ByteConverterBigEndian extends ByteConverter { b5: Byte, b6: Byte, b7: Byte): Long = { - (b0 ^ 0x80).toLong << 56 | (b1.toLong & 0xFFL) << 48 | (b2.toLong & 0xFFL) << 40 | - (b3.toLong & 0xFFL) << 32 | (b4.toLong & 0xFFL) << 24 | (b5.toLong & 0xFFL) << 16 | - (b6.toLong & 0xFFL) << 8 | (b7.toLong & 0xFFL) + (b0 ^ 0x80).toLong << 56 | (b1.toLong & 0XFFL) << 48 | (b2.toLong & 0XFFL) << 40 | + (b3.toLong & 0XFFL) << 32 | (b4.toLong & 0XFFL) << 24 | (b5.toLong & 0XFFL) << 16 | + (b6.toLong & 0XFFL) << 8 | (b7.toLong & 0XFFL) } ///// XXXToByte ///// def int16ToBytes(value: Short): Array[Byte] = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/CSCMatrix.scala b/repos/breeze/math/src/main/scala/breeze/linalg/CSCMatrix.scala index c14cd6739ff..caf7ca81938 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/CSCMatrix.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/CSCMatrix.scala @@ -93,13 +93,21 @@ class CSCMatrix[@spec(Double, Int, Float, Long) V: Zero]( if (used > data.length) { // need to grow array val newLength = { - if (data.length == 0) { 4 } else if (data.length < 0x0400) { + if (data.length == 0) { + 4 + } else if (data.length < 0x0400) { data.length * 2 - } else if (data.length < 0x0800) { data.length + 0x0400 } else if (data.length < 0x1000) { + } else if (data.length < 0x0800) { + data.length + 0x0400 + } else if (data.length < 0x1000) { data.length + 0x0800 - } else if (data.length < 0x2000) { data.length + 0x1000 } else if (data.length < 0x4000) { + } else if (data.length < 0x2000) { + data.length + 0x1000 + } else if (data.length < 0x4000) { data.length + 0x2000 - } else { data.length + 0x4000 } + } else { + data.length + 0x4000 + } } // allocate new arrays @@ -537,7 +545,7 @@ object CSCMatrix if (v != 0) { numAdded += 1 vs += v - indices += (c.toLong << 32) | (r & 0xFFFFFFFFL) + indices += (c.toLong << 32) | (r & 0XFFFFFFFFL) } } @@ -568,7 +576,7 @@ object CSCMatrix val _rows = if (rows >= 0) rows - else indices.map(i => (i & 0xFFFFFFFFL).toInt).foldLeft(0)(_ max _) + 1 + else indices.map(i => (i & 0XFFFFFFFFL).toInt).foldLeft(0)(_ max _) + 1 val _cols = if (cols >= 0) cols else indices.map(i => (i >> 32).toInt).foldLeft(0)(_ max _) + 1 diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/LSMR.scala b/repos/breeze/math/src/main/scala/breeze/linalg/LSMR.scala index b94ba5e52c9..f83b2a44ce3 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/LSMR.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/LSMR.scala @@ -27,7 +27,7 @@ object LSMR extends SerializableLogging { A: M, b: V, regularization: Double = 0.0, - tolerance: Double = 1E-9, + tolerance: Double = 1e-9, maxIter: Int = 1000, quiet: Boolean = false)( implicit multMV: OpMulMatrix.Impl2[M, V, V], @@ -78,7 +78,7 @@ object LSMR extends SerializableLogging { var normA2 = sqr(alpha) var maxrbar = 0.0 - var minrbar = 1E100 + var minrbar = 1e100 var converged = false var iter = 0 diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/SparseVector.scala b/repos/breeze/math/src/main/scala/breeze/linalg/SparseVector.scala index c8a58bd4403..b0478406986 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/SparseVector.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/SparseVector.scala @@ -174,7 +174,9 @@ class SparseVector[@spec(Double, Int, Float, Long) V](val array: SparseArray[V]) else { var ii = 0 val nIndex = Array.tabulate[Int](length + 1)((cp: Int) => - if (ii < used && cp == index(ii)) { ii += 1; ii - 1 } else ii) + if (ii < used && cp == index(ii)) { + ii += 1; ii - 1 + } else ii) assert(ii == used) new CSCMatrix[V]( data, diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/Vector.scala b/repos/breeze/math/src/main/scala/breeze/linalg/Vector.scala index fa076a17655..ef8845c1e5f 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/Vector.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/Vector.scala @@ -394,7 +394,7 @@ trait VectorOps { @expand @expand.valify implicit def v_v_nilpotent_Op[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : BinaryRegistry[Vector[T], Vector[T], OpMulScalar.type, Vector[T]] = new BinaryRegistry[Vector[T], Vector[T], OpMulScalar.type, Vector[T]] { override def bindingMissing(a: Vector[T], b: Vector[T]): Vector[T] = { @@ -459,7 +459,7 @@ trait VectorOps { }, { (a, b) => b }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : BinaryRegistry[Vector[T], T, Op.type, Vector[T]] = new BinaryRegistry[Vector[T], T, Op.type, Vector[T]] { override def bindingMissing(a: Vector[T], b: T): Vector[T] = { @@ -493,7 +493,7 @@ trait VectorOps { }, { (a, b) => b }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : BinaryRegistry[T, Vector[T], Op.type, Vector[T]] = new BinaryRegistry[T, Vector[T], Op.type, Vector[T]] { override def bindingMissing(b: T, a: Vector[T]): Vector[T] = { @@ -665,7 +665,7 @@ trait VectorOps { @expand @expand.valify implicit def canDot_V_V[@expand.args(Int, Long, Float, Double) T]( - implicit @expand.sequence[T](0, 0l, 0.0f, 0.0) zero: T): BinaryRegistry[ + implicit @expand.sequence[T](0, 0L, 0.0f, 0.0) zero: T): BinaryRegistry[ Vector[T], Vector[T], breeze.linalg.operators.OpMulInner.type, diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/isclose.scala b/repos/breeze/math/src/main/scala/breeze/linalg/isclose.scala index ef922cbffe1..c8145c1aeea 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/isclose.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/isclose.scala @@ -8,7 +8,7 @@ import breeze.macros.expand */ object isClose extends UFunc { - val DEFAULT_TOLERANCE = 1E-8 + val DEFAULT_TOLERANCE = 1e-8 implicit def defaultTolImpl[A, B]( implicit impl3: Impl3[A, B, Double, Boolean]): Impl2[A, B, Boolean] = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/BitVectorOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/BitVectorOps.scala index d4d22fc3754..d490b806ad7 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/BitVectorOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/BitVectorOps.scala @@ -131,7 +131,7 @@ trait BitVectorOps { @expand @expand.valify implicit def canDot_BV_DenseVector[@expand.args(Double, Float, Int, Long) T]( - implicit @expand.sequence[T](0.0, 0.0f, 0, 0l) zero: T) + implicit @expand.sequence[T](0.0, 0.0f, 0, 0L) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[BitVector, DenseVector[T], T] = { new breeze.linalg.operators.OpMulInner.Impl2[BitVector, DenseVector[T], T] { def apply(a: BitVector, b: DenseVector[T]) = { @@ -155,7 +155,7 @@ trait BitVectorOps { @expand @expand.valify implicit def canDot_BV_SV[@expand.args(Int, Long, BigInt, Complex) T]( - implicit @expand.sequence[T](0, 0l, BigInt(0), Complex.zero) zero: T) + implicit @expand.sequence[T](0, 0L, BigInt(0), Complex.zero) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[BitVector, SparseVector[T], T] = { new breeze.linalg.operators.OpMulInner.Impl2[BitVector, SparseVector[T], T] { def apply(a: BitVector, b: SparseVector[T]): T = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/CSCMatrixOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/CSCMatrixOps.scala index 2aa4471f9dd..c6aa8c3bde2 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/CSCMatrixOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/CSCMatrixOps.scala @@ -156,7 +156,7 @@ trait CSCMatrixOps extends CSCMatrixOps_Ring { T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] = { val mZero = implicitly[T](zero) def computeZeroOpOnRange(arr: Array[T], start: Int, end: Int) { @@ -225,7 +225,7 @@ trait CSCMatrixOps extends CSCMatrixOps_Ring { @expand @expand.valify implicit def csc_csc_OpAdd[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpAdd.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] = { new OpAdd.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] { def apply(a: CSCMatrix[T], b: CSCMatrix[T]): CSCMatrix[T] = { @@ -467,7 +467,7 @@ trait CSCMatrixOps extends CSCMatrixOps_Ring { @expand @expand.valify implicit def csc_csc_OpMulScalar[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpMulScalar.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] = { new OpMulScalar.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] { def apply(a: CSCMatrix[T], b: CSCMatrix[T]): CSCMatrix[T] = { @@ -523,7 +523,7 @@ trait CSCMatrixOps extends CSCMatrixOps_Ring { @expand @expand.valify implicit def csc_csc_OpSub[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpSub.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] = { new OpSub.Impl2[CSCMatrix[T], CSCMatrix[T], CSCMatrix[T]] { def apply(a: CSCMatrix[T], b: CSCMatrix[T]): CSCMatrix[T] = { @@ -583,7 +583,7 @@ trait CSCMatrixOps extends CSCMatrixOps_Ring { implicit def implOps_CSCT_T_eq_CSCT[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpMulScalar, OpMulMatrix) Op <: OpType]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[CSCMatrix[T], T, CSCMatrix[T]] = { new Op.Impl2[CSCMatrix[T], T, CSCMatrix[T]] { def apply(a: CSCMatrix[T], b: T): CSCMatrix[T] = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseVectorOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseVectorOps.scala index 4948d8f7f95..58d81d7df04 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseVectorOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseVectorOps.scala @@ -340,7 +340,7 @@ trait DenseVectorOps extends DenseVector_GenericOps { @expand @expand.valify implicit def canDot_DV_DV[@expand.args(Int, Long) T]( - implicit @expand.sequence[T](0, 0l) zero: T) + implicit @expand.sequence[T](0, 0L) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[ DenseVector[T], DenseVector[T], @@ -375,7 +375,7 @@ trait DenseVectorOps extends DenseVector_GenericOps { @expand @expand.valify implicit def canDot_DV_V[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[DenseVector[T], Vector[T], T] = { new breeze.linalg.operators.OpMulInner.Impl2[DenseVector[T], Vector[T], T] { def apply(a: DenseVector[T], b: Vector[T]) = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/HashVectorOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/HashVectorOps.scala index 60eb8c7095f..1c5f89eeea3 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/HashVectorOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/HashVectorOps.scala @@ -41,7 +41,7 @@ trait DenseVector_HashVector_Ops { @expand implicit def canDot_DV_HV[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0f, 0L) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[ DenseVector[T], HashVector[T], @@ -165,7 +165,7 @@ trait HashVectorOps extends HashVector_GenericOps { @expand implicit def hv_hv_nilpotent_Op[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpMulScalar.Impl2[HashVector[T], HashVector[T], HashVector[T]] = new OpMulScalar.Impl2[HashVector[T], HashVector[T], HashVector[T]] { def apply(a: HashVector[T], b: HashVector[T]): HashVector[T] = { @@ -242,7 +242,7 @@ trait HashVectorOps extends HashVector_GenericOps { }, { (a, b) => b }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[HashVector[T], T, HashVector[T]] = new Op.Impl2[HashVector[T], T, HashVector[T]] { def apply(a: HashVector[T], b: T): HashVector[T] = { @@ -313,7 +313,7 @@ trait HashVectorOps extends HashVector_GenericOps { @expand implicit def canDot_HV_HV[@expand.args(Int, Long, Double, Float) T]( - implicit @expand.sequence[T](0, 0l, 0.0, 0f) zero: T) + implicit @expand.sequence[T](0, 0L, 0.0, 0f) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[ HashVector[T], HashVector[T], @@ -414,7 +414,7 @@ trait HashVector_SparseVector_Ops extends HashVectorOps { implicit @expand.sequence[Op]({ _ / _ }, { (a, b) => b }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[HashVector[T], SparseVector[T], HashVector[T]] = new Op.Impl2[HashVector[T], SparseVector[T], HashVector[T]] { def apply(a: HashVector[T], b: SparseVector[T]): HashVector[T] = { @@ -430,7 +430,7 @@ trait HashVector_SparseVector_Ops extends HashVectorOps { @expand implicit def hv_sv_nilpotent_Op[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpMulScalar.Impl2[HashVector[T], SparseVector[T], HashVector[T]] = new OpMulScalar.Impl2[HashVector[T], SparseVector[T], HashVector[T]] { def apply(a: HashVector[T], b: SparseVector[T]): HashVector[T] = { @@ -469,7 +469,7 @@ trait HashVector_SparseVector_Ops extends HashVectorOps { @expand implicit def canDot_HV_SV[@expand.args(Int, Long, Float, Double) T]( - implicit @expand.sequence[T](0, 0l, 0f, 0.0) zero: T) + implicit @expand.sequence[T](0, 0L, 0f, 0.0) zero: T) : breeze.linalg.operators.OpMulInner.Impl2[ HashVector[T], SparseVector[T], @@ -526,7 +526,7 @@ trait SparseVector_HashVector_Ops implicit @expand.sequence[Op]({ _ / _ }, { (a, b) => b }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[SparseVector[T], HashVector[T], SparseVector[T]] = new Op.Impl2[SparseVector[T], HashVector[T], SparseVector[T]] { def apply(a: SparseVector[T], b: HashVector[T]): SparseVector[T] = { @@ -542,7 +542,7 @@ trait SparseVector_HashVector_Ops @expand implicit def sv_hv_nilpotent_Op[@expand.args(Int, Double, Float, Long) T]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpMulScalar.Impl2[SparseVector[T], HashVector[T], SparseVector[T]] = new OpMulScalar.Impl2[SparseVector[T], HashVector[T], SparseVector[T]] { def apply(a: SparseVector[T], b: HashVector[T]): SparseVector[T] = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/SparseVectorOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/SparseVectorOps.scala index d78b0e155ec..fe19e45563b 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/SparseVectorOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/SparseVectorOps.scala @@ -293,7 +293,7 @@ trait DenseVector_SparseVector_Ops { Int, Double, Float, - Long) T](implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + Long) T](implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : OpMulInner.Impl2[DenseVector[T], SparseVector[T], T] = new OpMulInner.Impl2[DenseVector[T], SparseVector[T], T] { def apply(a: DenseVector[T], b: SparseVector[T]): T = { @@ -332,7 +332,7 @@ trait DenseVector_SparseVector_Ops { Int, Double, Float, - Long) T](implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + Long) T](implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : zipValues.Impl2[DenseVector[T], SparseVector[T], ZippedValues[T, T]] = new zipValues.Impl2[DenseVector[T], SparseVector[T], ZippedValues[T, T]] { @@ -386,7 +386,7 @@ trait DenseVector_SparseVector_Ops { Int, Double, Float, - Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0l) zero: T) + Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0L) zero: T) : scaleAdd.InPlaceImpl3[DenseVector[T], T, SparseVector[T]] = new scaleAdd.InPlaceImpl3[DenseVector[T], T, SparseVector[T]] { def apply(y: DenseVector[T], a: T, x: SparseVector[T]): Unit = { @@ -445,7 +445,7 @@ trait SparseVectorOps { implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0f, 0L) zero: T) : Op.Impl2[SparseVector[T], SparseVector[T], SparseVector[T]] = new Op.Impl2[SparseVector[T], SparseVector[T], SparseVector[T]] { def apply(a: SparseVector[T], b: SparseVector[T]): SparseVector[T] = { @@ -644,7 +644,7 @@ trait SparseVectorOps { Int, Double, Float, - Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0l) zero: T) + Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0L) zero: T) : OpMulScalar.Impl2[SparseVector[T], SparseVector[T], SparseVector[T]] = new OpMulScalar.Impl2[SparseVector[T], SparseVector[T], SparseVector[T]] { def apply(a: SparseVector[T], b: SparseVector[T]): SparseVector[T] = { @@ -826,7 +826,7 @@ trait SparseVectorOps { implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { (a, b) => b }, { _ pow _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[SparseVector[T], T, SparseVector[T]] = new Op.Impl2[SparseVector[T], T, SparseVector[T]] { def apply(a: SparseVector[T], b: T): SparseVector[T] = { @@ -852,7 +852,7 @@ trait SparseVectorOps { implicit @expand.sequence[Op]({ _ / _ }, { _ % _ }) op: Op.Impl2[T, T, T], - @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[SparseVector[T], T, SparseVector[T]] = new Op.Impl2[SparseVector[T], T, SparseVector[T]] { def apply(a: SparseVector[T], b: T): SparseVector[T] = { @@ -882,7 +882,7 @@ trait SparseVectorOps { implicit def implOps_SVT_T_eq_SVT[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpMulScalar, OpMulMatrix) Op <: OpType]( - implicit @expand.sequence[T](0, 0.0, 0.0f, 0l) zero: T) + implicit @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T) : Op.Impl2[SparseVector[T], T, SparseVector[T]] = new Op.Impl2[SparseVector[T], T, SparseVector[T]] { def apply(a: SparseVector[T], b: T): SparseVector[T] = { @@ -977,7 +977,7 @@ trait SparseVectorOps { Int, Double, Float, - Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0l) zero: T) + Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0L) zero: T) : OpMulInner.Impl2[SparseVector[T], SparseVector[T], T] = new OpMulInner.Impl2[SparseVector[T], SparseVector[T], T] { def apply(a: SparseVector[T], b: SparseVector[T]): T = { @@ -1141,7 +1141,7 @@ trait SparseVectorOps { Int, Double, Float, - Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0l) zero: T) + Long) T](implicit @expand.sequence[T](0, 0.0, 0f, 0L) zero: T) : scaleAdd.InPlaceImpl3[SparseVector[T], T, SparseVector[T]] = new scaleAdd.InPlaceImpl3[SparseVector[T], T, SparseVector[T]] { def apply(y: SparseVector[T], a: T, x: SparseVector[T]): Unit = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/pca.scala b/repos/breeze/math/src/main/scala/breeze/linalg/pca.scala index f74cb27ddb3..78babe9ef23 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/pca.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/pca.scala @@ -51,8 +51,7 @@ class PCA(val x: DenseMatrix[Double], val covmat: DenseMatrix[Double]) { */ lazy val cumuvar = propvar.map { var c = 0.0; - d => - { c += d; c } + d => { c += d; c } } /** diff --git a/repos/breeze/math/src/main/scala/breeze/math/Field.scala b/repos/breeze/math/src/main/scala/breeze/math/Field.scala index a4fade6612f..d43ef55b219 100644 --- a/repos/breeze/math/src/main/scala/breeze/math/Field.scala +++ b/repos/breeze/math/src/main/scala/breeze/math/Field.scala @@ -75,8 +75,8 @@ object Field { /** Not a field, but whatever. */ @SerialVersionUID(1L) implicit object fieldLong extends Field[Long] with Serializable { - def zero = 0l - def one = 1l + def zero = 0L + def one = 1L def ==(a: Long, b: Long) = a == b def !=(a: Long, b: Long) = a != b def +(a: Long, b: Long) = a + b @@ -95,8 +95,8 @@ object Field { /** Not a field, but whatever. */ @SerialVersionUID(1L) implicit object fieldBigInt extends Field[BigInt] with Serializable { - def zero = 0l - def one = 1l + def zero = 0L + def one = 1L def ==(a: BigInt, b: BigInt) = a == b def !=(a: BigInt, b: BigInt) = a != b def +(a: BigInt, b: BigInt) = a + b @@ -114,8 +114,8 @@ object Field { @SerialVersionUID(1L) implicit object fieldBigDecimal extends Field[BigDecimal] with Serializable { - def zero = 0l - def one = 1l + def zero = 0L + def one = 1L def ==(a: BigDecimal, b: BigDecimal) = a == b def !=(a: BigDecimal, b: BigDecimal) = a != b def +(a: BigDecimal, b: BigDecimal) = a + b diff --git a/repos/breeze/math/src/main/scala/breeze/math/Semiring.scala b/repos/breeze/math/src/main/scala/breeze/math/Semiring.scala index c0f53371bed..e4932d0589f 100644 --- a/repos/breeze/math/src/main/scala/breeze/math/Semiring.scala +++ b/repos/breeze/math/src/main/scala/breeze/math/Semiring.scala @@ -31,7 +31,7 @@ trait Semiring[@specialized(Int, Short, Long, Float, Double) V] def ==(a: V, b: V): Boolean def !=(a: V, b: V): Boolean - def close(a: V, b: V, tolerance: Double = 1E-4): Boolean = a == b + def close(a: V, b: V, tolerance: Double = 1e-4): Boolean = a == b } object Semiring { diff --git a/repos/breeze/math/src/main/scala/breeze/numerics/Bessel.scala b/repos/breeze/math/src/main/scala/breeze/numerics/Bessel.scala index 0dae33706db..82a3eaa3be1 100644 --- a/repos/breeze/math/src/main/scala/breeze/numerics/Bessel.scala +++ b/repos/breeze/math/src/main/scala/breeze/numerics/Bessel.scala @@ -106,36 +106,36 @@ object Bessel { 2.261671093400046e-2, 6.450448095075585e-4, 1.529835782400450e-6) private val A_i1 = Array( - 2.77791411276104639959E-18, -2.11142121435816608115E-17, - 1.55363195773620046921E-16, -1.10559694773538630805E-15, - 7.60068429473540693410E-15, -5.04218550472791168711E-14, - 3.22379336594557470981E-13, -1.98397439776494371520E-12, - 1.17361862988909016308E-11, -6.66348972350202774223E-11, - 3.62559028155211703701E-10, -1.88724975172282928790E-9, - 9.38153738649577178388E-9, -4.44505912879632808065E-8, - 2.00329475355213526229E-7, -8.56872026469545474066E-7, - 3.47025130813767847674E-6, -1.32731636560394358279E-5, - 4.78156510755005422638E-5, -1.61760815825896745588E-4, - 5.12285956168575772895E-4, -1.51357245063125314899E-3, - 4.15642294431288815669E-3, -1.05640848946261981558E-2, - 2.47264490306265168283E-2, -5.29459812080949914269E-2, - 1.02643658689847095384E-1, -1.76416518357834055153E-1, - 2.52587186443633654823E-1 + 2.77791411276104639959e-18, -2.11142121435816608115e-17, + 1.55363195773620046921e-16, -1.10559694773538630805e-15, + 7.60068429473540693410e-15, -5.04218550472791168711e-14, + 3.22379336594557470981e-13, -1.98397439776494371520e-12, + 1.17361862988909016308e-11, -6.66348972350202774223e-11, + 3.62559028155211703701e-10, -1.88724975172282928790e-9, + 9.38153738649577178388e-9, -4.44505912879632808065e-8, + 2.00329475355213526229e-7, -8.56872026469545474066e-7, + 3.47025130813767847674e-6, -1.32731636560394358279e-5, + 4.78156510755005422638e-5, -1.61760815825896745588e-4, + 5.12285956168575772895e-4, -1.51357245063125314899e-3, + 4.15642294431288815669e-3, -1.05640848946261981558e-2, + 2.47264490306265168283e-2, -5.29459812080949914269e-2, + 1.02643658689847095384e-1, -1.76416518357834055153e-1, + 2.52587186443633654823e-1 ) private val B_i1 = Array( - 7.51729631084210481353E-18, 4.41434832307170791151E-18, - -4.65030536848935832153E-17, -3.20952592199342395980E-17, - 2.96262899764595013876E-16, 3.30820231092092828324E-16, - -1.88035477551078244854E-15, -3.81440307243700780478E-15, - 1.04202769841288027642E-14, 4.27244001671195135429E-14, - -2.10154184277266431302E-14, -4.08355111109219731823E-13, - -7.19855177624590851209E-13, 2.03562854414708950722E-12, - 1.41258074366137813316E-11, 3.25260358301548823856E-11, - -1.89749581235054123450E-11, -5.58974346219658380687E-10, - -3.83538038596423702205E-9, -2.63146884688951950684E-8, - -2.51223623787020892529E-7, -3.88256480887769039346E-6, - -1.10588938762623716291E-4, -9.76109749136146840777E-3, - 7.78576235018280120474E-1 + 7.51729631084210481353e-18, 4.41434832307170791151e-18, + -4.65030536848935832153e-17, -3.20952592199342395980e-17, + 2.96262899764595013876e-16, 3.30820231092092828324e-16, + -1.88035477551078244854e-15, -3.81440307243700780478e-15, + 1.04202769841288027642e-14, 4.27244001671195135429e-14, + -2.10154184277266431302e-14, -4.08355111109219731823e-13, + -7.19855177624590851209e-13, 2.03562854414708950722e-12, + 1.41258074366137813316e-11, 3.25260358301548823856e-11, + -1.89749581235054123450e-11, -5.58974346219658380687e-10, + -3.83538038596423702205e-9, -2.63146884688951950684e-8, + -2.51223623787020892529e-7, -3.88256480887769039346e-6, + -1.10588938762623716291e-4, -9.76109749136146840777e-3, + 7.78576235018280120474e-1 ) } diff --git a/repos/breeze/math/src/main/scala/breeze/numerics/constants/Database.scala b/repos/breeze/math/src/main/scala/breeze/numerics/constants/Database.scala index 77c068e56e1..90b3700df48 100644 --- a/repos/breeze/math/src/main/scala/breeze/numerics/constants/Database.scala +++ b/repos/breeze/math/src/main/scala/breeze/numerics/constants/Database.scala @@ -67,581 +67,581 @@ object Database { private lazy val databaseHM = HashMap[String, (Double, Double, String)]( ( """{220} lattice spacing of silicon""", - (1.920155714E-10, 3.2E-18, """m""")), - ("""alpha particle-electron mass ratio""", (7294.29953610, 2.9E-6, """""")), - ("""alpha particle mass""", (6.64465675E-27, 2.9E-34, """kg""")), + (1.920155714e-10, 3.2e-18, """m""")), + ("""alpha particle-electron mass ratio""", (7294.29953610, 2.9e-6, """""")), + ("""alpha particle mass""", (6.64465675e-27, 2.9e-34, """kg""")), ( """alpha particle mass energy equivalent""", - (5.97191967E-10, 2.6E-17, """J""")), + (5.97191967e-10, 2.6e-17, """J""")), ( """alpha particle mass energy equivalent in MeV""", (3727.379240, 0.000082, """MeV""")), - ("""alpha particle mass in u""", (4.0015061791250, 6.2E-11, """u""")), + ("""alpha particle mass in u""", (4.0015061791250, 6.2e-11, """u""")), ( """alpha particle molar mass""", - (0.0040015061791250, 6.2E-14, """kg mol^-1""")), - ("""alpha particle-proton mass ratio""", (3.97259968933, 3.6E-10, """""")), - ("""Angstrom star""", (1.00001495E-10, 9.0E-17, """m""")), - ("""atomic mass constant""", (1.660538921E-27, 7.3E-35, """kg""")), + (0.0040015061791250, 6.2e-14, """kg mol^-1""")), + ("""alpha particle-proton mass ratio""", (3.97259968933, 3.6e-10, """""")), + ("""Angstrom star""", (1.00001495e-10, 9.0e-17, """m""")), + ("""atomic mass constant""", (1.660538921e-27, 7.3e-35, """kg""")), ( """atomic mass constant energy equivalent""", - (1.492417954E-10, 6.6E-18, """J""")), + (1.492417954e-10, 6.6e-18, """J""")), ( """atomic mass constant energy equivalent in MeV""", (931.4940610, 0.000021, """MeV""")), ( """atomic mass unit-electron volt relationship""", - (9.31494061E8, 21.0, """eV""")), + (9.31494061e8, 21.0, """eV""")), ( """atomic mass unit-hartree relationship""", - (3.4231776845E7, 0.024, """E_h""")), + (3.4231776845e7, 0.024, """E_h""")), ( """atomic mass unit-hertz relationship""", - (2.2523427168E23, 1.6E14, """Hz""")), + (2.2523427168e23, 1.6e14, """Hz""")), ( """atomic mass unit-inverse meter relationship""", - (7.5130066042E14, 530000.0, """m^-1""")), + (7.5130066042e14, 530000.0, """m^-1""")), ( """atomic mass unit-joule relationship""", - (1.492417954E-10, 6.6E-18, """J""")), + (1.492417954e-10, 6.6e-18, """J""")), ( """atomic mass unit-kelvin relationship""", - (1.08095408E13, 9.8E6, """K""")), + (1.08095408e13, 9.8e6, """K""")), ( """atomic mass unit-kilogram relationship""", - (1.660538921E-27, 7.3E-35, """kg""")), + (1.660538921e-27, 7.3e-35, """kg""")), ( """atomic unit of 1st hyperpolarizability""", - (3.206361449E-53, 7.1E-61, """C^3 m^3 J^-2""")), + (3.206361449e-53, 7.1e-61, """C^3 m^3 J^-2""")), ( """atomic unit of 2nd hyperpolarizability""", - (6.23538054E-65, 2.8E-72, """C^4 m^4 J^-3""")), - ("""atomic unit of action""", (1.054571726E-34, 4.7E-42, """J s""")), - ("""atomic unit of charge""", (1.602176565E-19, 3.5E-27, """C""")), + (6.23538054e-65, 2.8e-72, """C^4 m^4 J^-3""")), + ("""atomic unit of action""", (1.054571726e-34, 4.7e-42, """J s""")), + ("""atomic unit of charge""", (1.602176565e-19, 3.5e-27, """C""")), ( """atomic unit of charge density""", - (1.081202338E12, 24000.0, """C m^-3""")), - ("""atomic unit of current""", (0.006623617950, 1.5E-10, """A""")), + (1.081202338e12, 24000.0, """C m^-3""")), + ("""atomic unit of current""", (0.006623617950, 1.5e-10, """A""")), ( """atomic unit of electric dipole mom.""", - (8.47835326E-30, 1.9E-37, """C m""")), + (8.47835326e-30, 1.9e-37, """C m""")), ( """atomic unit of electric field""", - (5.14220652E11, 11000.0, """V m^-1""")), + (5.14220652e11, 11000.0, """V m^-1""")), ( """atomic unit of electric field gradient""", - (9.717362E21, 2.1E14, """V m^-2""")), + (9.717362e21, 2.1e14, """V m^-2""")), ( """atomic unit of electric polarizability""", - (1.6487772754E-41, 1.6E-50, """C^2 m^2 J^-1""")), - ("""atomic unit of electric potential""", (27.21138505, 6.0E-7, """V""")), + (1.6487772754e-41, 1.6e-50, """C^2 m^2 J^-1""")), + ("""atomic unit of electric potential""", (27.21138505, 6.0e-7, """V""")), ( """atomic unit of electric quadrupole mom.""", - (4.486551331E-40, 9.9E-48, """C m^2""")), - ("""atomic unit of energy""", (4.35974434E-18, 1.9E-25, """J""")), - ("""atomic unit of force""", (8.23872278E-8, 3.6E-15, """N""")), - ("""atomic unit of length""", (5.2917721092E-11, 1.7E-20, """m""")), + (4.486551331e-40, 9.9e-48, """C m^2""")), + ("""atomic unit of energy""", (4.35974434e-18, 1.9e-25, """J""")), + ("""atomic unit of force""", (8.23872278e-8, 3.6e-15, """N""")), + ("""atomic unit of length""", (5.2917721092e-11, 1.7e-20, """m""")), ( """atomic unit of mag. dipole mom.""", - (1.854801936E-23, 4.1E-31, """J T^-1""")), + (1.854801936e-23, 4.1e-31, """J T^-1""")), ("""atomic unit of mag. flux density""", (235051.7464, 0.0052, """T""")), ( """atomic unit of magnetizability""", - (7.891036607E-29, 1.3E-37, """J T^-2""")), - ("""atomic unit of mass""", (9.10938291E-31, 4.0E-38, """kg""")), - ("""atomic unit of mom.um""", (1.99285174E-24, 8.8E-32, """kg m s^-1""")), - ("""atomic unit of permittivity""", (1.112650056E-10, 0d, """F m^-1""")), - ("""atomic unit of time""", (2.418884326502E-17, 1.2E-28, """s""")), - ("""atomic unit of velocity""", (2.18769126379E6, 0.00071, """m s^-1""")), - ("""Avogadro constant""", (6.02214129E23, 2.7E16, """mol^-1""")), - ("""Bohr magneton""", (9.27400968E-24, 2.0E-31, """J T^-1""")), - ("""Bohr magneton in eV/T""", (0.0000578838180660, 3.8E-14, """eV T^-1""")), - ("""Bohr magneton in Hz/T""", (1.399624555E10, 310.0, """Hz T^-1""")), + (7.891036607e-29, 1.3e-37, """J T^-2""")), + ("""atomic unit of mass""", (9.10938291e-31, 4.0e-38, """kg""")), + ("""atomic unit of mom.um""", (1.99285174e-24, 8.8e-32, """kg m s^-1""")), + ("""atomic unit of permittivity""", (1.112650056e-10, 0d, """F m^-1""")), + ("""atomic unit of time""", (2.418884326502e-17, 1.2e-28, """s""")), + ("""atomic unit of velocity""", (2.18769126379e6, 0.00071, """m s^-1""")), + ("""Avogadro constant""", (6.02214129e23, 2.7e16, """mol^-1""")), + ("""Bohr magneton""", (9.27400968e-24, 2.0e-31, """J T^-1""")), + ("""Bohr magneton in eV/T""", (0.0000578838180660, 3.8e-14, """eV T^-1""")), + ("""Bohr magneton in Hz/T""", (1.399624555e10, 310.0, """Hz T^-1""")), ( """Bohr magneton in inverse meters per tesla""", - (46.68644980, 1.0E-6, """m^-1 T^-1""")), - ("""Bohr magneton in K/T""", (0.67171388, 6.1E-7, """K T^-1""")), - ("""Bohr radius""", (5.2917721092E-11, 1.7E-20, """m""")), - ("""Boltzmann constant""", (1.3806488E-23, 1.3E-29, """J K^-1""")), + (46.68644980, 1.0e-6, """m^-1 T^-1""")), + ("""Bohr magneton in K/T""", (0.67171388, 6.1e-7, """K T^-1""")), + ("""Bohr radius""", (5.2917721092e-11, 1.7e-20, """m""")), + ("""Boltzmann constant""", (1.3806488e-23, 1.3e-29, """J K^-1""")), ( """Boltzmann constant in eV/K""", - (0.000086173324, 7.8E-11, """eV K^-1""")), - ("""Boltzmann constant in Hz/K""", (2.0836618E10, 19000.0, """Hz K^-1""")), + (0.000086173324, 7.8e-11, """eV K^-1""")), + ("""Boltzmann constant in Hz/K""", (2.0836618e10, 19000.0, """Hz K^-1""")), ( """Boltzmann constant in inverse meters per kelvin""", (69.503476, 0.000063, """m^-1 K^-1""")), ("""characteristic impedance of vacuum""", (376.730313461, 0d, """ohm""")), - ("""classical electron radius""", (2.8179403267E-15, 2.7E-24, """m""")), - ("""Compton wavelength""", (2.4263102389E-12, 1.6E-21, """m""")), - ("""Compton wavelength over 2 pi""", (3.86159268E-13, 2.5E-22, """m""")), - ("""conductance quantum""", (0.0000774809173460, 2.5E-14, """S""")), + ("""classical electron radius""", (2.8179403267e-15, 2.7e-24, """m""")), + ("""Compton wavelength""", (2.4263102389e-12, 1.6e-21, """m""")), + ("""Compton wavelength over 2 pi""", (3.86159268e-13, 2.5e-22, """m""")), + ("""conductance quantum""", (0.0000774809173460, 2.5e-14, """S""")), ( """conventional value of Josephson constant""", - (4.835979E14, 0d, """Hz V^-1""")), + (4.835979e14, 0d, """Hz V^-1""")), ( """conventional value of von Klitzing constant""", (25812.807, 0d, """ohm""")), - ("""Cu x unit""", (1.00207697E-13, 2.8E-20, """m""")), + ("""Cu x unit""", (1.00207697e-13, 2.8e-20, """m""")), ( """deuteron-electron mag. mom. ratio""", - (-0.0004664345537, 3.9E-12, """""")), - ("""deuteron-electron mass ratio""", (3670.48296520, 1.5E-6, """""")), - ("""deuteron g factor""", (0.8574382308, 7.2E-9, """""")), - ("""deuteron mag. mom.""", (4.33073489E-27, 1.0E-34, """J T^-1""")), + (-0.0004664345537, 3.9e-12, """""")), + ("""deuteron-electron mass ratio""", (3670.48296520, 1.5e-6, """""")), + ("""deuteron g factor""", (0.8574382308, 7.2e-9, """""")), + ("""deuteron mag. mom.""", (4.33073489e-27, 1.0e-34, """J T^-1""")), ( """deuteron mag. mom. to Bohr magneton ratio""", - (0.0004669754556, 3.9E-12, """""")), + (0.0004669754556, 3.9e-12, """""")), ( """deuteron mag. mom. to nuclear magneton ratio""", - (0.8574382308, 7.2E-9, """""")), - ("""deuteron mass""", (3.34358348E-27, 1.5E-34, """kg""")), - ("""deuteron mass energy equivalent""", (3.00506297E-10, 1.3E-17, """J""")), + (0.8574382308, 7.2e-9, """""")), + ("""deuteron mass""", (3.34358348e-27, 1.5e-34, """kg""")), + ("""deuteron mass energy equivalent""", (3.00506297e-10, 1.3e-17, """J""")), ( """deuteron mass energy equivalent in MeV""", (1875.612859, 0.000041, """MeV""")), - ("""deuteron mass in u""", (2.0135532127120, 7.7E-11, """u""")), - ("""deuteron molar mass""", (0.0020135532127120, 7.7E-14, """kg mol^-1""")), - ("""deuteron-neutron mag. mom. ratio""", (-0.44820652, 1.1E-7, """""")), - ("""deuteron-proton mag. mom. ratio""", (0.3070122070, 2.4E-9, """""")), - ("""deuteron-proton mass ratio""", (1.99900750097, 1.8E-10, """""")), - ("""deuteron rms charge radius""", (2.1424E-15, 2.1E-18, """m""")), - ("""electric constant""", (8.854187817E-12, 0d, """F m^-1""")), + ("""deuteron mass in u""", (2.0135532127120, 7.7e-11, """u""")), + ("""deuteron molar mass""", (0.0020135532127120, 7.7e-14, """kg mol^-1""")), + ("""deuteron-neutron mag. mom. ratio""", (-0.44820652, 1.1e-7, """""")), + ("""deuteron-proton mag. mom. ratio""", (0.3070122070, 2.4e-9, """""")), + ("""deuteron-proton mass ratio""", (1.99900750097, 1.8e-10, """""")), + ("""deuteron rms charge radius""", (2.1424e-15, 2.1e-18, """m""")), + ("""electric constant""", (8.854187817e-12, 0d, """F m^-1""")), ( """electron charge to mass quotient""", - (-1.758820088E11, 3900.0, """C kg^-1""")), + (-1.758820088e11, 3900.0, """C kg^-1""")), ("""electron-deuteron mag. mom. ratio""", (-2143.923498, 0.000018, """""")), - ("""electron-deuteron mass ratio""", (0.000272443710950, 1.1E-13, """""")), - ("""electron g factor""", (-2.002319304361530, 5.3E-13, """""")), - ("""electron gyromag. ratio""", (1.760859708E11, 3900.0, """s^-1 T^-1""")), + ("""electron-deuteron mass ratio""", (0.000272443710950, 1.1e-13, """""")), + ("""electron g factor""", (-2.002319304361530, 5.3e-13, """""")), + ("""electron gyromag. ratio""", (1.760859708e11, 3900.0, """s^-1 T^-1""")), ( """electron gyromag. ratio over 2 pi""", (28024.95266, 0.00062, """MHz T^-1""")), - ("""electron-helion mass ratio""", (0.000181954307610, 1.7E-13, """""")), - ("""electron mag. mom.""", (-9.2847643E-24, 2.1E-31, """J T^-1""")), - ("""electron mag. mom. anomaly""", (0.00115965218076, 2.7E-13, """""")), + ("""electron-helion mass ratio""", (0.000181954307610, 1.7e-13, """""")), + ("""electron mag. mom.""", (-9.2847643e-24, 2.1e-31, """J T^-1""")), + ("""electron mag. mom. anomaly""", (0.00115965218076, 2.7e-13, """""")), ( """electron mag. mom. to Bohr magneton ratio""", - (-1.001159652180760, 2.7E-13, """""")), + (-1.001159652180760, 2.7e-13, """""")), ( """electron mag. mom. to nuclear magneton ratio""", - (-1838.28197090, 7.5E-7, """""")), - ("""electron mass""", (9.10938291E-31, 4.0E-38, """kg""")), - ("""electron mass energy equivalent""", (8.18710506E-14, 3.6E-21, """J""")), + (-1838.28197090, 7.5e-7, """""")), + ("""electron mass""", (9.10938291e-31, 4.0e-38, """kg""")), + ("""electron mass energy equivalent""", (8.18710506e-14, 3.6e-21, """J""")), ( """electron mass energy equivalent in MeV""", - (0.5109989280, 1.1E-8, """MeV""")), - ("""electron mass in u""", (0.000548579909460, 2.2E-13, """u""")), - ("""electron molar mass""", (5.4857990946E-7, 2.2E-16, """kg mol^-1""")), - ("""electron-muon mag. mom. ratio""", (206.7669896, 5.2E-6, """""")), - ("""electron-muon mass ratio""", (0.004836331660, 1.2E-10, """""")), + (0.5109989280, 1.1e-8, """MeV""")), + ("""electron mass in u""", (0.000548579909460, 2.2e-13, """u""")), + ("""electron molar mass""", (5.4857990946e-7, 2.2e-16, """kg mol^-1""")), + ("""electron-muon mag. mom. ratio""", (206.7669896, 5.2e-6, """""")), + ("""electron-muon mass ratio""", (0.004836331660, 1.2e-10, """""")), ("""electron-neutron mag. mom. ratio""", (960.92050, 0.00023, """""")), - ("""electron-neutron mass ratio""", (0.000543867344610, 3.2E-13, """""")), - ("""electron-proton mag. mom. ratio""", (-658.2106848, 5.4E-6, """""")), - ("""electron-proton mass ratio""", (0.000544617021780, 2.2E-13, """""")), - ("""electron-tau mass ratio""", (0.000287592, 2.6E-8, """""")), + ("""electron-neutron mass ratio""", (0.000543867344610, 3.2e-13, """""")), + ("""electron-proton mag. mom. ratio""", (-658.2106848, 5.4e-6, """""")), + ("""electron-proton mass ratio""", (0.000544617021780, 2.2e-13, """""")), + ("""electron-tau mass ratio""", (0.000287592, 2.6e-8, """""")), ( """electron to alpha particle mass ratio""", - (0.000137093355578, 5.5E-14, """""")), + (0.000137093355578, 5.5e-14, """""")), ( """electron to shielded helion mag. mom. ratio""", - (864.0582570, 1.0E-5, """""")), + (864.0582570, 1.0e-5, """""")), ( """electron to shielded proton mag. mom. ratio""", - (-658.2275971, 7.2E-6, """""")), - ("""electron-triton mass ratio""", (0.000181920006530, 1.7E-13, """""")), - ("""electron volt""", (1.602176565E-19, 3.5E-27, """J""")), + (-658.2275971, 7.2e-6, """""")), + ("""electron-triton mass ratio""", (0.000181920006530, 1.7e-13, """""")), + ("""electron volt""", (1.602176565e-19, 3.5e-27, """J""")), ( """electron volt-atomic mass unit relationship""", - (1.07354415E-9, 2.4E-17, """u""")), + (1.07354415e-9, 2.4e-17, """u""")), ( """electron volt-hartree relationship""", - (0.03674932379, 8.1E-10, """E_h""")), - ("""electron volt-hertz relationship""", (2.417989348E14, 5.3E6, """Hz""")), + (0.03674932379, 8.1e-10, """E_h""")), + ("""electron volt-hertz relationship""", (2.417989348e14, 5.3e6, """Hz""")), ( """electron volt-inverse meter relationship""", (806554.4290, 0.018, """m^-1""")), ( """electron volt-joule relationship""", - (1.602176565E-19, 3.5E-27, """J""")), + (1.602176565e-19, 3.5e-27, """J""")), ("""electron volt-kelvin relationship""", (11604.519, 0.011, """K""")), ( """electron volt-kilogram relationship""", - (1.782661845E-36, 3.9E-44, """kg""")), - ("""elementary charge""", (1.602176565E-19, 3.5E-27, """C""")), - ("""elementary charge over h""", (2.417989348E14, 5.3E6, """A J^-1""")), + (1.782661845e-36, 3.9e-44, """kg""")), + ("""elementary charge""", (1.602176565e-19, 3.5e-27, """C""")), + ("""elementary charge over h""", (2.417989348e14, 5.3e6, """A J^-1""")), ("""Faraday constant""", (96485.33650, 0.0021, """C mol^-1""")), ( """Faraday constant for conventional electric current""", (96485.33210, 0.0043, """C_90 mol^-1""")), - ("""Fermi coupling constant""", (0.000011663640, 5.0E-11, """GeV^-2""")), - ("""fine-structure constant""", (0.00729735256980, 2.4E-12, """""")), - ("""first radiation constant""", (3.74177153E-16, 1.7E-23, """W m^2""")), + ("""Fermi coupling constant""", (0.000011663640, 5.0e-11, """GeV^-2""")), + ("""fine-structure constant""", (0.00729735256980, 2.4e-12, """""")), + ("""first radiation constant""", (3.74177153e-16, 1.7e-23, """W m^2""")), ( """first radiation constant for spectral radiance""", - (1.191042869E-16, 5.3E-24, """W m^2 sr^-1""")), + (1.191042869e-16, 5.3e-24, """W m^2 sr^-1""")), ( """hartree-atomic mass unit relationship""", - (2.9212623246E-8, 2.1E-17, """u""")), - ("""hartree-electron volt relationship""", (27.21138505, 6.0E-7, """eV""")), - ("""Hartree energy""", (4.35974434E-18, 1.9E-25, """J""")), - ("""Hartree energy in eV""", (27.21138505, 6.0E-7, """eV""")), - ("""hartree-hertz relationship""", (6.579683920729E15, 33000.0, """Hz""")), + (2.9212623246e-8, 2.1e-17, """u""")), + ("""hartree-electron volt relationship""", (27.21138505, 6.0e-7, """eV""")), + ("""Hartree energy""", (4.35974434e-18, 1.9e-25, """J""")), + ("""Hartree energy in eV""", (27.21138505, 6.0e-7, """eV""")), + ("""hartree-hertz relationship""", (6.579683920729e15, 33000.0, """Hz""")), ( """hartree-inverse meter relationship""", - (2.194746313708E7, 0.00011, """m^-1""")), - ("""hartree-joule relationship""", (4.35974434E-18, 1.9E-25, """J""")), + (2.194746313708e7, 0.00011, """m^-1""")), + ("""hartree-joule relationship""", (4.35974434e-18, 1.9e-25, """J""")), ("""hartree-kelvin relationship""", (315775.04, 0.29, """K""")), - ("""hartree-kilogram relationship""", (4.85086979E-35, 2.1E-42, """kg""")), - ("""helion-electron mass ratio""", (5495.88527540, 5.0E-6, """""")), - ("""helion g factor""", (-4.255250613, 5.0E-8, """""")), - ("""helion mag. mom.""", (-1.074617486E-26, 2.7E-34, """J T^-1""")), + ("""hartree-kilogram relationship""", (4.85086979e-35, 2.1e-42, """kg""")), + ("""helion-electron mass ratio""", (5495.88527540, 5.0e-6, """""")), + ("""helion g factor""", (-4.255250613, 5.0e-8, """""")), + ("""helion mag. mom.""", (-1.074617486e-26, 2.7e-34, """J T^-1""")), ( """helion mag. mom. to Bohr magneton ratio""", - (-0.001158740958, 1.4E-11, """""")), + (-0.001158740958, 1.4e-11, """""")), ( """helion mag. mom. to nuclear magneton ratio""", - (-2.127625306, 2.5E-8, """""")), - ("""helion mass""", (5.00641234E-27, 2.2E-34, """kg""")), - ("""helion mass energy equivalent""", (4.49953902E-10, 2.0E-17, """J""")), + (-2.127625306, 2.5e-8, """""")), + ("""helion mass""", (5.00641234e-27, 2.2e-34, """kg""")), + ("""helion mass energy equivalent""", (4.49953902e-10, 2.0e-17, """J""")), ( """helion mass energy equivalent in MeV""", (2808.391482, 0.000062, """MeV""")), - ("""helion mass in u""", (3.01493224680, 2.5E-9, """u""")), - ("""helion molar mass""", (0.00301493224680, 2.5E-12, """kg mol^-1""")), - ("""helion-proton mass ratio""", (2.99315267070, 2.5E-9, """""")), + ("""helion mass in u""", (3.01493224680, 2.5e-9, """u""")), + ("""helion molar mass""", (0.00301493224680, 2.5e-12, """kg mol^-1""")), + ("""helion-proton mass ratio""", (2.99315267070, 2.5e-9, """""")), ( """hertz-atomic mass unit relationship""", - (4.4398216689E-24, 3.1E-33, """u""")), + (4.4398216689e-24, 3.1e-33, """u""")), ( """hertz-electron volt relationship""", - (4.135667516E-15, 9.1E-23, """eV""")), + (4.135667516e-15, 9.1e-23, """eV""")), ( """hertz-hartree relationship""", - (1.5198298460045E-16, 7.6E-28, """E_h""")), - ("""hertz-inverse meter relationship""", (3.335640951E-9, 0d, """m^-1""")), - ("""hertz-joule relationship""", (6.62606957E-34, 2.9E-41, """J""")), - ("""hertz-kelvin relationship""", (4.7992434E-11, 4.4E-17, """K""")), - ("""hertz-kilogram relationship""", (7.37249668E-51, 3.3E-58, """kg""")), - ("""inverse fine-structure constant""", (137.035999074, 4.4E-8, """""")), + (1.5198298460045e-16, 7.6e-28, """E_h""")), + ("""hertz-inverse meter relationship""", (3.335640951e-9, 0d, """m^-1""")), + ("""hertz-joule relationship""", (6.62606957e-34, 2.9e-41, """J""")), + ("""hertz-kelvin relationship""", (4.7992434e-11, 4.4e-17, """K""")), + ("""hertz-kilogram relationship""", (7.37249668e-51, 3.3e-58, """kg""")), + ("""inverse fine-structure constant""", (137.035999074, 4.4e-8, """""")), ( """inverse meter-atomic mass unit relationship""", - (1.3310250512E-15, 9.4E-25, """u""")), + (1.3310250512e-15, 9.4e-25, """u""")), ( """inverse meter-electron volt relationship""", - (1.23984193E-6, 2.7E-14, """eV""")), + (1.23984193e-6, 2.7e-14, """eV""")), ( """inverse meter-hartree relationship""", - (4.556335252755E-8, 2.3E-19, """E_h""")), - ("""inverse meter-hertz relationship""", (2.99792458E8, 0d, """Hz""")), + (4.556335252755e-8, 2.3e-19, """E_h""")), + ("""inverse meter-hertz relationship""", (2.99792458e8, 0d, """Hz""")), ( """inverse meter-joule relationship""", - (1.986445684E-25, 8.8E-33, """J""")), - ("""inverse meter-kelvin relationship""", (0.014387770, 1.3E-8, """K""")), + (1.986445684e-25, 8.8e-33, """J""")), + ("""inverse meter-kelvin relationship""", (0.014387770, 1.3e-8, """K""")), ( """inverse meter-kilogram relationship""", - (2.210218902E-42, 9.8E-50, """kg""")), - ("""inverse of conductance quantum""", (12906.4037217, 4.2E-6, """ohm""")), - ("""Josephson constant""", (4.8359787E14, 1.1E7, """Hz V^-1""")), - ("""joule-atomic mass unit relationship""", (6.70053585E9, 300.0, """u""")), - ("""joule-electron volt relationship""", (6.24150934E18, 1.4E11, """eV""")), - ("""joule-hartree relationship""", (2.29371248E17, 1.0E10, """E_h""")), - ("""joule-hertz relationship""", (1.509190311E33, 6.7E25, """Hz""")), + (2.210218902e-42, 9.8e-50, """kg""")), + ("""inverse of conductance quantum""", (12906.4037217, 4.2e-6, """ohm""")), + ("""Josephson constant""", (4.8359787e14, 1.1e7, """Hz V^-1""")), + ("""joule-atomic mass unit relationship""", (6.70053585e9, 300.0, """u""")), + ("""joule-electron volt relationship""", (6.24150934e18, 1.4e11, """eV""")), + ("""joule-hartree relationship""", (2.29371248e17, 1.0e10, """E_h""")), + ("""joule-hertz relationship""", (1.509190311e33, 6.7e25, """Hz""")), ( """joule-inverse meter relationship""", - (5.03411701E24, 2.2E17, """m^-1""")), - ("""joule-kelvin relationship""", (7.2429716E22, 6.6E16, """K""")), - ("""joule-kilogram relationship""", (1.112650056E-17, 0d, """kg""")), + (5.03411701e24, 2.2e17, """m^-1""")), + ("""joule-kelvin relationship""", (7.2429716e22, 6.6e16, """K""")), + ("""joule-kilogram relationship""", (1.112650056e-17, 0d, """kg""")), ( """kelvin-atomic mass unit relationship""", - (9.2510868E-14, 8.4E-20, """u""")), + (9.2510868e-14, 8.4e-20, """u""")), ( """kelvin-electron volt relationship""", - (0.000086173324, 7.8E-11, """eV""")), - ("""kelvin-hartree relationship""", (3.1668114E-6, 2.9E-12, """E_h""")), - ("""kelvin-hertz relationship""", (2.0836618E10, 19000.0, """Hz""")), + (0.000086173324, 7.8e-11, """eV""")), + ("""kelvin-hartree relationship""", (3.1668114e-6, 2.9e-12, """E_h""")), + ("""kelvin-hertz relationship""", (2.0836618e10, 19000.0, """Hz""")), ( """kelvin-inverse meter relationship""", (69.503476, 0.000063, """m^-1""")), - ("""kelvin-joule relationship""", (1.3806488E-23, 1.3E-29, """J""")), - ("""kelvin-kilogram relationship""", (1.536179E-40, 1.4E-46, """kg""")), + ("""kelvin-joule relationship""", (1.3806488e-23, 1.3e-29, """J""")), + ("""kelvin-kilogram relationship""", (1.536179e-40, 1.4e-46, """kg""")), ( """kilogram-atomic mass unit relationship""", - (6.02214129E26, 2.7E19, """u""")), + (6.02214129e26, 2.7e19, """u""")), ( """kilogram-electron volt relationship""", - (5.60958885E35, 1.2E28, """eV""")), - ("""kilogram-hartree relationship""", (2.061485968E34, 9.1E26, """E_h""")), - ("""kilogram-hertz relationship""", (1.356392608E50, 6.0E42, """Hz""")), + (5.60958885e35, 1.2e28, """eV""")), + ("""kilogram-hartree relationship""", (2.061485968e34, 9.1e26, """E_h""")), + ("""kilogram-hertz relationship""", (1.356392608e50, 6.0e42, """Hz""")), ( """kilogram-inverse meter relationship""", - (4.52443873E41, 2.0E34, """m^-1""")), - ("""kilogram-joule relationship""", (8.987551787E16, 0d, """J""")), - ("""kilogram-kelvin relationship""", (6.5096582E39, 5.9E33, """K""")), - ("""lattice parameter of silicon""", (5.431020504E-10, 8.9E-18, """m""")), + (4.52443873e41, 2.0e34, """m^-1""")), + ("""kilogram-joule relationship""", (8.987551787e16, 0d, """J""")), + ("""kilogram-kelvin relationship""", (6.5096582e39, 5.9e33, """K""")), + ("""lattice parameter of silicon""", (5.431020504e-10, 8.9e-18, """m""")), ( """Loschmidt constant (273.15 K, 100 kPa)""", - (2.6516462E25, 2.4E19, """m^-3""")), + (2.6516462e25, 2.4e19, """m^-3""")), ( """Loschmidt constant (273.15 K, 101.325 kPa)""", - (2.6867805E25, 2.4E19, """m^-3""")), - ("""mag. constant""", (1.2566370614E-6, 0d, """N A^-2""")), - ("""mag. flux quantum""", (2.067833758E-15, 4.6E-23, """Wb""")), - ("""molar gas constant""", (8.3144621, 7.5E-6, """J mol^-1 K^-1""")), + (2.6867805e25, 2.4e19, """m^-3""")), + ("""mag. constant""", (1.2566370614e-6, 0d, """N A^-2""")), + ("""mag. flux quantum""", (2.067833758e-15, 4.6e-23, """Wb""")), + ("""molar gas constant""", (8.3144621, 7.5e-6, """J mol^-1 K^-1""")), ("""molar mass constant""", (0.0010, 0d, """kg mol^-1""")), ("""molar mass of carbon-12""", (0.012, 0d, """kg mol^-1""")), ( """molar Planck constant""", - (3.9903127176E-10, 2.8E-19, """J s mol^-1""")), + (3.9903127176e-10, 2.8e-19, """J s mol^-1""")), ( """molar Planck constant times c""", - (0.119626565779, 8.4E-11, """J m mol^-1""")), + (0.119626565779, 8.4e-11, """J m mol^-1""")), ( """molar volume of ideal gas (273.15 K, 100 kPa)""", - (0.022710953, 2.1E-8, """m^3 mol^-1""")), + (0.022710953, 2.1e-8, """m^3 mol^-1""")), ( """molar volume of ideal gas (273.15 K, 101.325 kPa)""", - (0.022413968, 2.0E-8, """m^3 mol^-1""")), + (0.022413968, 2.0e-8, """m^3 mol^-1""")), ( """molar volume of silicon""", - (0.00001205883301, 8.0E-13, """m^3 mol^-1""")), - ("""Mo x unit""", (1.00209952E-13, 5.3E-20, """m""")), - ("""muon Compton wavelength""", (1.173444103E-14, 3.0E-22, """m""")), + (0.00001205883301, 8.0e-13, """m^3 mol^-1""")), + ("""Mo x unit""", (1.00209952e-13, 5.3e-20, """m""")), + ("""muon Compton wavelength""", (1.173444103e-14, 3.0e-22, """m""")), ( """muon Compton wavelength over 2 pi""", - (1.867594294E-15, 4.7E-23, """m""")), - ("""muon-electron mass ratio""", (206.7682843, 5.2E-6, """""")), - ("""muon g factor""", (-2.00233184180, 1.3E-9, """""")), - ("""muon mag. mom.""", (-4.49044807E-26, 1.5E-33, """J T^-1""")), - ("""muon mag. mom. anomaly""", (0.001165920910, 6.3E-10, """""")), + (1.867594294e-15, 4.7e-23, """m""")), + ("""muon-electron mass ratio""", (206.7682843, 5.2e-6, """""")), + ("""muon g factor""", (-2.00233184180, 1.3e-9, """""")), + ("""muon mag. mom.""", (-4.49044807e-26, 1.5e-33, """J T^-1""")), + ("""muon mag. mom. anomaly""", (0.001165920910, 6.3e-10, """""")), ( """muon mag. mom. to Bohr magneton ratio""", - (-0.004841970440, 1.2E-10, """""")), + (-0.004841970440, 1.2e-10, """""")), ( """muon mag. mom. to nuclear magneton ratio""", - (-8.890596970, 2.2E-7, """""")), - ("""muon mass""", (1.883531475E-28, 9.6E-36, """kg""")), - ("""muon mass energy equivalent""", (1.692833667E-11, 8.6E-19, """J""")), + (-8.890596970, 2.2e-7, """""")), + ("""muon mass""", (1.883531475e-28, 9.6e-36, """kg""")), + ("""muon mass energy equivalent""", (1.692833667e-11, 8.6e-19, """J""")), ( """muon mass energy equivalent in MeV""", - (105.6583715, 3.5E-6, """MeV""")), - ("""muon mass in u""", (0.1134289267, 2.9E-9, """u""")), - ("""muon molar mass""", (0.0001134289267, 2.9E-12, """kg mol^-1""")), - ("""muon-neutron mass ratio""", (0.1124545177, 2.8E-9, """""")), - ("""muon-proton mag. mom. ratio""", (-3.183345107, 8.4E-8, """""")), - ("""muon-proton mass ratio""", (0.1126095272, 2.8E-9, """""")), - ("""muon-tau mass ratio""", (0.0594649, 5.4E-6, """""")), - ("""natural unit of action""", (1.054571726E-34, 4.7E-42, """J s""")), + (105.6583715, 3.5e-6, """MeV""")), + ("""muon mass in u""", (0.1134289267, 2.9e-9, """u""")), + ("""muon molar mass""", (0.0001134289267, 2.9e-12, """kg mol^-1""")), + ("""muon-neutron mass ratio""", (0.1124545177, 2.8e-9, """""")), + ("""muon-proton mag. mom. ratio""", (-3.183345107, 8.4e-8, """""")), + ("""muon-proton mass ratio""", (0.1126095272, 2.8e-9, """""")), + ("""muon-tau mass ratio""", (0.0594649, 5.4e-6, """""")), + ("""natural unit of action""", (1.054571726e-34, 4.7e-42, """J s""")), ( """natural unit of action in eV s""", - (6.58211928E-16, 1.5E-23, """eV s""")), - ("""natural unit of energy""", (8.18710506E-14, 3.6E-21, """J""")), - ("""natural unit of energy in MeV""", (0.5109989280, 1.1E-8, """MeV""")), - ("""natural unit of length""", (3.86159268E-13, 2.5E-22, """m""")), - ("""natural unit of mass""", (9.10938291E-31, 4.0E-38, """kg""")), - ("""natural unit of mom.um""", (2.73092429E-22, 1.2E-29, """kg m s^-1""")), + (6.58211928e-16, 1.5e-23, """eV s""")), + ("""natural unit of energy""", (8.18710506e-14, 3.6e-21, """J""")), + ("""natural unit of energy in MeV""", (0.5109989280, 1.1e-8, """MeV""")), + ("""natural unit of length""", (3.86159268e-13, 2.5e-22, """m""")), + ("""natural unit of mass""", (9.10938291e-31, 4.0e-38, """kg""")), + ("""natural unit of mom.um""", (2.73092429e-22, 1.2e-29, """kg m s^-1""")), ( """natural unit of mom.um in MeV/c""", - (0.5109989280, 1.1E-8, """MeV/c""")), - ("""natural unit of time""", (1.28808866833E-21, 8.3E-31, """s""")), - ("""natural unit of velocity""", (2.99792458E8, 0d, """m s^-1""")), - ("""neutron Compton wavelength""", (1.3195909068E-15, 1.1E-24, """m""")), + (0.5109989280, 1.1e-8, """MeV/c""")), + ("""natural unit of time""", (1.28808866833e-21, 8.3e-31, """s""")), + ("""natural unit of velocity""", (2.99792458e8, 0d, """m s^-1""")), + ("""neutron Compton wavelength""", (1.3195909068e-15, 1.1e-24, """m""")), ( """neutron Compton wavelength over 2 pi""", - (2.1001941568E-16, 1.7E-25, """m""")), - ("""neutron-electron mag. mom. ratio""", (0.001040668820, 2.5E-10, """""")), - ("""neutron-electron mass ratio""", (1838.68366050, 1.1E-6, """""")), - ("""neutron g factor""", (-3.826085450, 9.0E-7, """""")), - ("""neutron gyromag. ratio""", (1.83247179E8, 43.0, """s^-1 T^-1""")), + (2.1001941568e-16, 1.7e-25, """m""")), + ("""neutron-electron mag. mom. ratio""", (0.001040668820, 2.5e-10, """""")), + ("""neutron-electron mass ratio""", (1838.68366050, 1.1e-6, """""")), + ("""neutron g factor""", (-3.826085450, 9.0e-7, """""")), + ("""neutron gyromag. ratio""", (1.83247179e8, 43.0, """s^-1 T^-1""")), ( """neutron gyromag. ratio over 2 pi""", - (29.16469430, 6.9E-6, """MHz T^-1""")), - ("""neutron mag. mom.""", (-9.6623647E-27, 2.3E-33, """J T^-1""")), + (29.16469430, 6.9e-6, """MHz T^-1""")), + ("""neutron mag. mom.""", (-9.6623647e-27, 2.3e-33, """J T^-1""")), ( """neutron mag. mom. to Bohr magneton ratio""", - (-0.001041875630, 2.5E-10, """""")), + (-0.001041875630, 2.5e-10, """""")), ( """neutron mag. mom. to nuclear magneton ratio""", - (-1.913042720, 4.5E-7, """""")), - ("""neutron mass""", (1.674927351E-27, 7.4E-35, """kg""")), - ("""neutron mass energy equivalent""", (1.505349631E-10, 6.6E-18, """J""")), + (-1.913042720, 4.5e-7, """""")), + ("""neutron mass""", (1.674927351e-27, 7.4e-35, """kg""")), + ("""neutron mass energy equivalent""", (1.505349631e-10, 6.6e-18, """J""")), ( """neutron mass energy equivalent in MeV""", (939.5653790, 0.000021, """MeV""")), - ("""neutron mass in u""", (1.008664916, 4.3E-10, """u""")), - ("""neutron molar mass""", (0.001008664916, 4.3E-13, """kg mol^-1""")), - ("""neutron-muon mass ratio""", (8.8924840, 2.2E-7, """""")), - ("""neutron-proton mag. mom. ratio""", (-0.68497934, 1.6E-7, """""")), - ("""neutron-proton mass difference""", (2.30557392E-30, 7.6E-37, """""")), + ("""neutron mass in u""", (1.008664916, 4.3e-10, """u""")), + ("""neutron molar mass""", (0.001008664916, 4.3e-13, """kg mol^-1""")), + ("""neutron-muon mass ratio""", (8.8924840, 2.2e-7, """""")), + ("""neutron-proton mag. mom. ratio""", (-0.68497934, 1.6e-7, """""")), + ("""neutron-proton mass difference""", (2.30557392e-30, 7.6e-37, """""")), ( """neutron-proton mass difference energy equivalent""", - (2.0721465E-13, 6.8E-20, """""")), + (2.0721465e-13, 6.8e-20, """""")), ( """neutron-proton mass difference energy equivalent in MeV""", - (1.293332170, 4.2E-7, """""")), + (1.293332170, 4.2e-7, """""")), ( """neutron-proton mass difference in u""", - (0.001388449190, 4.5E-10, """""")), - ("""neutron-proton mass ratio""", (1.00137841917, 4.5E-10, """""")), + (0.001388449190, 4.5e-10, """""")), + ("""neutron-proton mass ratio""", (1.00137841917, 4.5e-10, """""")), ("""neutron-tau mass ratio""", (0.528790, 0.000048, """""")), ( """neutron to shielded proton mag. mom. ratio""", - (-0.68499694, 1.6E-7, """""")), + (-0.68499694, 1.6e-7, """""")), ( """Newtonian constant of gravitation""", - (6.67384E-11, 8.0E-15, """m^3 kg^-1 s^-2""")), + (6.67384e-11, 8.0e-15, """m^3 kg^-1 s^-2""")), ( """Newtonian constant of gravitation over h-bar c""", - (6.70837E-39, 8.0E-43, """(GeV/c^2)^-2""")), - ("""nuclear magneton""", (5.05078353E-27, 1.1E-34, """J T^-1""")), - ("""nuclear magneton in eV/T""", (3.1524512605E-8, 2.2E-17, """eV T^-1""")), + (6.70837e-39, 8.0e-43, """(GeV/c^2)^-2""")), + ("""nuclear magneton""", (5.05078353e-27, 1.1e-34, """J T^-1""")), + ("""nuclear magneton in eV/T""", (3.1524512605e-8, 2.2e-17, """eV T^-1""")), ( """nuclear magneton in inverse meters per tesla""", - (0.02542623527, 5.6E-10, """m^-1 T^-1""")), - ("""nuclear magneton in K/T""", (0.00036582682, 3.3E-10, """K T^-1""")), - ("""nuclear magneton in MHz/T""", (7.622593570, 1.7E-7, """MHz T^-1""")), - ("""Planck constant""", (6.62606957E-34, 2.9E-41, """J s""")), - ("""Planck constant in eV s""", (4.135667516E-15, 9.1E-23, """eV s""")), - ("""Planck constant over 2 pi""", (1.054571726E-34, 4.7E-42, """J s""")), + (0.02542623527, 5.6e-10, """m^-1 T^-1""")), + ("""nuclear magneton in K/T""", (0.00036582682, 3.3e-10, """K T^-1""")), + ("""nuclear magneton in MHz/T""", (7.622593570, 1.7e-7, """MHz T^-1""")), + ("""Planck constant""", (6.62606957e-34, 2.9e-41, """J s""")), + ("""Planck constant in eV s""", (4.135667516e-15, 9.1e-23, """eV s""")), + ("""Planck constant over 2 pi""", (1.054571726e-34, 4.7e-42, """J s""")), ( """Planck constant over 2 pi in eV s""", - (6.58211928E-16, 1.5E-23, """eV s""")), + (6.58211928e-16, 1.5e-23, """eV s""")), ( """Planck constant over 2 pi times c in MeV fm""", - (197.3269718, 4.4E-6, """MeV fm""")), - ("""Planck length""", (1.616199E-35, 9.7E-40, """m""")), - ("""Planck mass""", (2.17651E-8, 1.3E-12, """kg""")), + (197.3269718, 4.4e-6, """MeV fm""")), + ("""Planck length""", (1.616199e-35, 9.7e-40, """m""")), + ("""Planck mass""", (2.17651e-8, 1.3e-12, """kg""")), ( """Planck mass energy equivalent in GeV""", - (1.220932E19, 7.3E14, """GeV""")), - ("""Planck temperature""", (1.416833E32, 8.5E27, """K""")), - ("""Planck time""", (5.39106E-44, 3.2E-48, """s""")), - ("""proton charge to mass quotient""", (9.57883358E7, 2.1, """C kg^-1""")), - ("""proton Compton wavelength""", (1.32140985623E-15, 9.4E-25, """m""")), + (1.220932e19, 7.3e14, """GeV""")), + ("""Planck temperature""", (1.416833e32, 8.5e27, """K""")), + ("""Planck time""", (5.39106e-44, 3.2e-48, """s""")), + ("""proton charge to mass quotient""", (9.57883358e7, 2.1, """C kg^-1""")), + ("""proton Compton wavelength""", (1.32140985623e-15, 9.4e-25, """m""")), ( """proton Compton wavelength over 2 pi""", - (2.1030891047E-16, 1.5E-25, """m""")), - ("""proton-electron mass ratio""", (1836.15267245, 7.5E-7, """""")), - ("""proton g factor""", (5.585694713, 4.6E-8, """""")), - ("""proton gyromag. ratio""", (2.675222005E8, 6.3, """s^-1 T^-1""")), + (2.1030891047e-16, 1.5e-25, """m""")), + ("""proton-electron mass ratio""", (1836.15267245, 7.5e-7, """""")), + ("""proton g factor""", (5.585694713, 4.6e-8, """""")), + ("""proton gyromag. ratio""", (2.675222005e8, 6.3, """s^-1 T^-1""")), ( """proton gyromag. ratio over 2 pi""", - (42.57748060, 1.0E-6, """MHz T^-1""")), - ("""proton mag. mom.""", (1.410606743E-26, 3.3E-34, """J T^-1""")), + (42.57748060, 1.0e-6, """MHz T^-1""")), + ("""proton mag. mom.""", (1.410606743e-26, 3.3e-34, """J T^-1""")), ( """proton mag. mom. to Bohr magneton ratio""", - (0.001521032210, 1.2E-11, """""")), + (0.001521032210, 1.2e-11, """""")), ( """proton mag. mom. to nuclear magneton ratio""", - (2.792847356, 2.3E-8, """""")), - ("""proton mag. shielding correction""", (0.0000256940, 1.4E-8, """""")), - ("""proton mass""", (1.672621777E-27, 7.4E-35, """kg""")), - ("""proton mass energy equivalent""", (1.503277484E-10, 6.6E-18, """J""")), + (2.792847356, 2.3e-8, """""")), + ("""proton mag. shielding correction""", (0.0000256940, 1.4e-8, """""")), + ("""proton mass""", (1.672621777e-27, 7.4e-35, """kg""")), + ("""proton mass energy equivalent""", (1.503277484e-10, 6.6e-18, """J""")), ( """proton mass energy equivalent in MeV""", (938.2720460, 0.000021, """MeV""")), - ("""proton mass in u""", (1.0072764668120, 9.0E-11, """u""")), - ("""proton molar mass""", (0.0010072764668120, 9.0E-14, """kg mol^-1""")), - ("""proton-muon mass ratio""", (8.880243310, 2.2E-7, """""")), - ("""proton-neutron mag. mom. ratio""", (-1.459898060, 3.4E-7, """""")), - ("""proton-neutron mass ratio""", (0.998623478260, 4.5E-10, """""")), - ("""proton rms charge radius""", (8.7750E-16, 5.1E-18, """m""")), + ("""proton mass in u""", (1.0072764668120, 9.0e-11, """u""")), + ("""proton molar mass""", (0.0010072764668120, 9.0e-14, """kg mol^-1""")), + ("""proton-muon mass ratio""", (8.880243310, 2.2e-7, """""")), + ("""proton-neutron mag. mom. ratio""", (-1.459898060, 3.4e-7, """""")), + ("""proton-neutron mass ratio""", (0.998623478260, 4.5e-10, """""")), + ("""proton rms charge radius""", (8.7750e-16, 5.1e-18, """m""")), ("""proton-tau mass ratio""", (0.528063, 0.000048, """""")), - ("""quantum of circulation""", (0.0003636947552, 2.4E-13, """m^2 s^-1""")), + ("""quantum of circulation""", (0.0003636947552, 2.4e-13, """m^2 s^-1""")), ( """quantum of circulation times 2""", - (0.0007273895104, 4.7E-13, """m^2 s^-1""")), - ("""Rydberg constant""", (1.0973731568539E7, 0.000055, """m^-1""")), + (0.0007273895104, 4.7e-13, """m^2 s^-1""")), + ("""Rydberg constant""", (1.0973731568539e7, 0.000055, """m^-1""")), ( """Rydberg constant times c in Hz""", - (3.289841960364E15, 17000.0, """Hz""")), - ("""Rydberg constant times hc in eV""", (13.60569253, 3.0E-7, """eV""")), - ("""Rydberg constant times hc in J""", (2.179872171E-18, 9.6E-26, """J""")), + (3.289841960364e15, 17000.0, """Hz""")), + ("""Rydberg constant times hc in eV""", (13.60569253, 3.0e-7, """eV""")), + ("""Rydberg constant times hc in J""", (2.179872171e-18, 9.6e-26, """J""")), ( """Sackur-Tetrode constant (1 K, 100 kPa)""", - (-1.1517078, 2.3E-6, """""")), + (-1.1517078, 2.3e-6, """""")), ( """Sackur-Tetrode constant (1 K, 101.325 kPa)""", - (-1.1648708, 2.3E-6, """""")), - ("""second radiation constant""", (0.014387770, 1.3E-8, """m K""")), + (-1.1648708, 2.3e-6, """""")), + ("""second radiation constant""", (0.014387770, 1.3e-8, """m K""")), ( """shielded helion gyromag. ratio""", - (2.037894659E8, 5.1, """s^-1 T^-1""")), + (2.037894659e8, 5.1, """s^-1 T^-1""")), ( """shielded helion gyromag. ratio over 2 pi""", - (32.43410084, 8.1E-7, """MHz T^-1""")), + (32.43410084, 8.1e-7, """MHz T^-1""")), ( """shielded helion mag. mom.""", - (-1.074553044E-26, 2.7E-34, """J T^-1""")), + (-1.074553044e-26, 2.7e-34, """J T^-1""")), ( """shielded helion mag. mom. to Bohr magneton ratio""", - (-0.001158671471, 1.4E-11, """""")), + (-0.001158671471, 1.4e-11, """""")), ( """shielded helion mag. mom. to nuclear magneton ratio""", - (-2.127497718, 2.5E-8, """""")), + (-2.127497718, 2.5e-8, """""")), ( """shielded helion to proton mag. mom. ratio""", - (-0.7617665580, 1.1E-8, """""")), + (-0.7617665580, 1.1e-8, """""")), ( """shielded helion to shielded proton mag. mom. ratio""", - (-0.7617861313, 3.3E-9, """""")), + (-0.7617861313, 3.3e-9, """""")), ( """shielded proton gyromag. ratio""", - (2.675153268E8, 6.6, """s^-1 T^-1""")), + (2.675153268e8, 6.6, """s^-1 T^-1""")), ( """shielded proton gyromag. ratio over 2 pi""", - (42.57638660, 1.0E-6, """MHz T^-1""")), - ("""shielded proton mag. mom.""", (1.410570499E-26, 3.5E-34, """J T^-1""")), + (42.57638660, 1.0e-6, """MHz T^-1""")), + ("""shielded proton mag. mom.""", (1.410570499e-26, 3.5e-34, """J T^-1""")), ( """shielded proton mag. mom. to Bohr magneton ratio""", - (0.001520993128, 1.7E-11, """""")), + (0.001520993128, 1.7e-11, """""")), ( """shielded proton mag. mom. to nuclear magneton ratio""", - (2.792775598, 3.0E-8, """""")), - ("""speed of light in vacuum""", (2.99792458E8, 0d, """m s^-1""")), + (2.792775598, 3.0e-8, """""")), + ("""speed of light in vacuum""", (2.99792458e8, 0d, """m s^-1""")), ("""standard acceleration of gravity""", (9.80665, 0d, """m s^-2""")), ("""standard atmosphere""", (101325.0, 0d, """Pa""")), ("""standard-state pressure""", (100000.0, 0d, """Pa""")), ( """Stefan-Boltzmann constant""", - (5.670373E-8, 2.1E-13, """W m^-2 K^-4""")), - ("""tau Compton wavelength""", (6.97787E-16, 6.3E-20, """m""")), - ("""tau Compton wavelength over 2 pi""", (1.11056E-16, 1.0E-20, """m""")), + (5.670373e-8, 2.1e-13, """W m^-2 K^-4""")), + ("""tau Compton wavelength""", (6.97787e-16, 6.3e-20, """m""")), + ("""tau Compton wavelength over 2 pi""", (1.11056e-16, 1.0e-20, """m""")), ("""tau-electron mass ratio""", (3477.15, 0.31, """""")), - ("""tau mass""", (3.16747E-27, 2.9E-31, """kg""")), - ("""tau mass energy equivalent""", (2.84678E-10, 2.6E-14, """J""")), + ("""tau mass""", (3.16747e-27, 2.9e-31, """kg""")), + ("""tau mass energy equivalent""", (2.84678e-10, 2.6e-14, """J""")), ("""tau mass energy equivalent in MeV""", (1776.82, 0.16, """MeV""")), ("""tau mass in u""", (1.90749, 0.00017, """u""")), - ("""tau molar mass""", (0.00190749, 1.7E-7, """kg mol^-1""")), + ("""tau molar mass""", (0.00190749, 1.7e-7, """kg mol^-1""")), ("""tau-muon mass ratio""", (16.8167, 0.0015, """""")), ("""tau-neutron mass ratio""", (1.89111, 0.00017, """""")), ("""tau-proton mass ratio""", (1.89372, 0.00017, """""")), - ("""Thomson cross section""", (6.652458734E-29, 1.3E-37, """m^2""")), - ("""triton-electron mass ratio""", (5496.92152670, 5.0E-6, """""")), - ("""triton g factor""", (5.957924896, 7.6E-8, """""")), - ("""triton mag. mom.""", (1.504609447E-26, 3.8E-34, """J T^-1""")), + ("""Thomson cross section""", (6.652458734e-29, 1.3e-37, """m^2""")), + ("""triton-electron mass ratio""", (5496.92152670, 5.0e-6, """""")), + ("""triton g factor""", (5.957924896, 7.6e-8, """""")), + ("""triton mag. mom.""", (1.504609447e-26, 3.8e-34, """J T^-1""")), ( """triton mag. mom. to Bohr magneton ratio""", - (0.001622393657, 2.1E-11, """""")), + (0.001622393657, 2.1e-11, """""")), ( """triton mag. mom. to nuclear magneton ratio""", - (2.978962448, 3.8E-8, """""")), - ("""triton mass""", (5.0073563E-27, 2.2E-34, """kg""")), - ("""triton mass energy equivalent""", (4.50038741E-10, 2.0E-17, """J""")), + (2.978962448, 3.8e-8, """""")), + ("""triton mass""", (5.0073563e-27, 2.2e-34, """kg""")), + ("""triton mass energy equivalent""", (4.50038741e-10, 2.0e-17, """J""")), ( """triton mass energy equivalent in MeV""", (2808.921005, 0.000062, """MeV""")), - ("""triton mass in u""", (3.01550071340, 2.5E-9, """u""")), - ("""triton molar mass""", (0.00301550071340, 2.5E-12, """kg mol^-1""")), - ("""triton-proton mass ratio""", (2.99371703080, 2.5E-9, """""")), - ("""unified atomic mass unit""", (1.660538921E-27, 7.3E-35, """kg""")), - ("""von Klitzing constant""", (25812.8074434, 8.4E-6, """ohm""")), + ("""triton mass in u""", (3.01550071340, 2.5e-9, """u""")), + ("""triton molar mass""", (0.00301550071340, 2.5e-12, """kg mol^-1""")), + ("""triton-proton mass ratio""", (2.99371703080, 2.5e-9, """""")), + ("""unified atomic mass unit""", (1.660538921e-27, 7.3e-35, """kg""")), + ("""von Klitzing constant""", (25812.8074434, 8.4e-6, """ohm""")), ("""weak mixing angle""", (0.2223, 0.0021, """""")), ( """Wien frequency displacement law constant""", - (5.8789254E10, 53000.0, """Hz K^-1""")), + (5.8789254e10, 53000.0, """Hz K^-1""")), ( """Wien wavelength displacement law constant""", - (0.0028977721, 2.6E-9, """m K""")) + (0.0028977721, 2.6e-9, """m K""")) ) // diff --git a/repos/breeze/math/src/main/scala/breeze/numerics/constants/package.scala b/repos/breeze/math/src/main/scala/breeze/numerics/constants/package.scala index fff9ba2ecde..190a558fbda 100644 --- a/repos/breeze/math/src/main/scala/breeze/numerics/constants/package.scala +++ b/repos/breeze/math/src/main/scala/breeze/numerics/constants/package.scala @@ -40,7 +40,7 @@ package object constants { /** [N / A2] *@see http://physics.nist.gov/cgi-bin/cuu/Value?mu0 */ - val MagneticConstant: Double = 4.0E-7 * Pi + val MagneticConstant: Double = 4.0e-7 * Pi /** Alias for [[MagneticConstant]] */ @@ -49,7 +49,7 @@ package object constants { /** [F / m] *@see http://physics.nist.gov/cgi-bin/cuu/Value?ep0 */ - val ElectricConstant: Double = 8.854187817E-12 + val ElectricConstant: Double = 8.854187817e-12 /** Alias for [[ElectricConstant]] */ @@ -58,7 +58,7 @@ package object constants { /** [] *@see http://physics.nist.gov/cgi-bin/cuu/Value?alph */ - val FineStructureConstant: Double = 7.2973525698E-3 + val FineStructureConstant: Double = 7.2973525698e-3 /** Alias for [[FineStructureConstant]] */ @@ -71,7 +71,7 @@ package object constants { /** [m3 /kg /s] * @see http://physics.nist.gov/cgi-bin/cuu/Value?bg */ - val GravitationConstant: Double = 6.67384E-11 + val GravitationConstant: Double = 6.67384e-11 /** [m /s2] * @see http://physics.nist.gov/cgi-bin/cuu/Value?gn @@ -89,7 +89,7 @@ package object constants { /** [ /mol] * @see http://physics.nist.gov/cgi-bin/cuu/Value?na */ - val AvogadroNumber: Double = 6.02214129E23 + val AvogadroNumber: Double = 6.02214129e23 /** ALIAS FOR [[AvogadroNumber]] */ @@ -107,7 +107,7 @@ package object constants { /** [J /K] * @see http://physics.nist.gov/cgi-bin/cuu/Value?k */ - val BoltzmannConstant: Double = 1.3806488E-23 + val BoltzmannConstant: Double = 1.3806488e-23 /** ALIAS FOR [[BoltzmannConstant]] */ @@ -119,7 +119,7 @@ package object constants { /** [m/s] * @see http://en.wikipedia.org/wiki/Light_speed */ - val LightSpeed: Double = 2.99792458E8 + val LightSpeed: Double = 2.99792458e8 /** ALIAS FOR [[LightSpeed]] */ @@ -128,7 +128,7 @@ package object constants { /** [J * s] * @see http://physics.nist.gov/cgi-bin/cuu/Value?h */ - val PlanckConstant: Double = 6.62606957E-34 + val PlanckConstant: Double = 6.62606957e-34 /** ALIAS FOR [[PlanckConstant]] */ @@ -141,7 +141,7 @@ package object constants { /** [C] * @see http://physics.nist.gov/cgi-bin/cuu/Value?e */ - val ElementaryCharge: Double = 1.602176565E-19 + val ElementaryCharge: Double = 1.602176565e-19 /** ALIAS FOR [[ElementaryCharge]] */ @@ -150,17 +150,17 @@ package object constants { /** [kg] * @see http://physics.nist.gov/cgi-bin/cuu/Value?me */ - val ElectronMass: Double = 9.10938291E-31 + val ElectronMass: Double = 9.10938291e-31 /** [kg] * @see http://physics.nist.gov/cgi-bin/cuu/Value?mp */ - val ProtonMass: Double = 1.672621777E-27 + val ProtonMass: Double = 1.672621777e-27 /** [kg] * @see http://physics.nist.gov/cgi-bin/cuu/Value?mn */ - val NeutronMass: Double = 1.674927351E-27 + val NeutronMass: Double = 1.674927351e-27 /** [/m] * @see http://physics.nist.gov/cgi-bin/cuu/Value?ryd @@ -170,7 +170,7 @@ package object constants { /** [m K] * @see http://physics.nist.gov/cgi-bin/cuu/Value?bwien */ - val WienDisplacementLawConstant: Double = 2.8977721E-3 + val WienDisplacementLawConstant: Double = 2.8977721e-3 /** ALIAS FOR [[WienDisplacementLawConstant]] */ @@ -179,7 +179,7 @@ package object constants { /** [W /m2 /K4] * @see http://physics.nist.gov/cgi-bin/cuu/Value?sigma */ - val StefanBoltzmannConstant: Double = 5.670373E-8 + val StefanBoltzmannConstant: Double = 5.670373e-8 /** ALIAS FOR [[StefanBoltzmannConstant]] */ @@ -190,64 +190,64 @@ package object constants { // /**SI prefix for 1.0E24*/ - val yotta = 1.0E24 + val yotta = 1.0e24 /**SI prefix for 1.0E21*/ - val zetta = 1.0E21 + val zetta = 1.0e21 /**SI prefix for 1.0E18*/ - val exa = 1.0E18 + val exa = 1.0e18 /**SI prefix for 1.0E15*/ - val peta = 1.0E15 + val peta = 1.0e15 /**SI prefix for 1.0E12*/ - val tera = 1.0E12 + val tera = 1.0e12 /**SI prefix for 1.0E9*/ - val giga = 1.0E9 + val giga = 1.0e9 /**SI prefix for 1.0E6*/ - val mega = 1.0E6 + val mega = 1.0e6 /**SI prefix for 1.0E3*/ - val kilo = 1.0E3 + val kilo = 1.0e3 /**SI prefix for 1.0E2*/ - val hecto = 1.0E2 + val hecto = 1.0e2 /**SI prefix for 1.0E1*/ - val deca = 1.0E1 + val deca = 1.0e1 /**SI prefix for 1.0E-1*/ - val deci = 1.0E-1 + val deci = 1.0e-1 /**SI prefix for 1.0E-2*/ - val centi = 1.0E-2 + val centi = 1.0e-2 /**SI prefix for 1.0E-3*/ - val milli = 1.0E-3 + val milli = 1.0e-3 /**SI prefix for 1.0E-6*/ - val micro = 1.0E-6 + val micro = 1.0e-6 /**SI prefix for 1.0E-9*/ - val nano = 1.0E-9 + val nano = 1.0e-9 /**SI prefix for 1.0E-12*/ - val pico = 1.0E-12 + val pico = 1.0e-12 /**SI prefix for 1.0E-15*/ - val femto = 1.0E-15 + val femto = 1.0e-15 /**SI prefix for 1.0E-18*/ - val atto = 1.0E-18 + val atto = 1.0e-18 /**SI prefix for 1.0E-21*/ - val zepto = 1.0E-21 + val zepto = 1.0e-21 /**SI prefix for 1.0E-24*/ - val yocto = 1.0E-24 + val yocto = 1.0e-24 // // diff --git a/repos/breeze/math/src/main/scala/breeze/numerics/financial/package.scala b/repos/breeze/math/src/main/scala/breeze/numerics/financial/package.scala index 239fb616c1a..7adfa0cdca1 100644 --- a/repos/breeze/math/src/main/scala/breeze/numerics/financial/package.scala +++ b/repos/breeze/math/src/main/scala/breeze/numerics/financial/package.scala @@ -254,7 +254,7 @@ package object financial { fv: Double, when: PaymentTime = End, guess: Double = 0.1, - tol: Double = 1E-06, + tol: Double = 1e-06, maxiter: Int = 100) = { var rate = guess; var iter = 0 diff --git a/repos/breeze/math/src/main/scala/breeze/numerics/package.scala b/repos/breeze/math/src/main/scala/breeze/numerics/package.scala index f6bb5201fb3..35f94b3f304 100644 --- a/repos/breeze/math/src/main/scala/breeze/numerics/package.scala +++ b/repos/breeze/math/src/main/scala/breeze/numerics/package.scala @@ -297,16 +297,23 @@ package object numerics { implicit object sincpiIntImpl extends Impl[Int, Double] { def apply(v: Int) = if (v == 0) 1d - else { val temp = v.toDouble * m.Pi; m.sin(temp) / temp } + else { + val temp = v.toDouble * m.Pi; m.sin(temp) / temp + } } implicit object sincpiDoubleImpl extends Impl[Double, Double] { def apply(v: Double) = - if (v == 0) 1d else { val temp = v * m.Pi; m.sin(temp) / temp } + if (v == 0) 1d + else { + val temp = v * m.Pi; m.sin(temp) / temp + } } implicit object sincpiFloatImpl extends Impl[Float, Float] { def apply(v: Float) = if (v == 0) 1f - else { val temp = v * m.Pi; (m.sin(temp) / temp).toFloat } + else { + val temp = v * m.Pi; (m.sin(temp) / temp).toFloat + } } } @@ -664,7 +671,7 @@ package object numerics { ap += 1 del *= x / ap sum += del - if (scala.math.abs(del) < scala.math.abs(sum) * 1E-7) { + if (scala.math.abs(del) < scala.math.abs(sum) * 1e-7) { result = -x + a * m.log(x) + m.log(sum) n = 100 } @@ -684,13 +691,13 @@ package object numerics { val an = -n * (n - a) b += 2.0 d = an * d + b - if (scala.math.abs(d) < 1E-30) d = 1E-30 + if (scala.math.abs(d) < 1e-30) d = 1e-30 c = b + an / c - if (scala.math.abs(c) < 1E-30) c = 1E-30 + if (scala.math.abs(c) < 1e-30) c = 1e-30 d = 1.0 / d val del = d * c h *= del - if (scala.math.abs(del - 1.0) < 1E-7) n = 101 + if (scala.math.abs(del - 1.0) < 1e-7) n = 101 } if (n == 100) throw new ArithmeticException("Convergence failed") @@ -811,7 +818,7 @@ package object numerics { f /= n xx *= x2 val del = f * xx / (2 * n + 1) - if (del < 1E-8) n = 101 + if (del < 1e-8) n = 101 y += del } y = y * 2 / m.sqrt(Pi) @@ -910,7 +917,7 @@ package object numerics { /** * closeTo for Doubles. */ - def closeTo(a: Double, b: Double, relDiff: Double = 1E-4) = { + def closeTo(a: Double, b: Double, relDiff: Double = 1e-4) = { a == b || (scala.math.abs(a - b) < scala.math .max(scala.math.max(scala.math.abs(a), scala.math.abs(b)), 1) * relDiff) diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/AdaptiveGradientDescent.scala b/repos/breeze/math/src/main/scala/breeze/optimize/AdaptiveGradientDescent.scala index 31ba04e24a7..04c7f6698bb 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/AdaptiveGradientDescent.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/AdaptiveGradientDescent.scala @@ -34,7 +34,7 @@ object AdaptiveGradientDescent { val regularizationConstant: Double = 1.0, stepSize: Double, maxIter: Int, - tolerance: Double = 1E-8, + tolerance: Double = 1e-8, minImprovementWindow: Int = 50)( implicit vspace: MutableFiniteCoordinateField[T, _, Double], rand: RandBasis = Rand) @@ -44,7 +44,7 @@ object AdaptiveGradientDescent { tolerance, minImprovementWindow) { - val delta = 1E-4 + val delta = 1e-4 import vspace._ case class History(sumOfSquaredGradients: T) @@ -105,7 +105,7 @@ object AdaptiveGradientDescent { */ class L1Regularization[T]( val lambda: Double = 1.0, - delta: Double = 1E-5, + delta: Double = 1e-5, eta: Double = 4, maxIter: Int = 100)( implicit space: MutableFiniteCoordinateField[T, _, Double], diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/ApproximateGradientFunction.scala b/repos/breeze/math/src/main/scala/breeze/optimize/ApproximateGradientFunction.scala index e33d68685b4..bc65062f012 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/ApproximateGradientFunction.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/ApproximateGradientFunction.scala @@ -10,7 +10,7 @@ import linalg.{NumericOps, Tensor} * Approximates a gradient by finite differences. * @author dlwh */ -class ApproximateGradientFunction[K, T](f: T => Double, epsilon: Double = 1E-5)( +class ApproximateGradientFunction[K, T](f: T => Double, epsilon: Double = 1e-5)( implicit zeros: CanCreateZerosLike[T, T], view: T <:< Tensor[K, Double], copy: CanCopy[T]) diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/BacktrackingLineSearch.scala b/repos/breeze/math/src/main/scala/breeze/optimize/BacktrackingLineSearch.scala index 56a0f2d676a..1eef47d2123 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/BacktrackingLineSearch.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/BacktrackingLineSearch.scala @@ -13,10 +13,10 @@ class BacktrackingLineSearch( maxIterations: Int = 20, shrinkStep: Double = 0.5, growStep: Double = 2.1, - cArmijo: Double = 1E-4, + cArmijo: Double = 1e-4, cWolfe: Double = 0.9, - minAlpha: Double = 1E-10, - maxAlpha: Double = 1E10, + minAlpha: Double = 1e-10, + maxAlpha: Double = 1e10, enforceWolfeConditions: Boolean = true, enforceStrongWolfeConditions: Boolean = true) extends ApproximateLineSearch { diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/FirstOrderMinimizer.scala b/repos/breeze/math/src/main/scala/breeze/optimize/FirstOrderMinimizer.scala index 9d0fc575581..e0125efe1d0 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/FirstOrderMinimizer.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/FirstOrderMinimizer.scala @@ -25,7 +25,7 @@ abstract class FirstOrderMinimizer[T, DF <: StochasticDiffFunction[T]]( def this( maxIter: Int = -1, - tolerance: Double = 1E-6, + tolerance: Double = 1e-6, fvalMemory: Int = 100, relativeTolerance: Boolean = true)( implicit space: NormedModule[T, Double]) = @@ -97,7 +97,7 @@ abstract class FirstOrderMinimizer[T, DF <: StochasticDiffFunction[T]]( val (adjValue, adjGrad) = adjust(x, grad, value) val oneOffImprovement = (state.adjustedValue - adjValue) / - (state.adjustedValue.abs max adjValue.abs max 1E-6 * state.initialAdjVal.abs) + (state.adjustedValue.abs max adjValue.abs max 1e-6 * state.initialAdjVal.abs) logger.info( f"Val and Grad Norm: $adjValue%.6g (rel: $oneOffImprovement%.3g) ${norm(adjGrad)}%.6g") val history = updateHistory(x, grad, value, adjustedFun, state) @@ -291,7 +291,7 @@ object FirstOrderMinimizer { } def functionValuesConverged[T]( - tolerance: Double = 1E-9, + tolerance: Double = 1e-9, relative: Boolean = true, historyLength: Int = 10): ConvergenceCheck[T] = { new FunctionValuesConverged[T](tolerance, relative, historyLength) @@ -336,7 +336,7 @@ object FirstOrderMinimizer { tolerance * (if (relative) s.adjustedValue else 1.0), - 1E-8)) => + 1e-8)) => GradientConverged } } @@ -358,7 +358,7 @@ object FirstOrderMinimizer { def monitorFunctionValues[T]( f: T => Double, numFailures: Int = 5, - improvementRequirement: Double = 1E-2, + improvementRequirement: Double = 1e-2, evalFrequency: Int = 10): ConvergenceCheck[T] = new MonitorFunctionValuesCheck( f, @@ -445,7 +445,7 @@ object FirstOrderMinimizer { alpha: Double = 0.5, maxIterations: Int = 1000, useL1: Boolean = false, - tolerance: Double = 1E-5, + tolerance: Double = 1e-5, useStochastic: Boolean = false, randomSeed: Int = 0) { private implicit val random = new RandBasis( diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/GradientTester.scala b/repos/breeze/math/src/main/scala/breeze/optimize/GradientTester.scala index ad2fc27fccb..77acfbc530c 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/GradientTester.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/GradientTester.scala @@ -34,8 +34,8 @@ object GradientTester extends SerializableLogging { x: T, randFraction: Double = 0.01, skipZeros: Boolean = false, - epsilon: Double = 1E-8, - tolerance: Double = 1E-3, + epsilon: Double = 1e-8, + tolerance: Double = 1e-3, toString: K => String = { (_: K).toString })( implicit view2: T <:< NumericOps[T], view: T <:< Tensor[K, Double], @@ -57,7 +57,7 @@ object GradientTester extends SerializableLogging { skipZeros: Boolean = false, toString: (K) => String = { (_: K).toString }, epsilon: Double = 1e-8, - tolerance: Double = 1E-3)( + tolerance: Double = 1e-3)( implicit view2: T <:< NumericOps[T], view: T <:< Tensor[K, Double], copy: CanCopy[T], @@ -78,7 +78,7 @@ object GradientTester extends SerializableLogging { xx(k) -= epsilon val relDif = (grad - - trueGrad(k)).abs / math.max(trueGrad(k).abs, grad.abs).max(1E-4) + trueGrad(k)).abs / math.max(trueGrad(k).abs, grad.abs).max(1e-4) if (relDif < tolerance) { ok += 1 logger.debug(s"OK: ${toString(k)} $relDif") diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/LBFGS.scala b/repos/breeze/math/src/main/scala/breeze/optimize/LBFGS.scala index 97a514cb9d1..40b626a44bb 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/LBFGS.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/LBFGS.scala @@ -42,7 +42,7 @@ class LBFGS[T](convergenceCheck: ConvergenceCheck[T], m: Int)( extends FirstOrderMinimizer[T, DiffFunction[T]](convergenceCheck) with SerializableLogging { - def this(maxIter: Int = -1, m: Int = 7, tolerance: Double = 1E-9)( + def this(maxIter: Int = -1, m: Int = 7, tolerance: Double = 1e-9)( implicit space: MutableInnerProductModule[T, Double]) = this(FirstOrderMinimizer.defaultConvergenceCheck(maxIter, tolerance), m) import space._ @@ -91,7 +91,7 @@ class LBFGS[T](convergenceCheck: ConvergenceCheck[T], m: Int)( val alpha = search.minimize(ff, if (state.iter == 0.0) 1.0 / norm(dir) else 1.0) - if (alpha * norm(grad) < 1E-10) throw new StepSizeUnderflow + if (alpha * norm(grad) < 1e-10) throw new StepSizeUnderflow alpha } } diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/LBFGSB.scala b/repos/breeze/math/src/main/scala/breeze/optimize/LBFGSB.scala index 03495133d97..1b86f87fc69 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/LBFGSB.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/LBFGSB.scala @@ -38,7 +38,7 @@ class LBFGSB( upperBounds: DenseVector[Double], maxIter: Int = 100, m: Int = 5, - tolerance: Double = 1E-8, + tolerance: Double = 1e-8, maxZoomIter: Int = 64, maxLineSearchIter: Int = 64) extends FirstOrderMinimizer[ @@ -47,7 +47,7 @@ class LBFGSB( LBFGSB .defaultConvergenceCheck(lowerBounds, upperBounds, tolerance, maxIter)) with SerializableLogging { - protected val EPS = 2.2E-16 + protected val EPS = 2.2e-16 /** * @@ -372,7 +372,7 @@ object LBFGSB { FirstOrderMinimizer.maxIterationsReached(maxIter) } - protected val PROJ_GRADIENT_EPS = 1E-5 + protected val PROJ_GRADIENT_EPS = 1e-5 protected def bfgsbConvergenceTest( lowerBounds: DenseVector[Double], upperBounds: DenseVector[Double]): ConvergenceCheck[DenseVector[Double]] = diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/OWLQN.scala b/repos/breeze/math/src/main/scala/breeze/optimize/OWLQN.scala index 5b46f85537d..960673c676d 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/OWLQN.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/OWLQN.scala @@ -20,19 +20,19 @@ class OWLQN[K, T](maxIter: Int, m: Int, l1reg: K => Double, tolerance: Double)( def this(maxIter: Int, m: Int, l1reg: K => Double)( implicit space: MutableEnumeratedCoordinateField[T, K, Double]) = - this(maxIter, m, l1reg, 1E-8) + this(maxIter, m, l1reg, 1e-8) - def this(maxIter: Int, m: Int, l1reg: Double, tolerance: Double = 1E-8)( + def this(maxIter: Int, m: Int, l1reg: Double, tolerance: Double = 1e-8)( implicit space: MutableEnumeratedCoordinateField[T, K, Double]) = this(maxIter, m, (_: K) => l1reg, tolerance) def this(maxIter: Int, m: Int, l1reg: Double)( implicit space: MutableEnumeratedCoordinateField[T, K, Double]) = - this(maxIter, m, (_: K) => l1reg, 1E-8) + this(maxIter, m, (_: K) => l1reg, 1e-8) def this(maxIter: Int, m: Int)( implicit space: MutableEnumeratedCoordinateField[T, K, Double]) = - this(maxIter, m, (_: K) => 1.0, 1E-8) + this(maxIter, m, (_: K) => 1.0, 1e-8) require(m > 0) diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/OptimizationOption.scala b/repos/breeze/math/src/main/scala/breeze/optimize/OptimizationOption.scala index a462b28edd2..5b8294274cc 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/OptimizationOption.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/OptimizationOption.scala @@ -45,7 +45,7 @@ case class StepSizeScale(alpha: Double = 1.0) extends OptimizationOption { } } -case class Tolerance(fvalTolerance: Double = 1E-5, gvalTolerance: Double = 1e-6) +case class Tolerance(fvalTolerance: Double = 1e-5, gvalTolerance: Double = 1e-6) extends OptimizationOption { def apply(params: OptParams): OptParams = { // TODO: gvaltolerance diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/ProjectedQuasiNewton.scala b/repos/breeze/math/src/main/scala/breeze/optimize/ProjectedQuasiNewton.scala index 6bafcc0a117..fd825cd83d6 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/ProjectedQuasiNewton.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/ProjectedQuasiNewton.scala @@ -213,7 +213,7 @@ class ProjectedQuasiNewton( var alpha = if (state.iter == 0.0) min(1.0, 1.0 / norm(dir)) else 1.0 alpha = search.minimize(ff, alpha) - if (alpha * norm(grad) < 1E-10) throw new StepSizeUnderflow + if (alpha * norm(grad) < 1e-10) throw new StepSizeUnderflow alpha } diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/SecondOrderFunction.scala b/repos/breeze/math/src/main/scala/breeze/optimize/SecondOrderFunction.scala index 3fdbdd2720d..95d7937e4a3 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/SecondOrderFunction.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/SecondOrderFunction.scala @@ -31,7 +31,7 @@ trait SecondOrderFunction[T, H] extends DiffFunction[T] { } object SecondOrderFunction { - def empirical[T, I](f: DiffFunction[T], eps: Double = 1E-5)( + def empirical[T, I](f: DiffFunction[T], eps: Double = 1e-5)( implicit vs: VectorSpace[T, Double]) : SecondOrderFunction[T, EmpiricalHessian[T]] = { new SecondOrderFunction[T, EmpiricalHessian[T]] { @@ -47,7 +47,7 @@ object SecondOrderFunction { def minibatchEmpirical[T, I]( f: BatchDiffFunction[T], - eps: Double = 1E-5, + eps: Double = 1e-5, batchSize: Int = 30000)(implicit vs: InnerProductVectorSpace[T, Double]) : SecondOrderFunction[T, EmpiricalHessian[T]] = { new SecondOrderFunction[T, EmpiricalHessian[T]] { @@ -84,7 +84,7 @@ class EmpiricalHessian[T]( df: DiffFunction[T], x: T, grad: T, - eps: Double = 1E-5)(implicit vs: VectorSpace[T, Double]) { + eps: Double = 1e-5)(implicit vs: VectorSpace[T, Double]) { import vs._ @@ -119,7 +119,7 @@ object EmpiricalHessian { def hessian( df: DiffFunction[DenseVector[Double]], x: DenseVector[Double], - eps: Double = 1E-5)( + eps: Double = 1e-5)( implicit vs: VectorSpace[DenseVector[Double], Double], copy: CanCopy[DenseVector[Double]]): DenseMatrix[Double] = { import vs._ diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/StochasticGradientDescent.scala b/repos/breeze/math/src/main/scala/breeze/optimize/StochasticGradientDescent.scala index 54961caae7c..8605784d0a0 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/StochasticGradientDescent.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/StochasticGradientDescent.scala @@ -27,7 +27,7 @@ import breeze.util._ abstract class StochasticGradientDescent[T]( val defaultStepSize: Double, val maxIter: Int, - tolerance: Double = 1E-5, + tolerance: Double = 1e-5, fvalMemory: Int = 100)( implicit protected val vspace: NormedModule[T, Double]) extends FirstOrderMinimizer[T, StochasticDiffFunction[T]]( diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/TruncatedNewtonMinimizer.scala b/repos/breeze/math/src/main/scala/breeze/optimize/TruncatedNewtonMinimizer.scala index 53c64002add..2f53dc2457b 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/TruncatedNewtonMinimizer.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/TruncatedNewtonMinimizer.scala @@ -15,7 +15,7 @@ import breeze.util.SerializableLogging */ class TruncatedNewtonMinimizer[T, H]( maxIterations: Int = -1, - tolerance: Double = 1E-6, + tolerance: Double = 1e-6, l2Regularization: Double = 0, m: Int = 0)( implicit space: MutableVectorField[T, Double], diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/linear/AffineScaling.scala b/repos/breeze/math/src/main/scala/breeze/optimize/linear/AffineScaling.scala index b311a55a845..4ffba411a45 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/linear/AffineScaling.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/linear/AffineScaling.scala @@ -19,7 +19,7 @@ class AffineScaling extends SerializableLogging { c: DenseVector[Double], x0: DenseVector[Double], gamma: Double = 0.5, - eps: Double = 1E-5) = { + eps: Double = 1e-5) = { var converged = false var x = x0 var cv = x dot c diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/linear/ConjugateGradient.scala b/repos/breeze/math/src/main/scala/breeze/optimize/linear/ConjugateGradient.scala index e4ea41bdb15..e0bf2de8852 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/linear/ConjugateGradient.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/linear/ConjugateGradient.scala @@ -17,7 +17,7 @@ class ConjugateGradient[T, M]( maxNormValue: Double = Double.PositiveInfinity, maxIterations: Int = -1, normSquaredPenalty: Double = 0, - tolerance: Double = 1E-5)( + tolerance: Double = 1e-5)( implicit space: MutableInnerProductVectorSpace[T, Double], mult: OpMulMatrix.Impl2[M, T, T]) extends SerializableLogging { diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/linear/InteriorPoint.scala b/repos/breeze/math/src/main/scala/breeze/optimize/linear/InteriorPoint.scala index 3d3daac4827..9d743012b88 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/linear/InteriorPoint.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/linear/InteriorPoint.scala @@ -8,7 +8,7 @@ import breeze.linalg._ * @author dlwh */ object InteriorPoint { - val TOLERANCE = 1E-18 + val TOLERANCE = 1e-18 /** * @@ -85,7 +85,7 @@ object InteriorPoint { b: DenseVector[Double], c: DenseVector[Double], x0: DenseVector[Double]) = { - val s = max(A * x0 - b) + 1E-7 + val s = max(A * x0 - b) + 1e-7 val newA = DenseMatrix.zeros[Double](A.rows + 1, A.cols + 1) newA(0 until A.rows, 0 until A.cols) := A newA(0 until A.rows + 1, A.cols) := -1.0 @@ -100,7 +100,7 @@ object InteriorPoint { throw new RuntimeException("Problem seems to be infeasible!") } val r = minimize(newA, newB, newC, newX) - if (r(x0.size) > 1E-8) + if (r(x0.size) > 1e-8) println("Problem appears to be infeasible: " + r(x0.size)) r.slice(0, x0.size) } @@ -152,7 +152,7 @@ object InteriorPoint { horzcat(A.t, zeros[Double](n, n + m)), horzcat(diag(s), zeros[Double](m, n), diag(z))) - diag(mat) += 1E-20 + diag(mat) += 1e-20 val r = DenseVector.zeros[Double](m + n + m) r.slice((m + n), (m + n + m)) -= (dsaff :* dzaff - sigma / m * (s dot z)) diff --git a/repos/breeze/math/src/main/scala/breeze/optimize/linear/PowerMethod.scala b/repos/breeze/math/src/main/scala/breeze/optimize/linear/PowerMethod.scala index 8997403ac42..84d48e151ec 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/linear/PowerMethod.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/linear/PowerMethod.scala @@ -11,7 +11,7 @@ import breeze.util.Implicits._ * compute minimum eigen value through inverse power iterations * @author debasish83 */ -class PowerMethod(maxIters: Int = 10, tolerance: Double = 1E-5) +class PowerMethod(maxIters: Int = 10, tolerance: Double = 1e-5) extends SerializableLogging { import PowerMethod.BDM @@ -90,7 +90,7 @@ object PowerMethod { type BDV = DenseVector[Double] type BDM = DenseMatrix[Double] - def inverse(maxIters: Int = 10, tolerance: Double = 1E-5): PowerMethod = + def inverse(maxIters: Int = 10, tolerance: Double = 1e-5): PowerMethod = new PowerMethod(maxIters, tolerance) { override def reset(A: BDM, y: BDV, init: State): State = { import init._ diff --git a/repos/breeze/math/src/main/scala/breeze/stats/distributions/Beta.scala b/repos/breeze/math/src/main/scala/breeze/stats/distributions/Beta.scala index aee47e00b35..298d583e89e 100644 --- a/repos/breeze/math/src/main/scala/breeze/stats/distributions/Beta.scala +++ b/repos/breeze/math/src/main/scala/breeze/stats/distributions/Beta.scala @@ -48,11 +48,19 @@ class Beta(a: Double, b: Double)(implicit rand: RandBasis = Rand) require(x <= 1) x match { case 0.0 => - if (a > 1) { 0 } else if (a == 1) { normalizer } else { + if (a > 1) { + 0 + } else if (a == 1) { + normalizer + } else { Double.PositiveInfinity } case 1.0 => - if (b > 1) { 0 } else if (b == 1) { normalizer } else { + if (b > 1) { + 0 + } else if (b == 1) { + normalizer + } else { Double.PositiveInfinity } case x => math.exp(logPdf(x)) diff --git a/repos/breeze/math/src/main/scala/breeze/stats/distributions/MarkovChain.scala b/repos/breeze/math/src/main/scala/breeze/stats/distributions/MarkovChain.scala index e3f36f56221..3ce0f6df4e2 100644 --- a/repos/breeze/math/src/main/scala/breeze/stats/distributions/MarkovChain.scala +++ b/repos/breeze/math/src/main/scala/breeze/stats/distributions/MarkovChain.scala @@ -240,51 +240,50 @@ object MarkovChain { implicit rand: RandBasis = Rand) = { val WINDOW = 2; val M = 10; - (last: Double) => - { - new Rand[Double] { - def draw() = { - // How bad are we willing to tolerate? - val prop = log(rand.uniform.draw) + logMeasure(last); - val u = rand.uniform.draw; - // Find the boundaries - var left = last - WINDOW * u; - if (!valid(left)) left = last; - var right = left + WINDOW; - - var j: Int = (rand.uniform.draw() * M).asInstanceOf[Int]; - var k = (M - 1) - j; - - while (prop < logMeasure(left) && j > 0 && - valid(left - WINDOW)) { - left = left - WINDOW; - j -= 1; - } + (last: Double) => { + new Rand[Double] { + def draw() = { + // How bad are we willing to tolerate? + val prop = log(rand.uniform.draw) + logMeasure(last); + val u = rand.uniform.draw; + // Find the boundaries + var left = last - WINDOW * u; + if (!valid(left)) left = last; + var right = left + WINDOW; + + var j: Int = (rand.uniform.draw() * M).asInstanceOf[Int]; + var k = (M - 1) - j; + + while (prop < logMeasure(left) && j > 0 && + valid(left - WINDOW)) { + left = left - WINDOW; + j -= 1; + } - if (!valid(right)) right = last; - else - while (prop < logMeasure(right) && k > 0 && - valid(right + WINDOW)) { - right = right + WINDOW; - k -= 1; - } - var happy = false; - var next = Double.NaN; - while (!happy) { - next = left + rand.uniform.draw * (right - left); - if (prop <= logMeasure(next)) { - happy = true; - } else if (next < last) { - //close the window - left = next; - } else { - right = next; - } + if (!valid(right)) right = last; + else + while (prop < logMeasure(right) && k > 0 && + valid(right + WINDOW)) { + right = right + WINDOW; + k -= 1; + } + var happy = false; + var next = Double.NaN; + while (!happy) { + next = left + rand.uniform.draw * (right - left); + if (prop <= logMeasure(next)) { + happy = true; + } else if (next < last) { + //close the window + left = next; + } else { + right = next; } - next; } + next; } } + } } } diff --git a/repos/breeze/math/src/main/scala/breeze/stats/distributions/Poisson.scala b/repos/breeze/math/src/main/scala/breeze/stats/distributions/Poisson.scala index 50d0c363f6f..bf0fbbcdd97 100644 --- a/repos/breeze/math/src/main/scala/breeze/stats/distributions/Poisson.scala +++ b/repos/breeze/math/src/main/scala/breeze/stats/distributions/Poisson.scala @@ -98,7 +98,7 @@ case class Poisson(mean: Double)(implicit rand: RandBasis = Rand) correction = meanmean * ln_k_! / exp(ln_k_!) extra += correction k += 1 - } while (correction > 1E-6) + } while (correction > 1e-6) entr + exp(-mean) * extra } diff --git a/repos/breeze/math/src/main/scala/breeze/stats/distributions/VonMises.scala b/repos/breeze/math/src/main/scala/breeze/stats/distributions/VonMises.scala index 8a19bb9b413..60485407acc 100644 --- a/repos/breeze/math/src/main/scala/breeze/stats/distributions/VonMises.scala +++ b/repos/breeze/math/src/main/scala/breeze/stats/distributions/VonMises.scala @@ -128,7 +128,7 @@ object VonMises extends ExponentialFamily[VonMises, Double] { def likelihoodFunction(stats: SufficientStatistic) = new DiffFunction[(Double, Double)] { def calculate(x: (Double, Double)) = { - val DELTA = 1E-5 + val DELTA = 1e-5 val (mu, k) = x if (mu < 0 || mu > 2 * Pi || k < 0) (Double.PositiveInfinity, (0.0, 0.0)) diff --git a/repos/breeze/math/src/main/scala/breeze/storage/Zero.scala b/repos/breeze/math/src/main/scala/breeze/storage/Zero.scala index 472353be455..b159883afe0 100644 --- a/repos/breeze/math/src/main/scala/breeze/storage/Zero.scala +++ b/repos/breeze/math/src/main/scala/breeze/storage/Zero.scala @@ -22,7 +22,7 @@ import breeze.math.Semiring * * @author dlwh */ -@SerialVersionUID(1l) +@SerialVersionUID(1L) trait Zero[@specialized T] extends Serializable { def zero: T } @@ -52,7 +52,7 @@ object Zero extends ZeroLowPriority { } implicit object LongZero extends Zero[Long] { - override def zero = 0l + override def zero = 0L } implicit object ByteZero extends Zero[Byte] { diff --git a/repos/breeze/math/src/main/scala/breeze/util/Implicits.scala b/repos/breeze/math/src/main/scala/breeze/util/Implicits.scala index 0ac7b36074c..6fd12f27877 100644 --- a/repos/breeze/math/src/main/scala/breeze/util/Implicits.scala +++ b/repos/breeze/math/src/main/scala/breeze/util/Implicits.scala @@ -44,7 +44,7 @@ object Implicits extends DoubleImplicits with IteratorImplicits { trait DoubleImplicits { class RichDouble(x: Double) { - def closeTo(y: Double, tol: Double = 1E-5) = { + def closeTo(y: Double, tol: Double = 1e-5) = { (math.abs(x - y) / (math.abs(x) + math.abs(y) + 1e-10) < tol); } def isDangerous = x.isNaN || x.isInfinite diff --git a/repos/breeze/math/src/test/scala/breeze/collection/mutable/OpenAddressHashArrayTest.scala b/repos/breeze/math/src/test/scala/breeze/collection/mutable/OpenAddressHashArrayTest.scala index 10ed15e687a..794f5ed89a4 100644 --- a/repos/breeze/math/src/test/scala/breeze/collection/mutable/OpenAddressHashArrayTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/collection/mutable/OpenAddressHashArrayTest.scala @@ -42,7 +42,7 @@ class OpenAddressHashArrayTest extends FunSuite with Checkers { } mdata.forall(i => arr(i) == i) && !(0 until size).filterNot(mdata).exists(arr(_) != 0) - }) + }) } } @@ -63,7 +63,7 @@ class OpenAddressHashArrayTest extends FunSuite with Checkers { } (arr == arr.copy && arr.hashCode == arr.copy.hashCode && arr2 == arr && arr2.copy.hashCode == arr.copy.hashCode) - }) + }) } } } diff --git a/repos/breeze/math/src/test/scala/breeze/io/ByteConverterBigEndian$Test.scala b/repos/breeze/math/src/test/scala/breeze/io/ByteConverterBigEndian$Test.scala index 16161860db2..931c2f8b6d8 100644 --- a/repos/breeze/math/src/test/scala/breeze/io/ByteConverterBigEndian$Test.scala +++ b/repos/breeze/math/src/test/scala/breeze/io/ByteConverterBigEndian$Test.scala @@ -239,7 +239,7 @@ class ByteConverterBigEndian$Test extends FunSuite { ba(6), ba(7))) - valueL = 0xffffffffffffffffL + valueL = 0XFFFFFFFFFFFFFFFFL ba = uInt64ShiftedToBytes(valueL) assert( valueL == bytesToUInt64Shifted( diff --git a/repos/breeze/math/src/test/scala/breeze/io/ByteConverterLittleEndian$Test.scala b/repos/breeze/math/src/test/scala/breeze/io/ByteConverterLittleEndian$Test.scala index 5a94ec0823d..68c5bfeb3b9 100644 --- a/repos/breeze/math/src/test/scala/breeze/io/ByteConverterLittleEndian$Test.scala +++ b/repos/breeze/math/src/test/scala/breeze/io/ByteConverterLittleEndian$Test.scala @@ -217,7 +217,7 @@ class ByteConverterLittleEndian$Test extends FunSuite { ba(6), ba(7))) - valueL = 0xffffffffffffffffL + valueL = 0XFFFFFFFFFFFFFFFFL ba = uInt64ShiftedToBytes(valueL) assert( valueL == bytesToUInt64Shifted( diff --git a/repos/breeze/math/src/test/scala/breeze/io/RandomAccessFileTest.scala b/repos/breeze/math/src/test/scala/breeze/io/RandomAccessFileTest.scala index 13c4b041d71..53d51944f06 100644 --- a/repos/breeze/math/src/test/scala/breeze/io/RandomAccessFileTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/io/RandomAccessFileTest.scala @@ -30,8 +30,8 @@ sealed trait RandomAccessFileTest extends FunSuite { val stream = new RAF(file, "rw") stream.writeDouble(0.0) stream.writeDouble( - Array[Double](3.141592653589793, 2.718281828459045, 6.02214E23)) - stream.writeDouble(1.6726231000000002E-24) + Array[Double](3.141592653589793, 2.718281828459045, 6.02214e23)) + stream.writeDouble(1.6726231000000002e-24) stream.close val stream2 = new RAF(file, "r") @@ -40,26 +40,26 @@ sealed trait RandomAccessFileTest extends FunSuite { assert(result2(0) === 0.0) assert(result2(1) === 3.141592653589793) assert(result2(2) === 2.718281828459045) - assert(stream2.readDouble === 6.02214E23) - assert(stream2.readDouble === 1.6726231000000002E-24) + assert(stream2.readDouble === 6.02214e23) + assert(stream2.readDouble === 1.6726231000000002e-24) stream2.close } test("writeFloat") { val file = getResource(fileHead + "Float") val stream = new RAF(file, "rw") - stream.writeFloat(0.0F) - stream.writeFloat(Array[Float](3.1415927F, 2.7182817F, 6.02214E23F)) - stream.writeFloat(1.6726232E-24F) + stream.writeFloat(0.0f) + stream.writeFloat(Array[Float](3.1415927f, 2.7182817f, 6.02214e23f)) + stream.writeFloat(1.6726232e-24f) stream.close val stream2 = new RAF(file, "r") val result2 = stream2.readFloat(3) - assert(result2(0) === 0.0F) - assert(result2(1) === 3.1415927F) - assert(result2(2) === 2.7182817F) - assert(stream2.readFloat === 6.02214E23F) - assert(stream2.readFloat === 1.6726232E-24F) + assert(result2(0) === 0.0f) + assert(result2(1) === 3.1415927f) + assert(result2(2) === 2.7182817f) + assert(stream2.readFloat === 6.02214e23f) + assert(stream2.readFloat === 1.6726232e-24f) stream2.close } diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/CSCMatrixTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/CSCMatrixTest.scala index 074011da197..35d3f75e384 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/CSCMatrixTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/CSCMatrixTest.scala @@ -483,6 +483,6 @@ class CSCMatrixTest extends FunSuite with Checkers { 0.1813186813186811, -0.3131868131868131, 0.43956043956043944), - inf) < 1E-5) + inf) < 1e-5) } } diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/DenseMatrixTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/DenseMatrixTest.scala index 51f6c401d1d..0bc79848a5a 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/DenseMatrixTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/DenseMatrixTest.scala @@ -509,7 +509,7 @@ class DenseMatrixTest 0.1813186813186811, -0.3131868131868131, 0.43956043956043944), - inf) < 1E-5) + inf) < 1e-5) // wide matrix solve val r3: DenseMatrix[Double] = @@ -533,7 +533,7 @@ class DenseMatrixTest max( abs(r4 - DenseMatrix( (0.9166666666666667, 1.9166666666666672), - (-0.08333333333333352, -0.08333333333333436)))) < 1E-5) + (-0.08333333333333352, -0.08333333333333436)))) < 1e-5) } test("Solve Float") { @@ -554,7 +554,7 @@ class DenseMatrixTest r2 - DenseVector( 0.1813186813186811f, -0.3131868131868131f, - 0.43956043956043944f)) < 1E-5) + 0.43956043956043944f)) < 1e-5) // wide matrix solve val r3: DenseMatrix[Float] = @@ -567,7 +567,7 @@ class DenseMatrixTest r3 - DenseMatrix( (0.1813186813186811f, 0.2197802197802196f), (-0.3131868131868131f, -0.1978021978021977f), - (0.43956043956043944f, 0.5934065934065933f)))) < 1E-5) + (0.43956043956043944f, 0.5934065934065933f)))) < 1e-5) // tall matrix solve val r4: DenseMatrix[Float] = @@ -579,7 +579,7 @@ class DenseMatrixTest max( abs(r4 - DenseMatrix( (0.9166666666666667f, 1.9166666666666672f), - (-0.08333333333333352f, -0.08333333333333436f)))) < 1E-5) + (-0.08333333333333352f, -0.08333333333333436f)))) < 1e-5) } test("GH#29 transpose solve is broken") { @@ -632,7 +632,7 @@ class DenseMatrixTest val dm = DenseMatrix.tabulate(2, 5)((i, j) => i * j * 1.0 + 1) dm := normalize(dm, Axis._1, 2) assert( - abs(sum(dm(0, ::).t.map(x => x * x)) - 1.0) < 1E-4, + abs(sum(dm(0, ::).t.map(x => x * x)) - 1.0) < 1e-4, dm.toString + " not normalized!") } @@ -813,7 +813,7 @@ class DenseMatrixTest def matricesNearlyEqual( A: DenseMatrix[Double], B: DenseMatrix[Double], - threshold: Double = 1E-6) { + threshold: Double = 1e-6) { for (i <- 0 until A.rows; j <- 0 until A.cols) A(i, j) should be(B(i, j) +- threshold) } diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/DenseVectorTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/DenseVectorTest.scala index 5f8ba6aa42e..20c165bdee8 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/DenseVectorTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/DenseVectorTest.scala @@ -519,7 +519,7 @@ class DenseVectorTest extends FunSuite with Checkers { test("isClose") { check((a: DenseVector[Double]) => isClose(a, a)) check((a: DenseVector[Double], b: DenseVector[Double]) => - isClose(a, b) == zipValues(a, b).forall((a, b) => (a - b).abs < 1E-8)) + isClose(a, b) == zipValues(a, b).forall((a, b) => (a - b).abs < 1e-8)) } test("nonfinite") { @@ -550,9 +550,9 @@ class DenseVectorOps_DoubleTest val N = 30 Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E100 } - y <- Arbitrary.arbitrary[Double].map { _ % 1E100 } - z <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e100 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e100 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e100 } n <- Gen.choose(1, N) stride <- Gen.choose(1, 4) offset <- Gen.choose(0, 5) @@ -568,7 +568,7 @@ class DenseVectorOps_DoubleTest } def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E10 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e10 }) } @RunWith(classOf[JUnitRunner]) @@ -632,7 +632,7 @@ class DenseVectorOps_FloatTest extends TensorSpaceTestBase[DenseVector[Float], Int, Float] { val space = DenseVector.space[Float] - override val TOL: Double = 1E-3 + override val TOL: Double = 1e-3 val N = 30 implicit def genTriple: Arbitrary[ diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/HashVectorTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/HashVectorTest.scala index 44e96f42cf7..489437f0f86 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/HashVectorTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/HashVectorTest.scala @@ -243,11 +243,11 @@ class HashVectorOps_DoubleTest (HashVector[Double], HashVector[Double], HashVector[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e100 } xl <- Arbitrary.arbitrary[List[Int]] - y <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e100 } yl <- Arbitrary.arbitrary[List[Int]] - z <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e100 } zl <- Arbitrary.arbitrary[List[Int]] } yield { ( @@ -259,7 +259,7 @@ class HashVectorOps_DoubleTest } def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E10 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e10 }) } /** @@ -271,7 +271,7 @@ class HashVectorOps_FloatTest extends TensorSpaceTestBase[HashVector[Float], Int, Float] { val space = HashVector.space[Float] - override val TOL: Double = 1E-2 + override val TOL: Double = 1e-2 val N = 30 implicit def genTriple : Arbitrary[(HashVector[Float], HashVector[Float], HashVector[Float])] = { diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/LSMRTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/LSMRTest.scala index 9a0f63c19ca..bc002364204 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/LSMRTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/LSMRTest.scala @@ -17,7 +17,7 @@ class LSMRTest extends FunSuite { val lsmrSolved = LSMR.solve(matrix, b) val solved: DenseVector[Double] = matrix \ b - assert(norm(solved - lsmrSolved) < 1E-5, s"$solved $lsmrSolved") + assert(norm(solved - lsmrSolved) < 1e-5, s"$solved $lsmrSolved") } test("regularized solve") { @@ -31,8 +31,8 @@ class LSMRTest extends FunSuite { val bfgsSolved = lbfgsSolve(matrix, b, 1) val lsmrSolved = LSMR.solve(matrix, b, regularization = 1.0) - assert(norm(solved - lsmrSolved) < 1E-5, s"$solved $lsmrSolved") - assert(norm(solved - bfgsSolved) < 1E-5, s"$solved $bfgsSolved") + assert(norm(solved - lsmrSolved) < 1e-5, s"$solved $lsmrSolved") + assert(norm(solved - bfgsSolved) < 1e-5, s"$solved $bfgsSolved") } test("regularized solve, 2.0") { @@ -44,7 +44,7 @@ class LSMRTest extends FunSuite { val bfgsSolved = lbfgsSolve(matrix, b, 2.0) val lsmrSolved = LSMR.solve(matrix, b, regularization = 2.0) - assert(norm(bfgsSolved - lsmrSolved) < 1E-5, s"$bfgsSolved $lsmrSolved") + assert(norm(bfgsSolved - lsmrSolved) < 1e-5, s"$bfgsSolved $lsmrSolved") } def gen = RandBasis.mt0.uniform @@ -55,9 +55,9 @@ class LSMRTest extends FunSuite { val b = DenseVector.rand(100, g) val bfgsSolved = lbfgsSolve(matrix, b, 2.0) val lsmrSolved = - LSMR.solve(matrix, b, regularization = 2.0, tolerance = 1E-9) + LSMR.solve(matrix, b, regularization = 2.0, tolerance = 1e-9) - assert(norm(bfgsSolved - lsmrSolved) < 1E-2, s"$bfgsSolved $lsmrSolved") + assert(norm(bfgsSolved - lsmrSolved) < 1e-2, s"$bfgsSolved $lsmrSolved") } private def lbfgsSolve( @@ -76,7 +76,7 @@ class LSMRTest extends FunSuite { DenseVector.rand[Double](mat.cols, gen), 1.0) - new LBFGS[DenseVector[Double]](tolerance = 1E-9) + new LBFGS[DenseVector[Double]](tolerance = 1e-9) .minimize(obj, DenseVector.rand[Double](mat.cols, gen)) } @@ -165,6 +165,6 @@ class LSMRTest extends FunSuite { val xsolve = LSMR.solve(A, b) val r = b - A * xsolve val normr = norm(r) - assert(normr < 1E-4, normr) + assert(normr < 1e-4, normr) } } diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/LinearAlgebraTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/LinearAlgebraTest.scala index 86e9172ca57..56e114341eb 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/LinearAlgebraTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/LinearAlgebraTest.scala @@ -91,8 +91,8 @@ class LinearAlgebraTest val idx = argsort(lambda) idx.zipWithIndex.map { i => - lambda(i._1) should be(eigVals(i._2) +- 1E-6) - vectorsNearlyEqual(evs(::, i._1), eigVect(::, i._2), 1E-6) + lambda(i._1) should be(eigVals(i._2) +- 1e-6) + vectorsNearlyEqual(evs(::, i._1), eigVect(::, i._2), 1e-6) } } @@ -109,7 +109,7 @@ class LinearAlgebraTest (-0.6170, -0.7506, 42.4964, 45.1620, 5.3107), (-0.0638, -0.3979, -0.6275, 54.5694, 8.8282) ) - matricesNearlyEqual(m, aux, 1E-4) + matricesNearlyEqual(m, aux, 1e-4) } test("det") { @@ -124,7 +124,7 @@ class LinearAlgebraTest det(C) should be(0.0 +- 1e-6) val D = DenseMatrix((-1, 1, -1), (1, 2, 3), (3, -10, 1)) - det(D) should be(-8.0 +- 1E-6) + det(D) should be(-8.0 +- 1e-6) } test("logdet") { @@ -152,7 +152,7 @@ class LinearAlgebraTest test("cond") { val A = DenseMatrix((1.0, 0.0, -1.0), (0.0, 1.0, 0.0), (1.0, 0.0, 1.0)) - assert((cond(A) - math.sqrt(2)).abs < 1E-6, cond(A)) + assert((cond(A) - math.sqrt(2)).abs < 1e-6, cond(A)) A(0, 0) = -1.0 // row 0 and row 2 are linearly dependent now assert(cond(A) === Double.PositiveInfinity) @@ -338,7 +338,7 @@ class LinearAlgebraTest val A = DenseMatrix((1.0, 1.0, 1.0), (4.0, 2.0, 1.0), (16.0, 4.0, 1.0)) val QRP(_QQ, _RR, _P, _) = qrp(A) val ap = A * convert(_P, Double) - assert(max(abs(_QQ * _RR - ap)) < 1E-8) + assert(max(abs(_QQ * _RR - ap)) < 1e-8) } test("qr reduced A[m, n], m < n") { @@ -481,7 +481,7 @@ class LinearAlgebraTest assert(w === DenseVector(1.0, 1.0)) assert(wi === DenseVector(1.0, -1.0)) assert(max(abs( - v - diag(DenseVector(0.7071067811865475, -0.7071067811865475)))) < 1E-7) + v - diag(DenseVector(0.7071067811865475, -0.7071067811865475)))) < 1e-7) // TODO, we seem to throw out VI... these seems bad... } @@ -496,8 +496,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd(m) // u and vt are unitary - trace(u.t * u) should be(u.rows.toDouble +- 1E-5) - trace(vt * vt.t) should be(vt.rows.toDouble +- 1E-5) + trace(u.t * u) should be(u.rows.toDouble +- 1e-5) + trace(vt * vt.t) should be(vt.rows.toDouble +- 1e-5) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -516,8 +516,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd(m) // u and vt are unitary - trace(u.t * u) should be(u.rows.toDouble +- 1E-5) - trace(vt * vt.t) should be(vt.rows.toDouble +- 1E-5) + trace(u.t * u) should be(u.rows.toDouble +- 1e-5) + trace(vt * vt.t) should be(vt.rows.toDouble +- 1e-5) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -537,8 +537,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd(m) // u and vt are unitary - trace(u.t * u) should be(u.rows.toFloat +- 1E-5f) - trace(vt * vt.t) should be(vt.rows.toFloat +- 1E-5f) + trace(u.t * u) should be(u.rows.toFloat +- 1e-5f) + trace(vt * vt.t) should be(vt.rows.toFloat +- 1e-5f) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -551,7 +551,7 @@ class LinearAlgebraTest val reM: DenseMatrix[Float] = u * ss * vt // matricesNearlyEqual(reM, m) for (i <- 0 until reM.rows; j <- 0 until reM.cols) - reM(i, j) should be(m(i, j) +- 1E-6f) + reM(i, j) should be(m(i, j) +- 1e-6f) } test("svd float A(m, n), m < n") { @@ -560,8 +560,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd(m) // u and vt are unitary - trace(u.t * u) should be(u.rows.toFloat +- 1E-5f) - trace(vt * vt.t) should be(vt.rows.toFloat +- 1E-5f) + trace(u.t * u) should be(u.rows.toFloat +- 1e-5f) + trace(vt * vt.t) should be(vt.rows.toFloat +- 1e-5f) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -574,7 +574,7 @@ class LinearAlgebraTest val reM: DenseMatrix[Float] = u * ss * vt // matricesNearlyEqual(reM, m) for (i <- 0 until reM.rows; j <- 0 until reM.cols) - reM(i, j) should be(m(i, j) +- 1E-5f) + reM(i, j) should be(m(i, j) +- 1e-5f) } test("svd reduced A(m, n), m > n") { @@ -582,8 +582,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd.reduced(m) // u and vt are unitary - trace(u.t * u) should be(u.cols.toDouble +- 1E-5) - trace(vt * vt.t) should be(vt.rows.toDouble +- 1E-5) + trace(u.t * u) should be(u.cols.toDouble +- 1e-5) + trace(vt * vt.t) should be(vt.rows.toDouble +- 1e-5) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -602,8 +602,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd.reduced(m) // u and vt are unitary - trace(u.t * u) should be(u.cols.toDouble +- 1E-5) - trace(vt * vt.t) should be(vt.rows.toDouble +- 1E-5) + trace(u.t * u) should be(u.cols.toDouble +- 1e-5) + trace(vt * vt.t) should be(vt.rows.toDouble +- 1e-5) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -622,8 +622,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd.reduced(m) // u and vt are unitary - trace(u.t * u) should be(u.cols.toDouble +- 1E-5) - trace(vt * vt.t) should be(vt.rows.toDouble +- 1E-5) + trace(u.t * u) should be(u.cols.toDouble +- 1e-5) + trace(vt * vt.t) should be(vt.rows.toDouble +- 1e-5) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -642,8 +642,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd.reduced(m) // u and vt are unitary - trace(u.t * u) should be(u.cols.toFloat +- 1E-5f) - trace(vt * vt.t) should be(vt.rows.toFloat +- 1E-5f) + trace(u.t * u) should be(u.cols.toFloat +- 1e-5f) + trace(vt * vt.t) should be(vt.rows.toFloat +- 1e-5f) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -656,7 +656,7 @@ class LinearAlgebraTest val reM: DenseMatrix[Float] = u * ss * vt // matricesNearlyEqual(reM, m) for (i <- 0 until reM.rows; j <- 0 until reM.cols) - reM(i, j) should be(m(i, j) +- 1E-6f) + reM(i, j) should be(m(i, j) +- 1e-6f) } test("svd reduced float A(m, n), m = n") { @@ -664,8 +664,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd.reduced(m) // u and vt are unitary - trace(u.t * u) should be(u.cols.toFloat +- 1E-5f) - trace(vt * vt.t) should be(vt.rows.toFloat +- 1E-5f) + trace(u.t * u) should be(u.cols.toFloat +- 1e-5f) + trace(vt * vt.t) should be(vt.rows.toFloat +- 1e-5f) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -678,7 +678,7 @@ class LinearAlgebraTest val reM: DenseMatrix[Float] = u * ss * vt // matricesNearlyEqual(reM, m) for (i <- 0 until reM.rows; j <- 0 until reM.cols) - reM(i, j) should be(m(i, j) +- 1E-5f) + reM(i, j) should be(m(i, j) +- 1e-5f) } test("svd reduced float A(m, n), m < n") { @@ -687,8 +687,8 @@ class LinearAlgebraTest val SVD(u, s, vt) = svd.reduced(m) // u and vt are unitary - trace(u.t * u) should be(u.cols.toFloat +- 1E-5f) - trace(vt * vt.t) should be(vt.rows.toFloat +- 1E-5f) + trace(u.t * u) should be(u.cols.toFloat +- 1e-5f) + trace(vt * vt.t) should be(vt.rows.toFloat +- 1e-5f) // s is sorted by size of singular value, and be nonnegative for (i <- 1 until s.length) { @@ -701,7 +701,7 @@ class LinearAlgebraTest val reM: DenseMatrix[Float] = u * ss * vt // matricesNearlyEqual(reM, m) for (i <- 0 until reM.rows; j <- 0 until reM.cols) - reM(i, j) should be(m(i, j) +- 1E-5f) + reM(i, j) should be(m(i, j) +- 1e-5f) } test("svd and svdr singular values are equal") { @@ -776,21 +776,21 @@ class LinearAlgebraTest for (i <- 0 until m1.cols) { val v1 = if (m1(::, i).valueAt(0) > 0) m1(::, i) else -m1(::, i) val v2 = if (m2(::, i).valueAt(0) > 0) m2(::, i) else -m2(::, i) - assert(max(abs(v1 - v2)) < 1E-5) - assert(abs(norm(v1) - 1.0) < 1E-5) - assert(abs(norm(v2) - 1.0) < 1E-5) + assert(max(abs(v1 - v2)) < 1e-5) + assert(abs(norm(v1) - 1.0) < 1e-5) + assert(abs(norm(v2) - 1.0) < 1e-5) } } val SVD(u1, s1, vt1) = svd(m1) val SVD(u2, s2, vt2) = svd(m2, 2) - assert(max(abs(s1.slice(0, 2) - s2)) < 1E-5) + assert(max(abs(s1.slice(0, 2) - s2)) < 1e-5) checkCols(u1(::, 0 until 2), u2) checkCols(vt1(0 until 2, ::).t, vt2.t) val SVD(u1t, s1t, vt1t) = svd(m1.t) val SVD(u2t, s2t, vt2t) = svd(m2.t, 2) - assert(max(abs(s1t.slice(0, 2) - s2t)) < 1E-5) + assert(max(abs(s1t.slice(0, 2) - s2t)) < 1e-5) checkCols(u1t(::, 0 until 2), u2t) checkCols(vt1t(0 until 2, ::).t, vt2t.t) } @@ -799,12 +799,12 @@ class LinearAlgebraTest val X = DenseMatrix((.7, .2), (.3, .8)) assert(mpow(X, 1) === X) assert( - max(abs(mpow(X, .5) - DenseMatrix((.82426, 0.11716), (.17574, 0.88284)))) < 1E-5, + max(abs(mpow(X, .5) - DenseMatrix((.82426, 0.11716), (.17574, 0.88284)))) < 1e-5, mpow(X, .5)) } test("diff test") { - val testThreshold = 1.0E-15 + val testThreshold = 1.0e-15 val xDouble = DenseVector(.7, .2, .3, .8) assert(norm(diff(xDouble) - DenseVector(-0.5, 0.1, 0.5)) < testThreshold) assert(norm(diff(xDouble, 2) - DenseVector(0.6, 0.4)) < testThreshold) @@ -815,7 +815,7 @@ class LinearAlgebraTest } test("diff slice vector test") { - val testThreshold = 1.0E-15 + val testThreshold = 1.0e-15 val xDouble = { val temp = DenseVector(.7, .2, .3, .8) temp(IndexedSeq(0, 1, 2, 3)) @@ -897,9 +897,9 @@ class LinearAlgebraTest test("accumulate test") { val xDouble = DenseVector(.7, .2, .3, .8) - assert(norm(accumulate(xDouble) - DenseVector(.7, .9, 1.2, 2.0)) < 1.0E-15) + assert(norm(accumulate(xDouble) - DenseVector(.7, .9, 1.2, 2.0)) < 1.0e-15) val xInt = DenseVector(7, 2, 3, 8) - assert(norm(accumulate(xInt) - DenseVector(7, 9, 12, 20)) < 1.0E-15) + assert(norm(accumulate(xInt) - DenseVector(7, 9, 12, 20)) < 1.0e-15) val xEmpty = DenseVector[Long]() assert(accumulate(xEmpty) == DenseVector[Long]()) } @@ -978,14 +978,14 @@ class LinearAlgebraTest def vectorsNearlyEqual( A: DenseVector[Double], B: DenseVector[Double], - threshold: Double = 1E-6) { + threshold: Double = 1e-6) { for (i <- 0 until A.length) A(i) should be(B(i) +- threshold) } def matricesNearlyEqual( A: DenseMatrix[Double], B: DenseMatrix[Double], - threshold: Double = 1E-6) { + threshold: Double = 1e-6) { for (i <- 0 until A.rows; j <- 0 until A.cols) A(i, j) should be(B(i, j) +- threshold) } @@ -993,7 +993,7 @@ class LinearAlgebraTest def matricesNearlyEqual_Float( A: DenseMatrix[Float], B: DenseMatrix[Float], - threshold: Float = 1E-6f) { + threshold: Float = 1e-6f) { for (i <- 0 until A.rows; j <- 0 until A.cols) A(i, j) should be(B(i, j) +- threshold) } diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/SparseVectorTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/SparseVectorTest.scala index 8aac3643769..bb6f45a8582 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/SparseVectorTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/SparseVectorTest.scala @@ -385,11 +385,11 @@ class SparseVectorOps_DoubleTest (SparseVector[Double], SparseVector[Double], SparseVector[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e100 } xl <- Arbitrary.arbitrary[List[Int]] - y <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e100 } yl <- Arbitrary.arbitrary[List[Int]] - z <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e100 } zl <- Arbitrary.arbitrary[List[Int]] } yield { ( @@ -401,7 +401,7 @@ class SparseVectorOps_DoubleTest } def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E10 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e10 }) } /** @@ -413,7 +413,7 @@ class SparseVectorOps_FloatTest extends TensorSpaceTestBase[SparseVector[Float], Int, Float] { val space = SparseVector.space[Float] - override val TOL: Double = 1E-2 + override val TOL: Double = 1e-2 val N = 30 implicit def genTriple: Arbitrary[ (SparseVector[Float], SparseVector[Float], SparseVector[Float])] = { diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/VectorBuilderTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/VectorBuilderTest.scala index 5b112f8bb9f..8a7ed61b539 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/VectorBuilderTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/VectorBuilderTest.scala @@ -32,9 +32,9 @@ class VectorBuilderTest extends FunSuite with Checkers { : Arbitrary[(VectorBuilder[Double], VectorBuilder[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E3 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e3 } xl <- Arbitrary.arbitrary[List[Int]] - y <- Arbitrary.arbitrary[Double].map { _ % 1E3 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e3 } yl <- Arbitrary.arbitrary[List[Int]] } yield { ( @@ -62,8 +62,8 @@ class VectorBuilderTest extends FunSuite with Checkers { val sum2 = (hv1 + hv2) hv1 += vb2 hv2 += vb1 - (norm(hv1 - hv2) < 1E-4 && norm(hv1 - sum1) < 1E-4 && - norm(hv1 - sum2) < 1E-4) + (norm(hv1 - hv2) < 1e-4 && norm(hv1 - sum1) < 1e-4 && + norm(hv1 - sum2) < 1e-4) }) } } @@ -78,18 +78,18 @@ class VectorBuilderOpsTest val space: MutableModule[VectorBuilder[Double], Double] = VectorBuilder.space[Double] - override val TOL: Double = 1E-4 + override val TOL: Double = 1e-4 val N = 3 implicit def genTriple: Arbitrary[ (VectorBuilder[Double], VectorBuilder[Double], VectorBuilder[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E3 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e3 } xl <- Arbitrary.arbitrary[List[Int]] - y <- Arbitrary.arbitrary[Double].map { _ % 1E3 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e3 } yl <- Arbitrary.arbitrary[List[Int]] - z <- Arbitrary.arbitrary[Double].map { _ % 1E3 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e3 } zl <- Arbitrary.arbitrary[List[Int]] } yield { ( @@ -104,5 +104,5 @@ class VectorBuilderOpsTest } def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E3 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e3 }) } diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/VectorTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/VectorTest.scala index 7c827e5d81b..62a6f49d891 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/VectorTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/VectorTest.scala @@ -84,13 +84,13 @@ class VectorOps_DoubleTest : Arbitrary[(Vector[Double], Vector[Double], Vector[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e100 } bx <- Arbitrary.arbitrary[Boolean] xl <- Arbitrary.arbitrary[List[Int]] - y <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e100 } by <- Arbitrary.arbitrary[Boolean] yl <- Arbitrary.arbitrary[List[Int]] - z <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e100 } bz <- Arbitrary.arbitrary[Boolean] zl <- Arbitrary.arbitrary[List[Int]] } yield { @@ -106,7 +106,7 @@ class VectorOps_DoubleTest } def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E10 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e10 }) } @RunWith(classOf[JUnitRunner]) @@ -114,7 +114,7 @@ class VectorOps_FloatTest extends TensorSpaceTestBase[Vector[Float], Int, Float] { val space = Vector.space[Float] - override val TOL: Double = 1E-2 + override val TOL: Double = 1e-2 val N = 30 implicit def genTriple : Arbitrary[(Vector[Float], Vector[Float], Vector[Float])] = { diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/functions/minkowskiDistanceTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/functions/minkowskiDistanceTest.scala index 263b97635f1..b67d41e2bdb 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/functions/minkowskiDistanceTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/functions/minkowskiDistanceTest.scala @@ -24,7 +24,7 @@ class minkowskiDistanceTest extends FunSuite { } def assertClose(a: Double, b: Double) = - assert(math.abs(a - b) < 1E-8) + assert(math.abs(a - b) < 1e-8) /* Not robust to gc pauses, etc. test("big sparse vectors shouldn't be insanely inefficient") { diff --git a/repos/breeze/math/src/test/scala/breeze/linalg/rollTest.scala b/repos/breeze/math/src/test/scala/breeze/linalg/rollTest.scala index dbb770237b7..26bb31075e6 100644 --- a/repos/breeze/math/src/test/scala/breeze/linalg/rollTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/linalg/rollTest.scala @@ -15,7 +15,11 @@ class rollTest extends FunSuite { val expected = DenseVector.zeros[Double](M) cfor(0)(i => i < M, i => i + 1)(i => { v(i) = i - expected(i) = if (i - 3 < 0) { M + i - 3 } else { i - 3 } + expected(i) = if (i - 3 < 0) { + M + i - 3 + } else { + i - 3 + } }) assert(roll(v, 3) == expected) diff --git a/repos/breeze/math/src/test/scala/breeze/math/LogDoubleTest.scala b/repos/breeze/math/src/test/scala/breeze/math/LogDoubleTest.scala index bc8b2d5046c..6c58f7fc71c 100644 --- a/repos/breeze/math/src/test/scala/breeze/math/LogDoubleTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/math/LogDoubleTest.scala @@ -39,7 +39,7 @@ class LogDoubleTest extends FunSuite with Checkers { }); implicit def ae(x: Double) = new { - def =~=(y: Double) = math.abs(x - y) / x < 1E-6; + def =~=(y: Double) = math.abs(x - y) / x < 1e-6; } test("addition") { diff --git a/repos/breeze/math/src/test/scala/breeze/math/MutableModuleTestBase.scala b/repos/breeze/math/src/test/scala/breeze/math/MutableModuleTestBase.scala index 6a2c2c3f30c..f36a95edbc9 100644 --- a/repos/breeze/math/src/test/scala/breeze/math/MutableModuleTestBase.scala +++ b/repos/breeze/math/src/test/scala/breeze/math/MutableModuleTestBase.scala @@ -15,7 +15,7 @@ trait MutableModuleTestBase[V, S] extends FunSuite with Checkers { implicit def genTriple: Arbitrary[(V, V, V)] implicit def genScalar: Arbitrary[S] - val TOL = 1E-6 + val TOL = 1e-6 test("Addition is Associative") { check(Prop.forAll { (trip: (V, V, V)) => @@ -130,7 +130,7 @@ trait MutableModuleTestBase[V, S] extends FunSuite with Checkers { test("Scalar mult distributes over field addition") { check(Prop.forAll { (trip: (V, V, V), s: S, t: S) => val (a, _, _) = trip - close((a) :* scalars.+(s, t), (a :* s) + (a :* t), 1E-4) + close((a) :* scalars.+(s, t), (a :* s) + (a :* t), 1e-4) }) check(Prop.forAll { (trip: (V, V, V), s: S, t: S) => diff --git a/repos/breeze/math/src/test/scala/breeze/math/OptimizationSpaceTest.scala b/repos/breeze/math/src/test/scala/breeze/math/OptimizationSpaceTest.scala index 5122f1a2477..49240db90d5 100644 --- a/repos/breeze/math/src/test/scala/breeze/math/OptimizationSpaceTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/math/OptimizationSpaceTest.scala @@ -131,7 +131,7 @@ trait OptimizationSpaceTest[M, V, S] extends TensorSpaceTestBase[V, Int, S] { test("Scalar mult distributes over field addition - Matrix") { check(Prop.forAll { (trip: (M, M, M), s: S, t: S) => val (a, _, _) = trip - closeM((a) :* scalars.+(s, t), (a :* s) + (a :* t), 1E-4) + closeM((a) :* scalars.+(s, t), (a :* s) + (a :* t), 1e-4) }) check(Prop.forAll { (trip: (M, M, M), s: S, t: S) => @@ -200,7 +200,7 @@ trait OptimizationSpaceTest[M, V, S] extends TensorSpaceTestBase[V, Int, S] { } // norm - val TOLM = 1E-3 + val TOLM = 1e-3 test("norm positive homogeneity - Matrix") { check(Prop.forAll { (trip: (M, M, M), s: S) => val (a, b, c) = trip @@ -228,7 +228,7 @@ trait OptimizationSpaceTest[M, V, S] extends TensorSpaceTestBase[V, Int, S] { check(Prop.forAll { (trip: (M, M, M)) => val (a, b, c) = trip val res = - scalars.close(scalars.+(a dot b, a dot c), (a dot (b + c)), 1E-3) + scalars.close(scalars.+(a dot b, a dot c), (a dot (b + c)), 1e-3) if (!res) println(scalars.+(a dot b, a dot c) + " " + (a dot (b + c))) res }) @@ -299,9 +299,9 @@ class DenseOptimizationSpaceTest_Double (DenseMatrix[Double], DenseMatrix[Double], DenseMatrix[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E100 } - y <- Arbitrary.arbitrary[Double].map { _ % 1E100 } - z <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e100 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e100 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e100 } } yield { ( DenseMatrix.fill(N, N)(math.random * x), @@ -315,9 +315,9 @@ class DenseOptimizationSpaceTest_Double (DenseVector[Double], DenseVector[Double], DenseVector[Double])] = { Arbitrary { for { - x <- Arbitrary.arbitrary[Double].map { _ % 1E100 } - y <- Arbitrary.arbitrary[Double].map { _ % 1E100 } - z <- Arbitrary.arbitrary[Double].map { _ % 1E100 } + x <- Arbitrary.arbitrary[Double].map { _ % 1e100 } + y <- Arbitrary.arbitrary[Double].map { _ % 1e100 } + z <- Arbitrary.arbitrary[Double].map { _ % 1e100 } } yield { ( DenseVector.fill(N)(math.random * x), @@ -328,7 +328,7 @@ class DenseOptimizationSpaceTest_Double } def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E10 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e10 }) } class SparseOptimizationSpaceTest_Double @@ -347,7 +347,7 @@ class SparseOptimizationSpaceTest_Double val M = 30 def genScalar: Arbitrary[Double] = - Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1E10 }) + Arbitrary(Arbitrary.arbitrary[Double].map { _ % 1e10 }) val arbColIndex = Arbitrary(Gen.choose[Int](0, N - 1)) val arbRowIndex = Arbitrary(Gen.choose[Int](0, M - 1)) @@ -355,7 +355,7 @@ class SparseOptimizationSpaceTest_Double implicit val arbEntry = Arbitrary.arbTuple3[Int, Int, Double]( arbRowIndex, arbColIndex, - Arbitrary(Arbitrary.arbitrary[Double].map(_ % 1E100))) + Arbitrary(Arbitrary.arbitrary[Double].map(_ % 1e100))) implicit val arbVals = Arbitrary( genAS flatMap ( @@ -396,13 +396,13 @@ class SparseOptimizationSpaceTest_Double for { xAS <- Gen.chooseNum[Int](0, N) xi <- Gen.pick(xAS, indices) - xv <- Gen.listOfN(xAS, Arbitrary.arbitrary[Double].map(_ % 1E100)) + xv <- Gen.listOfN(xAS, Arbitrary.arbitrary[Double].map(_ % 1e100)) yAS <- Gen.chooseNum[Int](0, N) yi <- Gen.pick(yAS, indices) - yv <- Gen.listOfN(yAS, Arbitrary.arbitrary[Double].map(_ % 1E100)) + yv <- Gen.listOfN(yAS, Arbitrary.arbitrary[Double].map(_ % 1e100)) zAS <- Gen.chooseNum[Int](0, N) zi <- Gen.pick(zAS, indices) - zv <- Gen.listOfN(zAS, Arbitrary.arbitrary[Double].map(_ % 1E100)) + zv <- Gen.listOfN(zAS, Arbitrary.arbitrary[Double].map(_ % 1e100)) } yield { ( SparseVector(N)(xi.zip(xv.map(_ * math.random)): _*), diff --git a/repos/breeze/math/src/test/scala/breeze/math/TensorSpaceTestBase.scala b/repos/breeze/math/src/test/scala/breeze/math/TensorSpaceTestBase.scala index 4fcab97a485..f9cd236820a 100644 --- a/repos/breeze/math/src/test/scala/breeze/math/TensorSpaceTestBase.scala +++ b/repos/breeze/math/src/test/scala/breeze/math/TensorSpaceTestBase.scala @@ -55,7 +55,7 @@ trait TensorSpaceTestBase[V, I, S] extends MutableModuleTestBase[V, S] { check(Prop.forAll { (trip: (V, V, V)) => val (a, b, c) = trip val res = - scalars.close(scalars.+(a dot b, a dot c), (a dot (b + c)), 1E-3) + scalars.close(scalars.+(a dot b, a dot c), (a dot (b + c)), 1e-3) if (!res) println(scalars.+(a dot b, a dot c) + " " + (a dot (b + c))) res }) diff --git a/repos/breeze/math/src/test/scala/breeze/numerics/BesselTest.scala b/repos/breeze/math/src/test/scala/breeze/numerics/BesselTest.scala index 4cdc190e022..b26d4ebacad 100644 --- a/repos/breeze/math/src/test/scala/breeze/numerics/BesselTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/numerics/BesselTest.scala @@ -28,14 +28,14 @@ import org.scalatest.FunSuite class BesselTest extends FunSuite { import Bessel._ test("i0") { - assert((i0(1) - 1.2660658777520083).abs < 1E-8) - assert((i0(0) - 1.0).abs < 1E-8) - assert((i0(20) - 4.355828255955353E7).abs < 1E-1) + assert((i0(1) - 1.2660658777520083).abs < 1e-8) + assert((i0(0) - 1.0).abs < 1e-8) + assert((i0(20) - 4.355828255955353e7).abs < 1e-1) } test("i1") { - assert((i1(1) - 0.565159103992485).abs < 1E-8, i1(1)) - assert((i1(0) - 0).abs < 1E-8) - assert((i1(20) - 4.24549733851277E7).abs < 1E-1) + assert((i1(1) - 0.565159103992485).abs < 1e-8, i1(1)) + assert((i1(0) - 0).abs < 1e-8) + assert((i1(20) - 4.24549733851277e7).abs < 1e-1) } } diff --git a/repos/breeze/math/src/test/scala/breeze/numerics/NumericsTest.scala b/repos/breeze/math/src/test/scala/breeze/numerics/NumericsTest.scala index bfd7a68a830..c9f8e010887 100644 --- a/repos/breeze/math/src/test/scala/breeze/numerics/NumericsTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/numerics/NumericsTest.scala @@ -61,17 +61,17 @@ class NumericsTest extends FunSuite with Checkers with Matchers { import Arbitrary._ implicit def ae(x: Double) = new { - def =~=(y: Double) = breeze.numerics.closeTo(x, y, 1E-6) + def =~=(y: Double) = breeze.numerics.closeTo(x, y, 1e-6) } // TODO 2.9 filter out Double.MaxValue. test("softmax is approximately associative") { check(Prop.forAll { (a: Double, b: Double, c: Double) => - Seq(a, b, c).exists(x => x > 1E300 || x < -1E300) || + Seq(a, b, c).exists(x => x > 1e300 || x < -1e300) || softmax(a, softmax(b, c)) =~= softmax(softmax(a, b), c) }) check(Prop.forAll { (a: Double, b: Double, c: Double) => - Seq(a, b, c).exists(x => x > 1E300 || x < -1E300) || + Seq(a, b, c).exists(x => x > 1e300 || x < -1e300) || softmax(a, softmax(b, c)) =~= softmax(Array(a, b, c)) }) } @@ -79,7 +79,7 @@ class NumericsTest extends FunSuite with Checkers with Matchers { test("sum distributes over softmax") { check(Prop.forAll { (a: Double, b: Double, c: Double) => Seq(a, b, c) - .exists(x => x > 1E300 || x < -1E300) || (a + softmax(b, c)) =~= + .exists(x => x > 1e300 || x < -1e300) || (a + softmax(b, c)) =~= (softmax(a + b, a + c)) }) } @@ -93,7 +93,7 @@ class NumericsTest extends FunSuite with Checkers with Matchers { test("lgamma") { import breeze.numerics.{lgamma => lg} - lg(10) should be(12.8018274801 +- 1E-8) + lg(10) should be(12.8018274801 +- 1e-8) } test("lbeta") { @@ -104,8 +104,8 @@ class NumericsTest extends FunSuite with Checkers with Matchers { test("incomplete gamma") { import breeze.numerics.{lgamma => lg} import breeze.numerics.gammp - lg(3.0, 4.0) should be(0.4212028764812177 +- 1E-8) - lg(3.0, 1.0) should be(-1.828821079471455 +- 1E-8) + lg(3.0, 4.0) should be(0.4212028764812177 +- 1e-8) + lg(3.0, 1.0) should be(-1.828821079471455 +- 1e-8) assert( lg(3.0, DenseVector(4.0, 1.0)) === DenseVector( lg(3.0, 4.0), @@ -118,19 +118,19 @@ class NumericsTest extends FunSuite with Checkers with Matchers { lg(DenseVector(3.0, 3.0), DenseVector(4.0, 1.0)) === DenseVector( lg(3.0, 4.0), lg(3.0, 1.0))) - gammp(3.0, 1.0) should be(0.08030139707139419 +- 1E-8) - gammp(3.0, 4.0) should be(0.7618966944464557 +- 1E-8) - gammp(3.0, 10.0) should be(0.9972306042844884 +- 1E-8) + gammp(3.0, 1.0) should be(0.08030139707139419 +- 1e-8) + gammp(3.0, 4.0) should be(0.7618966944464557 +- 1e-8) + gammp(3.0, 10.0) should be(0.9972306042844884 +- 1e-8) } test("erf") { import breeze.numerics.{erf, erfi} - erf(3.0) should be(.9999779095030014 +- 1E-8) - erf(-3.0) should be(-.9999779095030014 +- 1E-8) - erf(1E-4) should be(0.00011283791633342489 +- 1E-8) - erfi(3.0) should be(1629.994622601567 +- 1E-4) - erfi(-3.0) should be(-1629.994622601567 +- 1E-4) - erf(1E-4) should be(0.00011283791708567767 +- 1E-8) + erf(3.0) should be(.9999779095030014 +- 1e-8) + erf(-3.0) should be(-.9999779095030014 +- 1e-8) + erf(1e-4) should be(0.00011283791633342489 +- 1e-8) + erfi(3.0) should be(1629.994622601567 +- 1e-4) + erfi(-3.0) should be(-1629.994622601567 +- 1e-4) + erf(1e-4) should be(0.00011283791708567767 +- 1e-8) } test("basic ufunc tests") { @@ -170,9 +170,9 @@ class NumericsTest extends FunSuite with Checkers with Matchers { } test("sinc") { - val testThreshold = 1.0E-15 + val testThreshold = 1.0e-15 assert(abs(sinc(1d) - 0.8414709848078965) < testThreshold) - assert(abs(sinc(1f) - 0.8414709848078965) < testThreshold * 1.0E8) + assert(abs(sinc(1f) - 0.8414709848078965) < testThreshold * 1.0e8) assert(sinc(0d) == 1d) val testDV = DenseVector(-10d, -7d, -4d, -1d) @@ -186,18 +186,18 @@ class NumericsTest extends FunSuite with Checkers with Matchers { } test("sincpi") { - val testThreshold = 1.0E-15 - assert(abs(sincpi(1d) - 3.898171832519376E-17) < testThreshold) - assert(abs(sincpi(1f) - 3.898171832519376E-17) < testThreshold * 1.0E8) + val testThreshold = 1.0e-15 + assert(abs(sincpi(1d) - 3.898171832519376e-17) < testThreshold) + assert(abs(sincpi(1f) - 3.898171832519376e-17) < testThreshold * 1.0e8) assert(sincpi(0d) == 1d) val testDV = DenseVector(-3d, -2.5, -2d, -1.5) assert( norm( sincpi(testDV) - DenseVector( - 3.898171832519376E-17, + 3.898171832519376e-17, 0.127323954473516, - -3.898171832519376E-17, + -3.898171832519376e-17, -0.212206590789194)) < testThreshold) } diff --git a/repos/breeze/math/src/test/scala/breeze/numerics/financial/FinancialTest.scala b/repos/breeze/math/src/test/scala/breeze/numerics/financial/FinancialTest.scala index 05e2e95399c..a748e117b0f 100644 --- a/repos/breeze/math/src/test/scala/breeze/numerics/financial/FinancialTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/numerics/financial/FinancialTest.scala @@ -29,7 +29,7 @@ import breeze.linalg._ @RunWith(classOf[JUnitRunner]) class FinancialTest extends FunSuite { - val DOUBLE_ROUND5_MIN = 1E-5; + val DOUBLE_ROUND5_MIN = 1e-5; test("NetPresentValue") { assert(netPresentValue(1.0, Seq(1)) == 1.0) diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/AdaptiveGradientTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/AdaptiveGradientTest.scala index 98420166d47..c1097637bba 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/AdaptiveGradientTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/AdaptiveGradientTest.scala @@ -33,7 +33,7 @@ class AdaptiveGradientTest extends OptimizeTestBase { val init = init2 % 100.0 val sgd = new AdaptiveGradientDescent.L2Regularization[DenseVector[Double]]( - reg % 1E3 abs, + reg % 1e3 abs, 1, 1000) val f = new BatchDiffFunction[DenseVector[Double]] { @@ -46,7 +46,7 @@ class AdaptiveGradientTest extends OptimizeTestBase { val result = sgd.minimize(f, init) val targetValue = 3 / (sgd.regularizationConstant / 2 + 1) val ok = - norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 2E-3 + norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 2e-3 if (!ok) { sys.error( "min " + init + " with reg: " + sgd.regularizationConstant + @@ -65,7 +65,7 @@ class AdaptiveGradientTest extends OptimizeTestBase { val sgd = new AdaptiveGradientDescent.L1Regularization[DenseVector[Double]]( reg.abs % 10, - 1E-7, + 1e-7, 1, 600) val f = new BatchDiffFunction[DenseVector[Double]] { @@ -78,7 +78,7 @@ class AdaptiveGradientTest extends OptimizeTestBase { val result = sgd.minimize(f, init) val targetValue = if (sgd.lambda / 2 > 3) 0.0 else 3 - sgd.lambda / 2 val ok = - norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 1E-2 + norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 1e-2 if (!ok) { sys.error( s"min $init with reg: ${sgd.lambda} gives $result should be $targetValue") diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/ApproximateGradientFunctionTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/ApproximateGradientFunctionTest.scala index f2baa23a451..a2b84415492 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/ApproximateGradientFunctionTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/ApproximateGradientFunctionTest.scala @@ -29,7 +29,7 @@ class ApproximateGradientFunctionTest extends OptimizeTestBase { val ap = approxF.gradientAt(x) val tr = f.gradientAt(x) assert( - norm(ap - tr, 2) < 1E-4 * math.max(norm(ap, 2), 1), + norm(ap - tr, 2) < 1e-4 * math.max(norm(ap, 2), 1), ap.toString + " " + tr) true }) diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSBTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSBTest.scala index 4c3f9e95270..07043aafa28 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSBTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSBTest.scala @@ -24,7 +24,7 @@ import org.scalatest.junit.JUnitRunner */ @RunWith(classOf[JUnitRunner]) class LBFGSBTest extends OptimizeTestBase { - val EPS = 1E-4; + val EPS = 1e-4; test("L-BFGS-B should solve with bound constraint") { val solver = new LBFGSB( diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSTest.scala index 62107b14dbf..5f6eded64fc 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/LBFGSTest.scala @@ -37,7 +37,7 @@ class LBFGSTest extends OptimizeTestBase { } val result = lbfgs.minimize(f, init) - norm(result - 3.0, 2) < 1E-10 + norm(result - 3.0, 2) < 1e-10 } check(Prop.forAll(optimizeThis _)) @@ -54,7 +54,7 @@ class LBFGSTest extends OptimizeTestBase { } val result = lbfgsString.minimize(f, init) - norm(result - 3.0, 2) < 1E-5 + norm(result - 3.0, 2) < 1e-5 } check(Prop.forAll(optimizeThis _)) @@ -74,7 +74,7 @@ class LBFGSTest extends OptimizeTestBase { val result = lbfgs.minimize(DiffFunction.withL2Regularization(f, 1.0), init) val ok = - norm(result :- (DenseVector.ones[Double](init.size) :* targetValue), 2) / result.size < 3E-3 + norm(result :- (DenseVector.ones[Double](init.size) :* targetValue), 2) / result.size < 3e-3 ok || (throw new RuntimeException("Failed to find optimum for init " + init)) } @@ -108,7 +108,7 @@ class LBFGSTest extends OptimizeTestBase { val result = lbfgs.minimize(f, init) val ok = - norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 1E-5 + norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 1e-5 ok || (throw new RuntimeException("Failed to find optimum for init " + init)) } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/OWLQNTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/OWLQNTest.scala index 55076d25149..5183b3c780c 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/OWLQNTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/OWLQNTest.scala @@ -41,7 +41,7 @@ class OWLQNTest extends OptimizeTestBase { } val result = optimizeThis(DenseVector(-1.1053, 0.0, 0.0)) - assert((result(0) - 2.5) < 1E-4, result) + assert((result(0) - 2.5) < 1e-4, result) } test("optimize a simple multivariate gaussian") { @@ -55,7 +55,7 @@ class OWLQNTest extends OptimizeTestBase { } val result = lbfgs.minimize(f, init) - val closeish = norm(result - 2.5, 2) < 1E-4 + val closeish = norm(result - 2.5, 2) < 1e-4 if (closeish) { true } else { @@ -77,7 +77,7 @@ class OWLQNTest extends OptimizeTestBase { } val result = lbfgs.minimize(f, init) - val closeish = norm(result - 2.5, 2) < 1E-4 + val closeish = norm(result - 2.5, 2) < 1e-4 if (closeish) { true } else { diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/ProjectedQuasiNewtonTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/ProjectedQuasiNewtonTest.scala index bf50d4d37e3..64eeb26b416 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/ProjectedQuasiNewtonTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/ProjectedQuasiNewtonTest.scala @@ -33,7 +33,7 @@ class ProjectedQuasiNewtonTest with Matchers { property("optimize a simple multivariate gaussian") { - val optimizer = new ProjectedQuasiNewton(tolerance = 1.0E-9) + val optimizer = new ProjectedQuasiNewton(tolerance = 1.0e-9) forAll { init: DenseVector[Double] => val f = new DiffFunction[DenseVector[Double]] { def calculate(x: DenseVector[Double]) = { @@ -44,13 +44,13 @@ class ProjectedQuasiNewtonTest val result = optimizer.minimize(f, init) result should beSimilarTo( DenseVector.fill(result.size)(3.0), - allowedDeviation = 1E-5) + allowedDeviation = 1e-5) } } property("optimize a simple multivariate gaussian with projection") { val optimizer = new ProjectedQuasiNewton( - tolerance = 1.0E-5, + tolerance = 1.0e-5, projection = _.map(scala.math.min(_, 2.0))) forAll { init: DenseVector[Double] => @@ -64,12 +64,12 @@ class ProjectedQuasiNewtonTest val result = optimizer.minimize(f, init) result should beSimilarTo( DenseVector.fill(result.size)(2.0), - allowedDeviation = 1E-10) + allowedDeviation = 1e-10) } } property("optimize a simple multivariate gaussian with l2 regularization") { - val optimizer = new ProjectedQuasiNewton(tolerance = 1.0E-5) + val optimizer = new ProjectedQuasiNewton(tolerance = 1.0e-5) forAll { init: DenseVector[Double] => val f = new DiffFunction[DenseVector[Double]] { @@ -83,12 +83,12 @@ class ProjectedQuasiNewtonTest optimizer.minimize(DiffFunction.withL2Regularization(f, 1.0), init) result should beSimilarTo( DenseVector.ones[Double](init.size) * targetValue, - allowedDeviation = 3E-3 * result.size) + allowedDeviation = 3e-3 * result.size) } } property("optimize a complicated function without projection") { - val optimizer = new ProjectedQuasiNewton(tolerance = 1.0E-5) + val optimizer = new ProjectedQuasiNewton(tolerance = 1.0e-5) forAll { a: DenseVector[Double] => whenever(min(a) >= -3.0 && max(a) <= 3.0) { @@ -103,7 +103,7 @@ class ProjectedQuasiNewtonTest val result = optimizer.minimize(f, init) val minimum = f(a / 2.0) - f(result) should be(minimum +- abs(minimum) * 1E-2) + f(result) should be(minimum +- abs(minimum) * 1e-2) } } } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/SpectralProjectedGradientTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/SpectralProjectedGradientTest.scala index db9e80ab83b..a788cb74fee 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/SpectralProjectedGradientTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/SpectralProjectedGradientTest.scala @@ -53,7 +53,7 @@ class SpectralProjectedGradientTest property("optimize a simple multivariate gaussian") { val optimizer = - new SpectralProjectedGradient[DenseVector[Double]](tolerance = 1.0E-9) + new SpectralProjectedGradient[DenseVector[Double]](tolerance = 1.0e-9) forAll { init: DenseVector[Double] => val f = new DiffFunction[DenseVector[Double]] { def calculate(x: DenseVector[Double]) = { @@ -64,13 +64,13 @@ class SpectralProjectedGradientTest val result = optimizer.minimize(f, init) result should beSimilarTo( DenseVector.fill(result.size)(3.0), - allowedDeviation = 1E-5) + allowedDeviation = 1e-5) } } property("optimize a simple multivariate gaussian with projection") { val optimizer = new SpectralProjectedGradient[DenseVector[Double]]( - tolerance = 1.0E-5, + tolerance = 1.0e-5, projection = _.map(scala.math.min(_, 2.0))) forAll { init: DenseVector[Double] => @@ -84,7 +84,7 @@ class SpectralProjectedGradientTest val result = optimizer.minimize(f, init) result should beSimilarTo( DenseVector.fill(result.size)(2.0), - allowedDeviation = 1E-10) + allowedDeviation = 1e-10) } } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/StochasticAveragedGradientTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/StochasticAveragedGradientTest.scala index 5e64fd54633..be1bbc7c5ef 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/StochasticAveragedGradientTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/StochasticAveragedGradientTest.scala @@ -37,7 +37,7 @@ class StochasticAveragedGradientTest extends OptimizeTestBase { }) val result = lbfgs.minimize(f, init) - norm(result - 3.0, 2) < 1E-3 + norm(result - 3.0, 2) < 1e-3 } check(Prop.forAll(optimizeThis _)) @@ -58,7 +58,7 @@ class StochasticAveragedGradientTest extends OptimizeTestBase { val targetValue = 3 / (1.0 / 2 + 1) val result = lbfgs.minimize(BatchDiffFunction.wrap(f), init) val ok = - norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 3E-3 + norm(result :- DenseVector.ones[Double](init.size) * targetValue, 2) / result.size < 3e-3 ok || (throw new RuntimeException( "Failed to find optimum for init " + init + diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/StochasticGradientDescentTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/StochasticGradientDescentTest.scala index 6d793ca627a..d0dc835ccc1 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/StochasticGradientDescentTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/StochasticGradientDescentTest.scala @@ -38,7 +38,7 @@ class StochasticGradientDescentTest extends OptimizeTestBase { } val result = sgd.minimize(f, init) - norm(result :- DenseVector.ones[Double](init.size) * 3.0, 2) < 1E-10 + norm(result :- DenseVector.ones[Double](init.size) * 3.0, 2) < 1e-10 } check(Prop.forAll(optimizeThis _)) @@ -57,7 +57,7 @@ class StochasticGradientDescentTest extends OptimizeTestBase { } val result = sgd.minimize(f, init) - norm(result - 3.0, 2) < 1E-3 + norm(result - 3.0, 2) < 1e-3 } check(Prop.forAll(optimizeThis _)) diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/TruncatedNewtonMinimizerTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/TruncatedNewtonMinimizerTest.scala index aa899c705d7..0f0b4e21d5c 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/TruncatedNewtonMinimizerTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/TruncatedNewtonMinimizerTest.scala @@ -35,7 +35,7 @@ class TruncatedNewtonMinimizerTest extends OptimizeTestBase { DenseVector[Double], EmpiricalHessian[DenseVector[Double]]]( 100, - tolerance = 1E-8, + tolerance = 1e-8, l2Regularization = reg) val f = new DiffFunction[DenseVector[Double]] { def calculate(x: DenseVector[Double]) = { @@ -45,7 +45,7 @@ class TruncatedNewtonMinimizerTest extends OptimizeTestBase { val empF = SecondOrderFunction.empirical(f) val result = lbfgs.minimize(empF, init) - if (norm(result - targetValue, 2) < 1E-7) { + if (norm(result - targetValue, 2) < 1e-7) { true } else { println("Bad result " + result + " for " + init) @@ -71,7 +71,7 @@ class TruncatedNewtonMinimizerTest extends OptimizeTestBase { val empF = SecondOrderFunction.empirical(f) val result = lbfgs.minimize(empF, init) - norm(result - 3.0, 2) < 1E-5 + norm(result - 3.0, 2) < 1e-5 } check(Prop.forAll(optimizeThis _)) diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/flow/LPMaxFlowTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/flow/LPMaxFlowTest.scala index b450e872584..7cce4e09207 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/flow/LPMaxFlowTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/flow/LPMaxFlowTest.scala @@ -38,7 +38,7 @@ class LPMaxFlowTest extends FunSuite { } val lpm = new LPMaxFlow(g) - assert((lpm.maxFlow._2 - 4).abs < 1E-5, lpm) - assert((lpm.minCostFlow()._2 - 20).abs < 1E-5, lpm) + assert((lpm.maxFlow._2 - 4).abs < 1e-5, lpm) + assert((lpm.minCostFlow()._2 - 20).abs < 1e-5, lpm) } } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/linear/AffineScalingTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/linear/AffineScalingTest.scala index a06eff70cbf..fb1b682bc9f 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/linear/AffineScalingTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/linear/AffineScalingTest.scala @@ -45,7 +45,7 @@ class AffineScalingTest extends FunSuite { val x = AffineScaling.maximize(A = A, b = b, c = c, x0 = x0) assert((A * x - b).activeValuesIterator.forall(_ < 0), (A * x)) - assert((x(0) - 0.5).abs < 1E-3, x(0)) - assert((x(1) - 0.75).abs < 1E-3, x(1)) + assert((x(0) - 0.5).abs < 1e-3, x(0)) + assert((x(1) - 0.75).abs < 1e-3, x(1)) } } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/linear/ConjugateGradientTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/linear/ConjugateGradientTest.scala index 44d4541c594..6263c075dbc 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/linear/ConjugateGradientTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/linear/ConjugateGradientTest.scala @@ -22,7 +22,7 @@ class ConjugateGradientTest extends FunSuite { val cg = new ConjugateGradient[DenseVector[Double], DenseMatrix[Double]]() val result = cg.minimize(a, b, DenseVector.zeros[Double](2)) - assert(norm(answer - result) <= 1E-4) + assert(norm(answer - result) <= 1e-4) } test("norm constraint is obeyed") { diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/linear/InteriorPointTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/linear/InteriorPointTest.scala index 8f1501142ed..b3de21a6eb5 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/linear/InteriorPointTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/linear/InteriorPointTest.scala @@ -44,8 +44,8 @@ class InteriorPointTest extends FunSuite { } val x = InteriorPoint.minimize(A = A, b = b, c = c, x0 = x0) - assert((A * x - b).activeValuesIterator.forall(_ < 1E-4), (A * x)) - assert((x(0) - 0.5).abs < 1E-3, x(0)) - assert((x(1) - 0.75).abs < 1E-3, x(1)) + assert((A * x - b).activeValuesIterator.forall(_ < 1e-4), (A * x)) + assert((x(0) - 0.5).abs < 1e-3, x(0)) + assert((x(1) - 0.75).abs < 1e-3, x(1)) } } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/linear/LinearProgramTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/linear/LinearProgramTest.scala index 3e54573a238..065007494ff 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/linear/LinearProgramTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/linear/LinearProgramTest.scala @@ -40,7 +40,7 @@ class LinearProgramTest extends FunSuite { val result = maximize(lpp) - assert(norm(result.result - DenseVector(40.0, 17.5, 42.5), 2) < 1E-4) + assert(norm(result.result - DenseVector(40.0, 17.5, 42.5), 2) < 1e-4) } test("minimize") { @@ -58,7 +58,7 @@ class LinearProgramTest extends FunSuite { val res = minimize(lpp) println(res.result) - assert(norm(res.result - DenseVector(10.0, 0.0, 0.0, 10.0), 2) < 1E-4) + assert(norm(res.result - DenseVector(10.0, 0.0, 0.0, 10.0), 2) < 1e-4) } /* diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/linear/NNLSTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/linear/NNLSTest.scala index 7eb5076d9e1..fca706985c0 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/linear/NNLSTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/linear/NNLSTest.scala @@ -54,7 +54,7 @@ class NNLSTest extends OptimizeTestBase { val nnls = new NNLS() val x = nnls.minimize(ata, atb) for (i <- 0 until n) { - assert(abs(x(i) - goodx(i)) < 1E-3) + assert(abs(x(i) - goodx(i)) < 1e-3) assert(x(i) >= 0) } } @@ -87,6 +87,6 @@ class NNLSTest extends OptimizeTestBase { val x = nnls.minimize(ata, atb) val obj = NNLS.computeObjectiveValue(ata, atb, x) - assert(obj < refObj + 1E-5) + assert(obj < refObj + 1e-5) } } diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/proximal/NonlinearMinimizerTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/proximal/NonlinearMinimizerTest.scala index ebc5d43bbe4..c40f0b9809f 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/proximal/NonlinearMinimizerTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/proximal/NonlinearMinimizerTest.scala @@ -59,7 +59,7 @@ class NonlinearMinimizerTest extends OptimizeTestBase with Matchers { QuadraticMinimizer.Cost(ata, atb :* (-1.0)), DenseVector.zeros[Double](n)) println(s"Positivity projection iter ${nlResult.iter}") - assert(norm(nlResult.x - goodx, 2) < 1E-3) + assert(norm(nlResult.x - goodx, 2) < 1e-3) } test("Nonlinear Minimization with positivity proximal compared to Octave") { @@ -77,7 +77,7 @@ class NonlinearMinimizerTest extends OptimizeTestBase with Matchers { QuadraticMinimizer.Cost(ata, atb :* (-1.0)), DenseVector.zeros[Double](n)) println(s"Positivity proximal iter ${nlResult.iter}") - assert(norm(nlResult.z - goodx, 2) < 1E-3) + assert(norm(nlResult.z - goodx, 2) < 1e-3) } test( @@ -87,7 +87,7 @@ class NonlinearMinimizerTest extends OptimizeTestBase with Matchers { val nlResult = NonlinearMinimizer(n, BOX, 0.0).minimizeAndReturnState(cost, init) println(s"Bounds projection iter ${nlResult.iter}") - assert(norm(nlResult.x - gold) < 1E-4) + assert(norm(nlResult.x - gold) < 1e-4) } test( @@ -99,7 +99,7 @@ class NonlinearMinimizerTest extends OptimizeTestBase with Matchers { val nlResult = new NonlinearMinimizer(ProjectBox(lb, ub)) .minimizeAndReturnState(cost, init) println(s"Bounds proximal iter ${nlResult.iter}") - assert(norm(nlResult.z - gold) < 1E-4) + assert(norm(nlResult.z - gold) < 1e-4) } test("Nonlinear Minimization with probability simplex compared to Octave") { diff --git a/repos/breeze/math/src/test/scala/breeze/optimize/proximal/QuadraticMinimizerTest.scala b/repos/breeze/math/src/test/scala/breeze/optimize/proximal/QuadraticMinimizerTest.scala index 7c0be9f3821..e4298d7cdd1 100644 --- a/repos/breeze/math/src/test/scala/breeze/optimize/proximal/QuadraticMinimizerTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/optimize/proximal/QuadraticMinimizerTest.scala @@ -15,7 +15,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { def matricesNearlyEqual( A: DenseMatrix[Double], B: DenseMatrix[Double], - threshold: Double = 1E-6) { + threshold: Double = 1e-6) { for (i <- 0 until A.rows; j <- 0 until A.cols) A(i, j) should be(B(i, j) +- threshold) } @@ -40,8 +40,8 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { QuadraticMinimizer.dpotrs(R, x) val goldenAfter = H \ q - assert(norm(goldenBefore.toDenseVector - x, inf) < 1E-5) - assert(norm(goldenAfter.toDenseVector - x, inf) < 1E-5) + assert(norm(goldenBefore.toDenseVector - x, inf) < 1e-5) + assert(norm(goldenAfter.toDenseVector - x, inf) < 1e-5) } test("lu factorization based forward-backward solve") { @@ -51,7 +51,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { val x = copy(q) QuadraticMinimizer.dgetrs(lu._1, lu._2, x) val golden = H \ q - assert(norm(golden - x) < 1E-8) + assert(norm(golden - x) < 1e-8) } val n = 5 @@ -92,7 +92,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { val qpSolver = new QuadraticMinimizer(problemSize) val result = qpSolver.minimize(H, f :* (-1.0)) - assert(norm(result - dposvResult, 2) < 1E-4) + assert(norm(result - dposvResult, 2) < 1e-4) } test("Unconstrained Quadratic Minimization compared to BFGS") { @@ -120,7 +120,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { val qpSolver = new QuadraticMinimizer(problemSize) val result = qpSolver.minimize(H, f :* (-1.0)) - assert(norm(result - bfgsResult, 2) < 1E-4) + assert(norm(result - bfgsResult, 2) < 1e-4) } test("Quadratic Minimization with L1 compared to OWLQN") { @@ -135,7 +135,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { } } val result = owlqn.minimize(f, init) - norm(result - 2.5, 2) < 1E-10 + norm(result - 2.5, 2) < 1e-10 } val init = DenseVector.zeros[Double](problemSize) @@ -152,7 +152,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { val l1Result = qpSolverL1.minimize(H, f) val normL1 = norm(l1Result - 2.5, 2) - assert(normL1 < 1E-3) + assert(normL1 < 1e-3) } test("Quadratic Minimization with positivity compared to NNLS") { @@ -173,7 +173,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { atb *= -1.0 val posResult = qpSolverPos.minimizeAndReturnState(ata, atb) assert(posResult.converged) - assert(norm(posResult.x - goodx, 2) < 1E-3) + assert(norm(posResult.x - goodx, 2) < 1e-3) } test( @@ -200,7 +200,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { qpSolverBounds.minimizeAndReturnState(ata, atb :* (-1.0)) assert(boundsResult.converged) - assert(norm(boundsResult.x - goodBounds) < 1E-4) + assert(norm(boundsResult.x - goodBounds) < 1e-4) } test( @@ -1189,7 +1189,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { proxL1.setLambda(0.06435) val qpSparseResult = qpSparse.minimize(Psparse, qsparse) - assert(norm(qpSparseResult - qpSparseGold, 2) < 1E-4) + assert(norm(qpSparseResult - qpSparseGold, 2) < 1e-4) } test("minimize API using updateGram should generate identical answers") { @@ -1211,7 +1211,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { val qpSolverPosTest = QuadraticMinimizer(n, POSITIVE, 0.0) qpSolverPosTest.updateGram(ata) val posResultTest = qpSolverPosTest.minimize(atb) - assert(norm(posResult - posResultTest, inf) < 1E-6) + assert(norm(posResult - posResultTest, inf) < 1e-6) } test( @@ -1236,7 +1236,7 @@ class QuadraticMinimizerTest extends OptimizeTestBase with Matchers { qpSolverPosTest.updateGram(upper) val posResultTest = qpSolverPosTest.minimize(atb) - assert(norm(posResult - posResultTest, inf) < 1E-6) + assert(norm(posResult - posResultTest, inf) < 1e-6) } test( diff --git a/repos/breeze/math/src/test/scala/breeze/polynomial/DensePolynomialTest.scala b/repos/breeze/math/src/test/scala/breeze/polynomial/DensePolynomialTest.scala index 04fd994f804..6d80b7bef5d 100644 --- a/repos/breeze/math/src/test/scala/breeze/polynomial/DensePolynomialTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/polynomial/DensePolynomialTest.scala @@ -79,9 +79,15 @@ class DensePolynomialTest extends FunSuite { DenseMatrix.zeros[Double](M, M) // expected result easy to compute cfor(0)(i => i < M, i => i + 1)(i => { cfor(0)(j => j < M, j => j + 1)(j => { - if (j == i) { expectedResult.update(i, j, 1.0) } - if (j == i - 1) { expectedResult.update(i, j, 2.0) } - if (j == i - 2) { expectedResult.update(i, j, 4.0) } + if (j == i) { + expectedResult.update(i, j, 1.0) + } + if (j == i - 1) { + expectedResult.update(i, j, 2.0) + } + if (j == i - 2) { + expectedResult.update(i, j, 4.0) + } }) }) val diff = p(x) - expectedResult diff --git a/repos/breeze/math/src/test/scala/breeze/signal/FourierTrTest.scala b/repos/breeze/math/src/test/scala/breeze/signal/FourierTrTest.scala index 725a8fd9e18..3f20f393844 100644 --- a/repos/breeze/math/src/test/scala/breeze/signal/FourierTrTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/signal/FourierTrTest.scala @@ -64,7 +64,7 @@ class FourierTrTest extends FunSuite { // // - val testNormThreshold = 1E-12 + val testNormThreshold = 1e-12 val test16 = DenseVector[Double](0.814723686393179, 0.905791937075619, 0.126986816293506, 0.913375856139019, 0.63235924622541, 0.0975404049994095, diff --git a/repos/breeze/math/src/test/scala/breeze/signal/HaarTrTest.scala b/repos/breeze/math/src/test/scala/breeze/signal/HaarTrTest.scala index 69e1109aa52..4fffb6845ba 100644 --- a/repos/breeze/math/src/test/scala/breeze/signal/HaarTrTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/signal/HaarTrTest.scala @@ -20,7 +20,7 @@ class HaarTrTest extends FunSuite { } // Test Values - val testNormThreshold = 1E-12 + val testNormThreshold = 1e-12 val test16 = DenseVector[Double](0.814723686393179, 0.905791937075619, 0.126986816293506, 0.913375856139019, 0.63235924622541, 0.0975404049994095, diff --git a/repos/breeze/math/src/test/scala/breeze/signal/WindowFunctionsTest.scala b/repos/breeze/math/src/test/scala/breeze/signal/WindowFunctionsTest.scala index 3e05d9ca315..5c047f84ad0 100644 --- a/repos/breeze/math/src/test/scala/breeze/signal/WindowFunctionsTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/signal/WindowFunctionsTest.scala @@ -20,7 +20,7 @@ import WindowFunctions.hammingWindow @RunWith(classOf[JUnitRunner]) class WindowFunctionsTest extends FunSuite { - val testThreshold = 1.0E-15 + val testThreshold = 1.0e-15 // diff --git a/repos/breeze/math/src/test/scala/breeze/signal/filter/DesignFilterTest.scala b/repos/breeze/math/src/test/scala/breeze/signal/filter/DesignFilterTest.scala index 319eb51b9c9..b4eb44aac3d 100644 --- a/repos/breeze/math/src/test/scala/breeze/signal/filter/DesignFilterTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/signal/filter/DesignFilterTest.scala @@ -15,7 +15,7 @@ class DesignFilterTest extends FunSuite { test( "designFilterFirwin tested against output from scipy.signal.firwin (0.13.2-1)") { - val testNormThreshold = 1.0E-10 + val testNormThreshold = 1.0e-10 val firwin1 = designFilterFirwin[Double]( 6, diff --git a/repos/breeze/math/src/test/scala/breeze/signal/filter/FilterTest.scala b/repos/breeze/math/src/test/scala/breeze/signal/filter/FilterTest.scala index c1e8e97be0e..183e8dd79cf 100644 --- a/repos/breeze/math/src/test/scala/breeze/signal/filter/FilterTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/signal/filter/FilterTest.scala @@ -16,11 +16,11 @@ class FilterTest extends FunSuite { test( "BP filtering tested against output from scipy.signal.firwin/ifilter (0.13.2-1)") { - val testNormThreshold = 1.0E-6 - val spFirwin1 = DenseVector(1.40718797E-02, -7.94274374E-18, - -1.16636001E-01, -1.75719493E-01, 1.37640418E-01, 4.04633024E-01, - 1.37640418E-01, -1.75719493E-01, -1.16636001E-01, -7.94274374E-18, - 1.40718797E-02) + val testNormThreshold = 1.0e-6 + val spFirwin1 = DenseVector(1.40718797e-02, -7.94274374e-18, + -1.16636001e-01, -1.75719493e-01, 1.37640418e-01, 4.04633024e-01, + 1.37640418e-01, -1.75719493e-01, -1.16636001e-01, -7.94274374e-18, + 1.40718797e-02) val testSignal = DenseVector(-1.27168894, -1.48442932, -0.5481519, -0.53087595, 1.55426056, 1.30248503, 0.06143029, 0.69251918, 0.68418296, diff --git a/repos/breeze/math/src/test/scala/breeze/stats/DescriptiveStatsTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/DescriptiveStatsTest.scala index fd2c1da5231..edb390110af 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/DescriptiveStatsTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/DescriptiveStatsTest.scala @@ -166,10 +166,10 @@ class DescriptiveStatsTest2 extends FunSuite { val mav = meanAndVariance(data) val mav2 = meanAndVariance(data.iterator) assert( - breeze.numerics.closeTo(mav.mean, 0.0, 1E-2), + breeze.numerics.closeTo(mav.mean, 0.0, 1e-2), mav.mean + " should be 0") assert( - breeze.numerics.closeTo(mav.variance, 1.0, 1E-2), + breeze.numerics.closeTo(mav.variance, 1.0, 1e-2), mav.variance + " should be 1") assert(mav == mav2) } @@ -182,8 +182,8 @@ class DescriptiveStatsTest2 extends FunSuite { val mav2 = meanAndVariance(data2) val mavTotal = meanAndVariance(data ++ data2) val mavSum = mav + mav2 - assert(breeze.numerics.closeTo(mavTotal.mean, mavSum.mean, 1E-5)) - assert(breeze.numerics.closeTo(mavTotal.variance, mavSum.variance, 1E-5)) + assert(breeze.numerics.closeTo(mavTotal.mean, mavSum.mean, 1e-5)) + assert(breeze.numerics.closeTo(mavTotal.variance, mavSum.variance, 1e-5)) assert(mavSum.count == mavTotal.count) } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/Bernoulli.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/Bernoulli.scala index 77c062a125e..3501490e5a6 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/Bernoulli.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/Bernoulli.scala @@ -38,11 +38,11 @@ class BernoulliTest def arbParameter = Arbitrary(arbitrary[Double].map(x => math.abs(x) % 1.0)) def paramsClose(p: Double, b: Double) = - if (b == 0.0) p < 1E-4 else (p - b).abs / b.abs.max(1E-4) < 1E-1 + if (b == 0.0) p < 1e-4 else (p - b).abs / b.abs.max(1e-4) < 1e-1 implicit def arbDistr = Arbitrary { for (p <- arbitrary[Double].map { x => - math.abs(x) % 1.0 + 1E-4 + math.abs(x) % 1.0 + 1e-4 }) yield new Bernoulli(p) } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/BetaTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/BetaTest.scala index 221da27117e..5bc8f347f15 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/BetaTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/BetaTest.scala @@ -37,16 +37,16 @@ class BetaTest def arbParameter = Arbitrary { for (mean <- arbitrary[Double].map { x => - math.abs(x) % 100.0 + 1E-4 + math.abs(x) % 100.0 + 1e-4 }; std <- arbitrary[Double].map { x => - math.abs(x) % 100 + 1E-4 + math.abs(x) % 100 + 1e-4 }) yield (mean, std) } def paramsClose(p: (Double, Double), b: (Double, Double)) = { - val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 1E-1 - val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1E-1 + val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 1e-1 + val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1e-1 y1 && y2 } @@ -76,7 +76,7 @@ class BetaTest } test("#15 test 2: Smaller a and b") { - val a = 7.672385302336129E-4 + val a = 7.672385302336129e-4 val b = 0.5028709732819038 val n = 100000 val samples = new Beta(a, b).sample(n) diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/Binomial.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/Binomial.scala index 6c9d5e79bf6..ef349eeee21 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/Binomial.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/Binomial.scala @@ -28,11 +28,11 @@ class BinomialTest extends FunSuite with Checkers with MomentsTestBase[Int] { import org.scalacheck.Arbitrary.arbitrary; override val numSamples: Int = 100000 - override val VARIANCE_TOLERANCE: Double = 1E-1 + override val VARIANCE_TOLERANCE: Double = 1e-1 implicit def arbDistr = Arbitrary { for (n <- arbitrary[Int].map { _.abs % 10000 + 1 }; - p <- arbitrary[Double].map { _.abs % 1.0 + 1E-4 }) + p <- arbitrary[Double].map { _.abs % 1.0 + 1e-4 }) yield new Binomial(n.abs + 1, p) } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/ChiSquaredTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/ChiSquaredTest.scala index af24af03e4d..2ab820ea06d 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/ChiSquaredTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/ChiSquaredTest.scala @@ -42,7 +42,7 @@ class ChiSquaredTest for (shape <- arbitrary[Double].map { _.abs % 200.0 + 4.2 }) yield shape } - def paramsClose(p: Double, b: Double) = breeze.numerics.closeTo(p, b, 5E-2) + def paramsClose(p: Double, b: Double) = breeze.numerics.closeTo(p, b, 5e-2) def asDouble(x: Double) = x @@ -54,7 +54,7 @@ class ChiSquaredTest }) yield new ChiSquared(shape)(new RandBasis(new MersenneTwister(0))) } - override val VARIANCE_TOLERANCE: Double = 1E-2 + override val VARIANCE_TOLERANCE: Double = 1e-2 test("endpoint, k > 2") { val g = new ChiSquared(3) diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/DirichletTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/DirichletTest.scala index ac85fed2105..84ed07f2a16 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/DirichletTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/DirichletTest.scala @@ -28,12 +28,12 @@ import math.{abs, exp} class DirichletTest extends FunSuite with Checkers { test("logDraw for small values") { - val g = new Dirichlet(DenseVector(1E-5, 5.0, 50.0)) + val g = new Dirichlet(DenseVector(1e-5, 5.0, 50.0)) assert(Array.fill(1000)(g.logDraw()).forall(_(0) > Double.NegativeInfinity)) } test("logDraw of SparseVector") { - val g = new Dirichlet(SparseVector(7)(1 -> 1E-5, 3 -> 5.0, 5 -> 50.0)) + val g = new Dirichlet(SparseVector(7)(1 -> 1e-5, 3 -> 5.0, 5 -> 50.0)) Array.fill(1000)(g.logDraw()).foreach { (d: SparseVector[Double]) => assert(d(1) > Double.NegativeInfinity) assert(d.activeSize == 3) diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/GammaTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/GammaTest.scala index 90013e46ab0..e59de6ed561 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/GammaTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/GammaTest.scala @@ -45,8 +45,8 @@ class GammaTest } def paramsClose(p: (Double, Double), b: (Double, Double)) = { - val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 2E-1 - val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 2E-1 + val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 2e-1 + val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 2e-1 y1 && y2 } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/GaussianTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/GaussianTest.scala index 33eb744b500..73e8e1f553d 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/GaussianTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/GaussianTest.scala @@ -42,8 +42,8 @@ class GaussianTest } def paramsClose(p: (Double, Double), b: (Double, Double)) = { - val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 1E-1 - val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1E-1 + val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 1e-1 + val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1e-1 y1 && y2 } @@ -59,7 +59,7 @@ class GaussianTest test("#295, cdf/inverseCdf broken") { val gaussian = Gaussian(0, 1) assert( - (gaussian.cdf(gaussian.inverseCdf(0.1)) - 0.1).abs <= 1E-3, + (gaussian.cdf(gaussian.inverseCdf(0.1)) - 0.1).abs <= 1e-3, gaussian.cdf(gaussian.inverseCdf(0.1)) + " was not close to " + 0.1) } @@ -67,7 +67,7 @@ class GaussianTest assert(new Gaussian(0, 1).unnormalizedLogPdf(1.0) === -0.5) } - override val VARIANCE_TOLERANCE: Double = 9E-2 + override val VARIANCE_TOLERANCE: Double = 9e-2 implicit def arbDistr: Arbitrary[Distr] = Arbitrary { for (mean <- arbitrary[Double].map { x => diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/GeometricTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/GeometricTest.scala index 9ea08a9964a..e6046fbd926 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/GeometricTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/GeometricTest.scala @@ -34,21 +34,21 @@ class GeometricTest override val numSamples = 10000 - override val VARIANCE_TOLERANCE: Double = 1E-1 + override val VARIANCE_TOLERANCE: Double = 1e-1 def paramsClose(p: Double, q: Double) = { - (p - q).abs / (p.abs / 2 + q.abs / 2 + 1) < 1E-1 + (p - q).abs / (p.abs / 2 + q.abs / 2 + 1) < 1e-1 } def arbParameter = Arbitrary { for (p <- arbitrary[Double].map { m => - (math.abs(m) % 1.0) + 1E-3 + (math.abs(m) % 1.0) + 1e-3 }) yield p } def arbDistr = Arbitrary { for (p <- arbitrary[Double].map { m => - (math.abs(m) % 1.0) + 1E-3 + (math.abs(m) % 1.0) + 1e-3 }) yield new Geometric(p)(RandBasis.mt0) } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/HasCdfTestBase.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/HasCdfTestBase.scala index 0a865e289bb..8c7157a33de 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/HasCdfTestBase.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/HasCdfTestBase.scala @@ -42,7 +42,7 @@ trait HasCdfTestBase extends FunSuite with Checkers { val inRange = samples.count(x => x >= low && x <= high) / (samples.length * 1.0) val prob = distr.probability(low, high) - if (prob >= 0 && math.abs(inRange - prob) <= 2E-2) { + if (prob >= 0 && math.abs(inRange - prob) <= 2e-2) { true } else { println(inRange, prob) @@ -58,7 +58,7 @@ trait HasCdfTestBase extends FunSuite with Checkers { val inRange = samples.count(x => x <= high) / (samples.length * 1.0) val prob = distr.cdf(high) - if (prob >= 0 && math.abs(inRange - prob) <= 2E-2) { + if (prob >= 0 && math.abs(inRange - prob) <= 2e-2) { true } else { println(inRange, prob) diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogNormalTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogNormalTest.scala index bb071ad54d2..fedaf0b7cb8 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogNormalTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogNormalTest.scala @@ -41,12 +41,12 @@ class LogNormalTest } def paramsClose(p: (Double, Double), b: (Double, Double)) = { - val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 1E-1 - val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1E-1 + val y1 = (p._1 - b._1).abs / (p._1.abs / 2 + b._1.abs / 2 + 1) < 1e-1 + val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1e-1 y1 && y2 } - override val VARIANCE_TOLERANCE: Double = 9E-2 + override val VARIANCE_TOLERANCE: Double = 9e-2 type Distr = LogNormal diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogarthmicTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogarthmicTest.scala index 364c9a341f5..a5898f725d9 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogarthmicTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/LogarthmicTest.scala @@ -30,21 +30,21 @@ class LogarthmicTest extends FunSuite with Checkers with MomentsTestBase[Int] { override val numSamples = 10000 - override val VARIANCE_TOLERANCE: Double = 1E-1 + override val VARIANCE_TOLERANCE: Double = 1e-1 def paramsClose(p: Double, q: Double) = { - (p - q).abs / (p.abs / 2 + q.abs / 2 + 1) < 1E-1 + (p - q).abs / (p.abs / 2 + q.abs / 2 + 1) < 1e-1 } implicit def arbParameter = Arbitrary { for (p <- arbitrary[Double].map { m => - (math.abs(m) % 1.0) + 1E-3 + (math.abs(m) % 1.0) + 1e-3 }) yield p } implicit def arbDistr: Arbitrary[Logarthmic] = Arbitrary { for (p <- arbitrary[Double].map { m => - (math.abs(m) % 1.0) + 1E-3 + (math.abs(m) % 1.0) + 1e-3 }) yield new Logarthmic(p)(RandBasis.mt0) } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/MomentsTestBase.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/MomentsTestBase.scala index 83400863d38..729d520a37f 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/MomentsTestBase.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/MomentsTestBase.scala @@ -28,7 +28,7 @@ trait MomentsTestBase[T] extends FunSuite with Checkers { check(Prop.forAll { (distr: Distr) => val sample = distr.sample(numSamples).map(asDouble _) val m = mean(sample) - if ((m - distr.mean).abs / (m.abs max 1) > 1E-1) { + if ((m - distr.mean).abs / (m.abs max 1) > 1e-1) { println("MExpected " + distr.mean + " but got " + m) false } else { @@ -37,7 +37,7 @@ trait MomentsTestBase[T] extends FunSuite with Checkers { }) } - val VARIANCE_TOLERANCE = 5E-2 + val VARIANCE_TOLERANCE = 5e-2 test("variance") { check(Prop.forAll { (distr: Distr) => // try twice, and only fail if both fail. @@ -60,7 +60,7 @@ trait MomentsTestBase[T] extends FunSuite with Checkers { val probMode = distr(fromDouble(distr.mode)) // if(distr.isInstanceOf[Poisson]) // println(distr,probMode,sample.map{ distr },sample) - sample.find(x => probMode < distr(x) - 1E-4) match { + sample.find(x => probMode < distr(x) - 1e-4) match { case Some(x) => println( s"$x has higher prob (${distr(x)}) than mode ${distr.mode} ($probMode)"); diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/MultivariateGaussianTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/MultivariateGaussianTest.scala index 170c6053140..600f64a58ad 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/MultivariateGaussianTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/MultivariateGaussianTest.scala @@ -71,7 +71,7 @@ class MultivariateGaussianTest extends FunSuite with Checkers { check(Prop.forAll { (distr: MultivariateGaussian) => val sample = DenseVector.horzcat(distr.sample(numSamples): _*) val m = mean(sample(*, ::)) - if (norm(m - distr.mean, Double.PositiveInfinity) > 1E-1) { + if (norm(m - distr.mean, Double.PositiveInfinity) > 1e-1) { println("MExpected " + distr.mean + " but got " + m) false } else { diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/Poisson.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/Poisson.scala index 82d4dc7af0e..68cc80bc607 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/Poisson.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/Poisson.scala @@ -36,13 +36,13 @@ class PoissonTest } def arbParameter = Arbitrary(arbitrary[Double].map(x => math.abs(x) % 20)) def paramsClose(p: Double, b: Double) = - if (b == 0.0) p < 1E-4 else (p - b).abs / b.abs.max(1E-4) < 1E-1 + if (b == 0.0) p < 1e-4 else (p - b).abs / b.abs.max(1e-4) < 1e-1 def asDouble(x: Int) = x.toDouble def fromDouble(x: Double) = x.toInt - override val VARIANCE_TOLERANCE: Double = 1E-1 - val TOL = 1E-1 + override val VARIANCE_TOLERANCE: Double = 1e-1 + val TOL = 1e-1 test("cdf") { val mean = 5.0 diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/UnivariateContinuousDistrTestBase.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/UnivariateContinuousDistrTestBase.scala index 56ea2964a24..1a13de0d507 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/UnivariateContinuousDistrTestBase.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/UnivariateContinuousDistrTestBase.scala @@ -41,7 +41,7 @@ trait UnivariateContinuousDistrTestBase extends FunSuite with Checkers { val inRange = samples.count(x => x >= low && x <= high) / (samples.length * 1.0) val prob = trapezoid(distr.pdf _, low, high, 2000) - if (prob >= 0 && math.abs(inRange - prob) <= 4E-2) { + if (prob >= 0 && math.abs(inRange - prob) <= 4e-2) { true } else { info(s"low: $low, high: $high") diff --git a/repos/breeze/math/src/test/scala/breeze/stats/distributions/VonMises.scala b/repos/breeze/math/src/test/scala/breeze/stats/distributions/VonMises.scala index 7b2eb28787d..add0b554456 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/distributions/VonMises.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/distributions/VonMises.scala @@ -42,8 +42,8 @@ class VonMisesTest def paramsClose(p: (Double, Double), b: (Double, Double)) = { val y1 = (math.sin(p._1) - math.sin(b._1)).abs / - (math.sin(p._1).abs / 2 + math.sin(b._1).abs / 2 + 1) < 1E-1 - val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1E-1 + (math.sin(p._1).abs / 2 + math.sin(b._1).abs / 2 + 1) < 1e-1 + val y2 = (p._2 - b._2).abs / (p._2.abs / 2 + b._2.abs / 2 + 1) < 1e-1 y1 && y2 } diff --git a/repos/breeze/math/src/test/scala/breeze/stats/hypothesis/TTestTest.scala b/repos/breeze/math/src/test/scala/breeze/stats/hypothesis/TTestTest.scala index 6623f61e1fb..7becc869b55 100644 --- a/repos/breeze/math/src/test/scala/breeze/stats/hypothesis/TTestTest.scala +++ b/repos/breeze/math/src/test/scala/breeze/stats/hypothesis/TTestTest.scala @@ -11,7 +11,7 @@ class TTestTest extends FunSuite with Matchers { val threshold = 0.01 test("T Test two sample") { tTest(List(1.0, 1, 2, 3), List(9.0, 9, 8, 9)) should be( - 4.29E-5 +- threshold) + 4.29e-5 +- threshold) } test("T Test one sample") { tTest(Array(1.0, 1, 2, 3)) should be(0.0336 +- threshold) diff --git a/repos/breeze/viz/src/main/scala/breeze/plot/package.scala b/repos/breeze/viz/src/main/scala/breeze/plot/package.scala index 702dadac2f5..d48b68fdf02 100644 --- a/repos/breeze/viz/src/main/scala/breeze/plot/package.scala +++ b/repos/breeze/viz/src/main/scala/breeze/plot/package.scala @@ -236,7 +236,7 @@ package object plot { binner.splits(i - 1) + width / 2.0 } else { binner.splits(i) - width / 2.0 - }, + }, y = (i: Int) => counts(i), label = (i: Int) => null, tip = (i: Int) => null diff --git a/repos/cats/core/src/main/scala/cats/Eval.scala b/repos/cats/core/src/main/scala/cats/Eval.scala index 41211e4b6c7..47aed1febf6 100644 --- a/repos/cats/core/src/main/scala/cats/Eval.scala +++ b/repos/cats/core/src/main/scala/cats/Eval.scala @@ -80,7 +80,7 @@ sealed abstract class Eval[A] extends Serializable { self => type Start = A val start = () => c.run(s) val run = f - } + } } case c: Eval.Call[A] => new Eval.Compute[B] { diff --git a/repos/cats/core/src/main/scala/cats/data/StateT.scala b/repos/cats/core/src/main/scala/cats/data/StateT.scala index ba3ee33c773..9f2060880da 100644 --- a/repos/cats/core/src/main/scala/cats/data/StateT.scala +++ b/repos/cats/core/src/main/scala/cats/data/StateT.scala @@ -18,7 +18,7 @@ final class StateT[F[_], S, A](val runF: F[S => F[(S, A)]]) case (s, a) => fas(a).run(s) } - }) + }) def map[B](f: A => B)(implicit F: Monad[F]): StateT[F, S, B] = transform { case (s, a) => (s, f(a)) } diff --git a/repos/cats/core/src/main/scala/cats/std/anyval.scala b/repos/cats/core/src/main/scala/cats/std/anyval.scala index ccc5478c373..3cd8f0c391e 100644 --- a/repos/cats/core/src/main/scala/cats/std/anyval.scala +++ b/repos/cats/core/src/main/scala/cats/std/anyval.scala @@ -86,7 +86,7 @@ trait FloatInstances /* missing algebra type classes */ { implicit val floatAlgebra: CommutativeGroup[Float] with Order[Float] = new CommutativeGroup[Float] with Order[Float] { def combine(x: Float, y: Float): Float = x + y - def empty: Float = 0F + def empty: Float = 0f def inverse(x: Float): Float = -x def compare(x: Float, y: Float): Int = java.lang.Float.compare(x, y) @@ -101,7 +101,7 @@ trait DoubleInstances /* missing algebra type classes */ { implicit val doubleAlgebra: CommutativeGroup[Double] with Order[Double] = new CommutativeGroup[Double] with Order[Double] { def combine(x: Double, y: Double): Double = x + y - def empty: Double = 0D + def empty: Double = 0d def inverse(x: Double): Double = -x def compare(x: Double, y: Double): Int = java.lang.Double.compare(x, y) diff --git a/repos/cats/project/Boilerplate.scala b/repos/cats/project/Boilerplate.scala index 737b25e7215..8c333892041 100644 --- a/repos/cats/project/Boilerplate.scala +++ b/repos/cats/project/Boilerplate.scala @@ -113,7 +113,11 @@ object Boilerplate { "" } - val n = if (arity == 1) { "" } else { arity.toString } + val n = if (arity == 1) { + "" + } else { + arity.toString + } val map = if (arity == 1) @@ -189,7 +193,12 @@ object Boilerplate { (a until arity) map { n => "a" + n + ":A" + n } mkString "," - def apN(n: Int) = if (n == 1) { "ap" } else { s"ap$n" } + def apN(n: Int) = + if (n == 1) { + "ap" + } else { + s"ap$n" + } def allArgs = (0 until arity) map { "a" + _ } mkString "," val apply = block""" diff --git a/repos/ensime-server/core/src/it/scala/org/ensime/core/JavaCompilerSpec.scala b/repos/ensime-server/core/src/it/scala/org/ensime/core/JavaCompilerSpec.scala index c966dd5845b..09cecbee14c 100644 --- a/repos/ensime-server/core/src/it/scala/org/ensime/core/JavaCompilerSpec.scala +++ b/repos/ensime-server/core/src/it/scala/org/ensime/core/JavaCompilerSpec.scala @@ -28,7 +28,7 @@ class JavaCompilerSpec "class Test1 {", " ksjdfkdjsf @1@", "}") { (sf, p, label, cc) => - } + } store.notes should not be empty } } diff --git a/repos/ensime-server/core/src/it/scala/org/ensime/indexer/SourceResolverSpec.scala b/repos/ensime-server/core/src/it/scala/org/ensime/indexer/SourceResolverSpec.scala index d5e31e64913..01ea5fa462e 100644 --- a/repos/ensime-server/core/src/it/scala/org/ensime/indexer/SourceResolverSpec.scala +++ b/repos/ensime-server/core/src/it/scala/org/ensime/indexer/SourceResolverSpec.scala @@ -56,6 +56,6 @@ trait SourceResolverTestUtils { fo.pathWithinArchive match { case None => fo.asLocalFile.getAbsolutePath case _ => fo.getName.getPath - }) + }) } } diff --git a/repos/ensime-server/core/src/main/scala/org/ensime/core/Completion.scala b/repos/ensime-server/core/src/main/scala/org/ensime/core/Completion.scala index 11fd287393f..31603daaf50 100644 --- a/repos/ensime-server/core/src/main/scala/org/ensime/core/Completion.scala +++ b/repos/ensime-server/core/src/main/scala/org/ensime/core/Completion.scala @@ -414,7 +414,11 @@ trait Completion { self: RichPresentationCompiler => memberSyms .flatMap { s => val name = - if (s.hasPackageFlag) { s.nameString } else { typeShortName(s) } + if (s.hasPackageFlag) { + s.nameString + } else { + typeShortName(s) + } if (name.startsWith(prefix)) Some( CompletionInfo( diff --git a/repos/ensime-server/core/src/main/scala/org/ensime/core/debug/VM.scala b/repos/ensime-server/core/src/main/scala/org/ensime/core/debug/VM.scala index c8d3aec8a76..b2026119f12 100644 --- a/repos/ensime-server/core/src/main/scala/org/ensime/core/debug/VM.scala +++ b/repos/ensime-server/core/src/main/scala/org/ensime/core/debug/VM.scala @@ -225,11 +225,15 @@ class VM( for (types <- fileToUnits.get(key)) { for (t <- types) { for (m <- t.methods()) { - try { buf ++= m.locationsOfLine(line).map(LocationClass.apply) } catch { + try { + buf ++= m.locationsOfLine(line).map(LocationClass.apply) + } catch { case e: AbsentInformationException => } } - try { buf ++= t.locationsOfLine(line).map(LocationClass.apply) } catch { + try { + buf ++= t.locationsOfLine(line).map(LocationClass.apply) + } catch { case e: AbsentInformationException => } } @@ -535,7 +539,9 @@ class VM( } def ignoreErr[T](action: => T, orElse: => T): T = { - try { action } catch { case e: Exception => orElse } + try { + action + } catch { case e: Exception => orElse } } private def makeStackFrame(index: Int, frame: StackFrame): DebugStackFrame = { diff --git a/repos/ensime-server/core/src/main/scala/org/ensime/model/Helpers.scala b/repos/ensime-server/core/src/main/scala/org/ensime/model/Helpers.scala index 937dec42325..6e860338b7c 100644 --- a/repos/ensime-server/core/src/main/scala/org/ensime/model/Helpers.scala +++ b/repos/ensime-server/core/src/main/scala/org/ensime/model/Helpers.scala @@ -17,7 +17,9 @@ trait Helpers { self: Global => } else if (sym.isClass || sym.isPackageClass || sym.isPackageObjectClass) { sym.companionModule.tpe.members - } else { List.empty } + } else { + List.empty + } members.toList.filter { _.name.toString == "apply" } } @@ -27,7 +29,9 @@ trait Helpers { self: Global => sym.tpe.members } else if (sym.isModule || sym.isModuleClass || sym.isPackageObject) { sym.companionClass.tpe.members - } else { List.empty } + } else { + List.empty + } members.toList.filter { _.isConstructor } } @@ -129,7 +133,9 @@ trait Helpers { self: Global => withoutArgs + (if (tpe.typeArgs.size > 0) { "[" + tpe.typeArgs.map(typeFullName(_, true)).mkString(", ") + "]" - } else { "" }) + } else { + "" + }) } else withoutArgs } diff --git a/repos/ensime-server/core/src/main/scala/org/ensime/model/ModelBuilders.scala b/repos/ensime-server/core/src/main/scala/org/ensime/model/ModelBuilders.scala index 55000906596..dacd1728802 100644 --- a/repos/ensime-server/core/src/main/scala/org/ensime/model/ModelBuilders.scala +++ b/repos/ensime-server/core/src/main/scala/org/ensime/model/ModelBuilders.scala @@ -88,7 +88,9 @@ trait ModelBuilders { self: RichPresentationCompiler => val viaView = if (byView.size == 1) { byView.keys.headOption.filter(_ != NoSymbol) - } else { None } + } else { + None + } // Do one top level sort by name on members, before // subdividing into kinds of members. diff --git a/repos/ensime-server/monkeys/src/main/scala-2.10/scala/reflect/io/ZipArchive.scala b/repos/ensime-server/monkeys/src/main/scala-2.10/scala/reflect/io/ZipArchive.scala index 231739db907..3c7fed4de0a 100644 --- a/repos/ensime-server/monkeys/src/main/scala-2.10/scala/reflect/io/ZipArchive.scala +++ b/repos/ensime-server/monkeys/src/main/scala-2.10/scala/reflect/io/ZipArchive.scala @@ -38,7 +38,9 @@ object ZipArchive { */ def fromFile(file: File): FileZipArchive = fromFile(file.jfile) def fromFile(file: JFile): FileZipArchive = - try { new FileZipArchive(file) } catch { case _: IOException => null } + try { + new FileZipArchive(file) + } catch { case _: IOException => null } /** * @param url the url of a zip file diff --git a/repos/ensime-server/monkeys/src/main/scala-2.11/scala/reflect/io/ZipArchive.scala b/repos/ensime-server/monkeys/src/main/scala-2.11/scala/reflect/io/ZipArchive.scala index 60da55707c7..c7faa078c58 100644 --- a/repos/ensime-server/monkeys/src/main/scala-2.11/scala/reflect/io/ZipArchive.scala +++ b/repos/ensime-server/monkeys/src/main/scala-2.11/scala/reflect/io/ZipArchive.scala @@ -39,7 +39,9 @@ object ZipArchive { */ def fromFile(file: File): FileZipArchive = fromFile(file.jfile) def fromFile(file: JFile): FileZipArchive = - try { new FileZipArchive(file) } catch { case _: IOException => null } + try { + new FileZipArchive(file) + } catch { case _: IOException => null } /** * @param url the url of a zip file diff --git a/repos/ensime-server/project/SonatypeSupport.scala b/repos/ensime-server/project/SonatypeSupport.scala index 00f49373ec4..4b4b1ee2ec7 100644 --- a/repos/ensime-server/project/SonatypeSupport.scala +++ b/repos/ensime-server/project/SonatypeSupport.scala @@ -40,8 +40,8 @@ object SonatypeSupport { password) }.toSeq, pomExtra := ( - git@github.com:${ ghUser }/${ ghRepo }.git - scm:git:git@github.com:${ ghUser }/${ ghRepo }.git + git@github.com:${ghUser}/${ghRepo}.git + scm:git:git@github.com:${ghUser}/${ghRepo}.git diff --git a/repos/ensime-server/server/src/main/scala/org/ensime/server/WebServer.scala b/repos/ensime-server/server/src/main/scala/org/ensime/server/WebServer.scala index 55096f969a8..b05335b514e 100644 --- a/repos/ensime-server/server/src/main/scala/org/ensime/server/WebServer.scala +++ b/repos/ensime-server/server/src/main/scala/org/ensime/server/WebServer.scala @@ -62,10 +62,10 @@ trait WebServer {

ENSIME: Your Project's Documentation

    { - docJars().toList.map(_.getName).sorted.map { f => -
  • { f }
  • - } - }
+ docJars().toList.map(_.getName).sorted.map { f => +
  • {f}
  • + } + } } diff --git a/repos/ensime-server/util/src/main/scala/org/ensime/vfs/EnsimeVFS.scala b/repos/ensime-server/util/src/main/scala/org/ensime/vfs/EnsimeVFS.scala index bf444d9d0a5..768aaef58ce 100644 --- a/repos/ensime-server/util/src/main/scala/org/ensime/vfs/EnsimeVFS.scala +++ b/repos/ensime-server/util/src/main/scala/org/ensime/vfs/EnsimeVFS.scala @@ -49,10 +49,13 @@ object `package` { implicit class RichVFS(val vfs: DefaultFileSystemManager) extends AnyVal { implicit def toFileObject(f: File): FileObject = vfile(f) - private def withContext[T](msg: String)(t: => T): T = try { t } catch { - case e: FileSystemException => - throw new FileSystemException(e.getMessage + " in " + msg, e) - } + private def withContext[T](msg: String)(t: => T): T = + try { + t + } catch { + case e: FileSystemException => + throw new FileSystemException(e.getMessage + " in " + msg, e) + } def vfile(name: String) = withContext(s"$name =>")( vfs.resolveFile(name.intern) diff --git a/repos/fastparse/pythonparse/shared/src/main/scala/pythonparse/Expressions.scala b/repos/fastparse/pythonparse/shared/src/main/scala/pythonparse/Expressions.scala index 95884f78dd0..08f92e9150a 100644 --- a/repos/fastparse/pythonparse/shared/src/main/scala/pythonparse/Expressions.scala +++ b/repos/fastparse/pythonparse/shared/src/main/scala/pythonparse/Expressions.scala @@ -128,8 +128,7 @@ object Expressions { val trailer: P[Ast.expr => Ast.expr] = { val call = P("(" ~ arglist ~ ")").map { case (args, (keywords, starargs, kwargs)) => - (lhs: Ast.expr) => - Ast.expr.Call(lhs, args, keywords, starargs, kwargs) + (lhs: Ast.expr) => Ast.expr.Call(lhs, args, keywords, starargs, kwargs) } val slice = P("[" ~ subscriptlist ~ "]").map(args => (lhs: Ast.expr) => Ast.expr.Subscript(lhs, args, Ast.expr_context.Load)) diff --git a/repos/finagle/finagle-benchmark/src/main/scala/com/twitter/finagle/loadbalancer/Simulation.scala b/repos/finagle/finagle-benchmark/src/main/scala/com/twitter/finagle/loadbalancer/Simulation.scala index 3feded3143e..86c5a50df02 100644 --- a/repos/finagle/finagle-benchmark/src/main/scala/com/twitter/finagle/loadbalancer/Simulation.scala +++ b/repos/finagle/finagle-benchmark/src/main/scala/com/twitter/finagle/loadbalancer/Simulation.scala @@ -23,8 +23,7 @@ private object LatencyProfile { } val size = latencies.size var i = rng.nextInt(size) - () => - { i = i + 1; latencies(i % size) } + () => { i = i + 1; latencies(i % size) } } /** @@ -33,8 +32,7 @@ private object LatencyProfile { */ def between(low: Duration, high: Duration): () => Duration = { require(low <= high) - () => - low + ((high - low) * math.random) + () => low + ((high - low) * math.random) } /** @@ -70,8 +68,7 @@ private object LatencyProfile { latencies: IndexedSeq[() => Duration] ): () => Duration = { val drv = Drv(dist) - () => - latencies(drv(rng))() + () => latencies(drv(rng))() } } @@ -219,7 +216,9 @@ private[finagle] object Simulation extends com.twitter.app.App { n += 1 } - if (Rem > 0 && ms % (1000 / Rem) == 0) { call() } + if (Rem > 0 && ms % (1000 / Rem) == 0) { + call() + } ms += 1 diff --git a/repos/finagle/finagle-cacheresolver/src/main/scala/com/twitter/finagle/cacheresolver/ZookeeperStateMonitor.scala b/repos/finagle/finagle-cacheresolver/src/main/scala/com/twitter/finagle/cacheresolver/ZookeeperStateMonitor.scala index 6e359f8daa2..cf1fff1eaac 100644 --- a/repos/finagle/finagle-cacheresolver/src/main/scala/com/twitter/finagle/cacheresolver/ZookeeperStateMonitor.scala +++ b/repos/finagle/finagle-cacheresolver/src/main/scala/com/twitter/finagle/cacheresolver/ZookeeperStateMonitor.scala @@ -136,7 +136,7 @@ trait ZookeeperStateMonitor { .getData(zkPath, true, null) applyZKData(data) - } + } /** * Load the zookeeper node children as well as leaving a children watch, then invoke the @@ -155,7 +155,7 @@ trait ZookeeperStateMonitor { .getChildren(zkPath, true, null) applyZKChildren(children.toList) - } + } /** * Reconnect to the zookeeper, this maybe invoked when zookeeper connection expired and the @@ -175,7 +175,7 @@ trait ZookeeperStateMonitor { .get( Amount.of(DefaultZKWaitTimeout.inMilliseconds, Time.MILLISECONDS)) .getChildren(zkPath, true, null) - } + } // Register top-level connection watcher to monitor zk change. // This watcher will live across different zk connection diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/Filter.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/Filter.scala index 38c8b849e71..530ceb28569 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/Filter.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/Filter.scala @@ -78,8 +78,7 @@ abstract class Filter[-ReqIn, +RepOut, +ReqOut, -RepIn] def andThen(f: ReqOut => Future[RepIn]): ReqIn => Future[RepOut] = { val service = Service.mk(f) - req => - Filter.this.apply(req, service) + req => Filter.this.apply(req, service) } /** diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/NameTree.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/NameTree.scala index 11802d169fb..df4b425c972 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/NameTree.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/NameTree.scala @@ -86,7 +86,7 @@ object NameTree { case class Weighted[+T](weight: Double, tree: NameTree[T]) object Weighted { - val defaultWeight = 1D + val defaultWeight = 1d } /** diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/DefaultClient.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/DefaultClient.scala index a5564e022fd..52045d1e7a5 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/DefaultClient.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/DefaultClient.scala @@ -100,14 +100,13 @@ case class DefaultClient[Req, Rep]( private[this] def transform(stack: Stack[ServiceFactory[Req, Rep]]) = { val failureAccrualTransform: Transformer[Req, Rep] = failureAccrual match { case _: DefaultClient.UninitializedFailureAccrual => - factory: ServiceFactory[Req, Rep] => - { - val classifier = - params[param.ResponseClassifier].responseClassifier - DefaultClient - .defaultFailureAccrual(statsReceiver, classifier) - .andThen(factory) - } + factory: ServiceFactory[Req, Rep] => { + val classifier = + params[param.ResponseClassifier].responseClassifier + DefaultClient + .defaultFailureAccrual(statsReceiver, classifier) + .andThen(factory) + } case _ => failureAccrual } diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/StackClient.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/StackClient.scala index 4b538999386..e377f08673f 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/StackClient.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/StackClient.scala @@ -537,7 +537,7 @@ trait StdStackClient[Req, Rep, This <: StdStackClient[Req, Rep, This]] Contexts.letClear { endpointClient.newDispatcher(trans) } - } + } ServiceFactory(mkFutureSvc) } Stack.Leaf(this, factory) diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/ExpiringServerDispatcher.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/ExpiringServerDispatcher.scala index e86424ec3b7..041b981b4ed 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/ExpiringServerDispatcher.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/ExpiringServerDispatcher.scala @@ -23,5 +23,5 @@ object ExpiringServerDispatcher { statsReceiver) { private[this] val dispatcher = newDispatcher(transport, this) protected def onExpire() { dispatcher.close(Time.now) } - } + } } diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/PipeliningDispatcher.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/PipeliningDispatcher.scala index 24a8db36128..af3644ee159 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/PipeliningDispatcher.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/dispatch/PipeliningDispatcher.scala @@ -37,7 +37,7 @@ class PipeliningDispatcher[Req, Rep]( trans.read().respond { res => try p.update(res) finally loop() - } + } private[this] def loop(): Unit = q.poll().onSuccess(transRead) diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/BindingFactory.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/BindingFactory.scala index bad5e5904aa..511759f4451 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/BindingFactory.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/BindingFactory.scala @@ -259,7 +259,7 @@ private[finagle] class BindingFactory[Req, Rep]( Trace.recordBinary("namer.name", boundShow) super.apply(conn) } - }, + }, statsReceiver.scope("namecache"), maxNameCacheSize ) @@ -273,7 +273,7 @@ private[finagle] class BindingFactory[Req, Rep]( Trace.recordBinary("namer.tree", treeShow) super.apply(conn) } - }, + }, statsReceiver.scope("nametreecache"), maxNameTreeCacheSize ) diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/TrafficDistributor.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/TrafficDistributor.scala index ade30c0b82f..222bb0adce6 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/TrafficDistributor.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/factory/TrafficDistributor.scala @@ -293,7 +293,7 @@ private[finagle] class TrafficDistributor[Req, Rep]( } .sum .toFloat / size - else 0.0F + else 0.0f } // Translate the stream of weightClasses into a stream of underlying diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/netty3/Netty3Listener.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/netty3/Netty3Listener.scala index bbf8f1845ac..0d7ccbdc034 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/netty3/Netty3Listener.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/netty3/Netty3Listener.scala @@ -360,7 +360,7 @@ case class Netty3Listener[In, Out]( logger, scopedStatsReceiver, closer.activeChannels - ) + ) val bootstrap = new ServerBootstrap(channelFactory) bootstrap.setOptions(bootstrapOptions.asJava) bootstrap.setPipelineFactory( diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/param/ServerTransportParams.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/param/ServerTransportParams.scala index 923f9589fb0..0f919d9f60f 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/param/ServerTransportParams.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/param/ServerTransportParams.scala @@ -49,6 +49,6 @@ class ServerTransportParams[A <: Stack.Parameterized[A]]( caCertificatePath.orNull, ciphers.orNull, nextProtocols.orNull - )) + )) )) } diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/service/StatsFilter.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/service/StatsFilter.scala index 1121611ce65..c2601f098bd 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/service/StatsFilter.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/service/StatsFilter.scala @@ -210,6 +210,6 @@ class StatsServiceFactory[Req, Rep]( statsReceiver: StatsReceiver) extends ServiceFactoryProxy[Req, Rep](factory) { private[this] val availableGauge = statsReceiver.addGauge("available") { - if (isAvailable) 1F else 0F + if (isAvailable) 1f else 0f } } diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/stats/SummarizingStatsReceiver.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/stats/SummarizingStatsReceiver.scala index 797a46e8ff9..5e85dd0d72c 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/stats/SummarizingStatsReceiver.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/stats/SummarizingStatsReceiver.scala @@ -85,11 +85,11 @@ class SummarizingStatsReceiver extends StatsReceiverWithCumulativeGauges { n, xs(0), xs(n / 2), - xs(idx(.9D)), - xs(idx(.95D)), - xs(idx(.99D)), - xs(idx(.999D)), - xs(idx(.9999D)), + xs(idx(.9d)), + xs(idx(.95d)), + xs(idx(.99d)), + xs(idx(.999d)), + xs(idx(.9999d)), xs(n - 1))) }).toSeq @@ -103,7 +103,7 @@ class SummarizingStatsReceiver extends StatsReceiverWithCumulativeGauges { } ( variableName(k), - "p999=%s, p9999=%s".format(slice(.999D), slice(.9999D))) + "p999=%s, p9999=%s".format(slice(.999d), slice(.9999d))) }).toSeq val sortedCounters = counterLines.sortBy { case (k, _) => k } diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Drv.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Drv.scala index ffa3efec3af..1c0d3376828 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Drv.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Drv.scala @@ -79,7 +79,7 @@ object Drv { prob(s) = p(s) alias(s) = l - p(l) = (p(s) + p(l)) - 1D // Same as p(l)-(1-p(s)), but more stable + p(l) = (p(s) + p(l)) - 1d // Same as p(l)-(1-p(s)), but more stable if (p(l) < 1) small.enqueue(l) else large.enqueue(l) } @@ -111,7 +111,7 @@ object Drv { */ def fromWeights(weights: Seq[Double]): Drv = { val sum = weights.sum - if (sum == 0) Drv(Seq.fill(weights.size) { 1D / weights.size }) + if (sum == 0) Drv(Seq.fill(weights.size) { 1d / weights.size }) else Drv(weights map (_ / sum)) } } diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Ema.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Ema.scala index 3d756395e4a..335e98eb5b3 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Ema.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/util/Ema.scala @@ -11,7 +11,7 @@ package com.twitter.finagle.util */ private[finagle] class Ema(window: Long) { private[this] var time = Long.MinValue - private[this] var ema = 0D + private[this] var ema = 0d def isEmpty: Boolean = synchronized { time < 0 } diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/NameTreeParsersTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/NameTreeParsersTest.scala index 688ece7a249..c0c807b4407 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/NameTreeParsersTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/NameTreeParsersTest.scala @@ -61,11 +61,11 @@ class NameTreeParsersTest extends FunSuite with AssertionsForJUnit { NameTreeParsers.parseNameTree( "1 * /foo & 2 * /bar | .5 * /bar & .5 * /baz") == NameTree.Alt( NameTree.Union( - NameTree.Weighted(1D, NameTree.Leaf(Path.Utf8("foo"))), - NameTree.Weighted(2D, NameTree.Leaf(Path.Utf8("bar")))), + NameTree.Weighted(1d, NameTree.Leaf(Path.Utf8("foo"))), + NameTree.Weighted(2d, NameTree.Leaf(Path.Utf8("bar")))), NameTree.Union( - NameTree.Weighted(0.5D, NameTree.Leaf(Path.Utf8("bar"))), - NameTree.Weighted(0.5D, NameTree.Leaf(Path.Utf8("baz")))) + NameTree.Weighted(0.5d, NameTree.Leaf(Path.Utf8("bar"))), + NameTree.Weighted(0.5d, NameTree.Leaf(Path.Utf8("baz")))) )) intercept[IllegalArgumentException] { NameTreeParsers.parseNameTree("") } diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/StackTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/StackTest.scala index a44908ebfd3..e30f8b4a99d 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/StackTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/StackTest.scala @@ -34,7 +34,8 @@ class StackTest extends FunSuite { test("Stack.transform") { val stack = newStack() transform { case Stack.Node(head, mk, next) => - if (head.role == testRole3) Stack.Node(testHead4, (l: List[Int]) => 30::l, next) + if (head.role == testRole3) + Stack.Node(testHead4, (l: List[Int]) => 30 :: l, next) else if (head.role == testRole2) next else Stack.Node(head, mk, next) case other => other @@ -104,8 +105,10 @@ class StackTest extends FunSuite { def make(next: List[Int]): List[Int] = 100 :: next } - assert(stack.replace(testRole4, module).make(empty) == Seq(20, 10, 1, 2, 3, 4)) - assert(stack.replace(testRole2, module).make(empty) == Seq(20, 100, 1, 2, 3, 4)) + assert( + stack.replace(testRole4, module).make(empty) == Seq(20, 10, 1, 2, 3, 4)) + assert( + stack.replace(testRole2, module).make(empty) == Seq(20, 100, 1, 2, 3, 4)) assert( (stack ++ stack).replace(testRole2, module).make(empty) == diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/client/StackClientTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/client/StackClientTest.scala index 75262e5f176..29c6e72b9aa 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/client/StackClientTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/client/StackClientTest.scala @@ -397,8 +397,8 @@ class StackClientTest assert(dtab == baseDtab) Activity.value( NameTree.Union( - NameTree.Weighted(1D, NameTree.Leaf(Name.bound(addr1))), - NameTree.Weighted(1D, NameTree.Leaf(Name.bound(addr2))))) + NameTree.Weighted(1d, NameTree.Leaf(Name.bound(addr1))), + NameTree.Weighted(1d, NameTree.Leaf(Name.bound(addr2))))) } } diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/BindingFactoryTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/BindingFactoryTest.scala index f73853fc885..a0708b08827 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/BindingFactoryTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/BindingFactoryTest.scala @@ -98,7 +98,7 @@ class BindingFactoryTest closes += 1 Future.Done } - } + } lazy val factory = new BindingFactory( path, @@ -124,7 +124,7 @@ class BindingFactoryTest }) def close(deadline: Time) = Future.Done override def status = st - } + } test("BindingFactory reflects status of underlying cached service factory")( for (status <- Seq(Status.Busy, Status.Open, Status.Closed)) { @@ -558,11 +558,11 @@ class NameTreeFactoryTest extends FunSuite { test("distributes requests according to weight") { val tree = NameTree.Union( NameTree.Weighted( - 1D, + 1d, NameTree.Union( - NameTree.Weighted(1D, NameTree.Leaf("foo")), - NameTree.Weighted(1D, NameTree.Leaf("bar")))), - NameTree.Weighted(1D, NameTree.Leaf("baz")) + NameTree.Weighted(1d, NameTree.Leaf("foo")), + NameTree.Weighted(1d, NameTree.Leaf("bar")))), + NameTree.Weighted(1d, NameTree.Leaf("baz")) ) val counts = mutable.HashMap[String, Int]() @@ -575,7 +575,7 @@ class NameTreeFactoryTest extends FunSuite { Future.value(null) } def close(deadline: Time) = Future.Done - }) + }) // not the world's greatest test since it depends on the // implementation of Drv @@ -620,37 +620,37 @@ class NameTreeFactoryTest extends FunSuite { Future.value(null) def close(deadline: Time) = Future.Done override def status = key - }) + }) ).isAvailable assert( isAvailable(NameTree.Union( NameTree.Weighted( - 1D, + 1d, NameTree.Union( - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)), - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)))), - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)) + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)), + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)))), + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)) ))) assert( !isAvailable(NameTree.Union( NameTree.Weighted( - 1D, + 1d, NameTree.Union( - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)), - NameTree.Weighted(1D, NameTree.Leaf(Status.Closed)))), - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)) + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)), + NameTree.Weighted(1d, NameTree.Leaf(Status.Closed)))), + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)) ))) assert( !isAvailable(NameTree.Union( NameTree.Weighted( - 1D, + 1d, NameTree.Union( - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)), - NameTree.Weighted(1D, NameTree.Leaf(Status.Open)))), - NameTree.Weighted(1D, NameTree.Empty) + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)), + NameTree.Weighted(1d, NameTree.Leaf(Status.Open)))), + NameTree.Weighted(1d, NameTree.Empty) ))) } } diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/TrafficDistributorTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/TrafficDistributorTest.scala index 2466f63f765..08e8f35ba44 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/TrafficDistributorTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/factory/TrafficDistributorTest.scala @@ -36,7 +36,7 @@ private object TrafficDistributorTest { val weightClass: (Double, Int) => Set[Address] = (w, size) => (0 until size).toSet.map { i: Int => WeightedAddress(WeightedTestAddr(i, w), w) - } + } val busyWeight = 2.0 case class AddressFactory(addr: Address) extends ServiceFactory[Int, Int] { diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/P2CBalancerTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/P2CBalancerTest.scala index 0f8998ff09d..a844913fa27 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/P2CBalancerTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/loadbalancer/P2CBalancerTest.scala @@ -343,7 +343,7 @@ class P2CBalancerEwmaTest extends FunSuite with App with P2CSuite { case class LatentFactory(which: Int, latency: Any => Int) extends P2CServiceFactory { - val weight = 1D + val weight = 1d var load = 0 var sum = 0 def meanLoad = if (load == 0) 0.0 else sum.toDouble / load.toDouble diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/netty3/BufChannelBufferTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/netty3/BufChannelBufferTest.scala index 2ce10a7716a..3d5461880d7 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/netty3/BufChannelBufferTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/netty3/BufChannelBufferTest.scala @@ -430,7 +430,7 @@ class BufChannelBufferTest extends FunSuite with BeforeAndAfter { random.setSeed(seed) 0.until(CAPACITY - 3, 4) foreach { i => - val value = random.nextInt() & 0xFFFFFFFFL + val value = random.nextInt() & 0XFFFFFFFFL assert(value == bcb.getUnsignedInt(i)) } } @@ -630,7 +630,7 @@ class BufChannelBufferTest extends FunSuite with BeforeAndAfter { random.setSeed(seed) 0.until(CAPACITY, 4) foreach { i => - val value = random.nextInt() & 0xFFFFFFFFL + val value = random.nextInt() & 0XFFFFFFFFL assert(i == bcb.readerIndex()) assert(bcb.readable()) assert(value == bcb.readUnsignedInt()) diff --git a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/util/EmaTest.scala b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/util/EmaTest.scala index 681605abeb4..5b9f7766706 100644 --- a/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/util/EmaTest.scala +++ b/repos/finagle/finagle-core/src/test/scala/com/twitter/finagle/util/EmaTest.scala @@ -41,7 +41,7 @@ class EmaTest extends FunSuite { e.reset() - assert(e.last == 0D) + assert(e.last == 0d) assert(e.update(2, 5) == 5) } } diff --git a/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/memcache/KetamaClientStress.scala b/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/memcache/KetamaClientStress.scala index 9c186dbede3..f72fd00f58e 100644 --- a/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/memcache/KetamaClientStress.scala +++ b/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/memcache/KetamaClientStress.scala @@ -122,55 +122,49 @@ object KetamaClientStress extends App { val operation = config.op() match { case "set" => - () => - { - val (key, value) = nextKeyValue - ketamaClient.set(key, value) - } + () => { + val (key, value) = nextKeyValue + ketamaClient.set(key, value) + } case "getHit" => keyValueSet foreach { case (k, v) => ketamaClient.set(k, v)() } - () => - { - val (key, _) = nextKeyValue - ketamaClient.get(key) - } + () => { + val (key, _) = nextKeyValue + ketamaClient.get(key) + } case "getMiss" => keyValueSet foreach { case (k, _) => ketamaClient.delete(k)() } - () => - { - val (key, _) = nextKeyValue - ketamaClient.get(key) - } + () => { + val (key, _) = nextKeyValue + ketamaClient.get(key) + } case "gets" => keyValueSet foreach { case (k, v) => ketamaClient.set(k, v)() } - () => - { - val (key, _) = nextKeyValue - ketamaClient.gets(key) - } + () => { + val (key, _) = nextKeyValue + ketamaClient.gets(key) + } case "getsMiss" => keyValueSet foreach { case (k, _) => ketamaClient.delete(k)() } - () => - { - val (key, _) = nextKeyValue - ketamaClient.gets(key) - } + () => { + val (key, _) = nextKeyValue + ketamaClient.gets(key) + } case "getsThenCas" => keyValueSet.map { case (k, v) => ketamaClient.set(k, v)() } val casMap = mutable.Map.empty[String, (Buf, Buf)] - () => - { - val (key, value) = nextKeyValue - casMap.remove(key) match { - case Some((_, unique)) => ketamaClient.cas(key, value, unique) - case None => - ketamaClient.gets(key).map { - case Some(r) => casMap(key) = r - case None => // not expecting - } - } + () => { + val (key, value) = nextKeyValue + casMap.remove(key) match { + case Some((_, unique)) => ketamaClient.cas(key, value, unique) + case None => + ketamaClient.gets(key).map { + case Some(r) => casMap(key) = r + case None => // not expecting + } } + } case "add" => val (key, value) = ( randomString(config.keysize()), @@ -179,11 +173,10 @@ object KetamaClientStress extends App { ketamaClient.add(key + load_count.getAndIncrement().toString, value) case "replace" => keyValueSet foreach { case (k, v) => ketamaClient.set(k, v)() } - () => - { - val (key, value) = nextKeyValue - ketamaClient.replace(key, value) - } + () => { + val (key, value) = nextKeyValue + ketamaClient.replace(key, value) + } } proc(operation, config.loadrate()) @@ -196,64 +189,56 @@ object KetamaClientStress extends App { val operation = config.op() match { case "set" => - () => - { - val (key, value) = nextKeyValue - replicationClient.set(key, value) - } + () => { + val (key, value) = nextKeyValue + replicationClient.set(key, value) + } case "getAllHit" => keyValueSet foreach { case (k, v) => replicationClient.set(k, v)() } - () => - { - val (key, _) = nextKeyValue - replicationClient.getAll(key) - } + () => { + val (key, _) = nextKeyValue + replicationClient.getAll(key) + } case "getAllMiss" => keyValueSet foreach { case (k, _) => replicationClient.delete(k)() } - () => - { - val (key, _) = nextKeyValue - replicationClient.getAll(key) - } + () => { + val (key, _) = nextKeyValue + replicationClient.getAll(key) + } case "getOneHit" => keyValueSet foreach { case (k, v) => replicationClient.set(k, v)() } - () => - { - val (key, _) = nextKeyValue - replicationClient.getOne(key, false) - } + () => { + val (key, _) = nextKeyValue + replicationClient.getOne(key, false) + } case "getOneMiss" => keyValueSet foreach { case (k, _) => replicationClient.delete(k)() } - () => - { - val (key, _) = nextKeyValue - replicationClient.getOne(key, false) - } + () => { + val (key, _) = nextKeyValue + replicationClient.getOne(key, false) + } case "getSetMix" => assert(config.rwRatio() >= 0 && config.rwRatio() < 100) keyValueSet foreach { case (k, v) => replicationClient.set(k, v)() } - () => - { - val c = load_count.getAndIncrement() - val (key, value) = keyValueSet((c % config.numkeys()).toInt) - if (c % 100 >= config.rwRatio()) - replicationClient.set(key, value) - else replicationClient.getOne(key, false) - } + () => { + val c = load_count.getAndIncrement() + val (key, value) = keyValueSet((c % config.numkeys()).toInt) + if (c % 100 >= config.rwRatio()) + replicationClient.set(key, value) + else replicationClient.getOne(key, false) + } case "getsAll" => keyValueSet foreach { case (k, v) => replicationClient.set(k, v)() } - () => - { - val (key, _) = nextKeyValue - replicationClient.getsAll(key) - } + () => { + val (key, _) = nextKeyValue + replicationClient.getsAll(key) + } case "getsAllMiss" => keyValueSet foreach { case (k, _) => replicationClient.delete(k)() } - () => - { - val (key, _) = nextKeyValue - replicationClient.getsAll(key) - } + () => { + val (key, _) = nextKeyValue + replicationClient.getsAll(key) + } case "getsAllThenCas" => keyValueSet.map { case (k, v) => replicationClient.set(k, v)() } val casMap: scala.collection.mutable.Map[ @@ -261,43 +246,40 @@ object KetamaClientStress extends App { ReplicationStatus[Option[(Buf, ReplicaCasUnique)]]] = scala.collection.mutable.Map() - () => - { - val (key, value) = nextKeyValue - casMap.remove(key) match { - case Some( - ConsistentReplication(Some((_, RCasUnique(uniques))))) => - replicationClient.checkAndSet(key, value, uniques) - case Some(ConsistentReplication(None)) => - // not expecting this to ever happen - replicationClient.set(key, value) - case Some(InconsistentReplication(resultSeq)) => - // not expecting this to ever happen - replicationClient.set(key, value) - case Some(FailedReplication(failureSeq)) => - // not expecting this to ever happen - replicationClient.set(key, value) - case None => - replicationClient.getsAll(key).map { casMap(key) = _ } - } + () => { + val (key, value) = nextKeyValue + casMap.remove(key) match { + case Some( + ConsistentReplication(Some((_, RCasUnique(uniques))))) => + replicationClient.checkAndSet(key, value, uniques) + case Some(ConsistentReplication(None)) => + // not expecting this to ever happen + replicationClient.set(key, value) + case Some(InconsistentReplication(resultSeq)) => + // not expecting this to ever happen + replicationClient.set(key, value) + case Some(FailedReplication(failureSeq)) => + // not expecting this to ever happen + replicationClient.set(key, value) + case None => + replicationClient.getsAll(key).map { casMap(key) = _ } } + } case "add" => val (key, value) = ( randomString(config.keysize()), Buf.Utf8(randomString(config.valuesize()))) - () => - { - replicationClient.add( - key + load_count.getAndIncrement().toString, - value) - } + () => { + replicationClient.add( + key + load_count.getAndIncrement().toString, + value) + } case "replace" => keyValueSet foreach { case (k, v) => replicationClient.set(k, v)() } - () => - { - val (key, value) = nextKeyValue - replicationClient.replace(key, value) - } + () => { + val (key, value) = nextKeyValue + replicationClient.replace(key, value) + } } proc(operation, config.loadrate()) } diff --git a/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/mysql/Example.scala b/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/mysql/Example.scala index 55e5565ab2e..63f1de94802 100644 --- a/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/mysql/Example.scala +++ b/repos/finagle/finagle-example/src/main/scala/com/twitter/finagle/example/mysql/Example.scala @@ -30,37 +30,37 @@ object SwimmingRecord { val records = List( SwimmingRecord( "50 m freestyle", - 20.91F, + 20.91f, "Cesar Cielo", "Brazil", Date.valueOf("2009-12-18")), SwimmingRecord( "100 m freestyle", - 46.91F, + 46.91f, "Cesar Cielo", "Brazil", Date.valueOf("2009-08-02")), SwimmingRecord( "50 m backstroke", - 24.04F, + 24.04f, "Liam Tancock", "Great Britain", Date.valueOf("2009-08-02")), SwimmingRecord( "100 m backstroke", - 51.94F, + 51.94f, "Aaron Peirsol", "United States", Date.valueOf("2009-07-08")), SwimmingRecord( "50 m butterfly", - 22.43F, + 22.43f, "Rafael Munoz", "Spain", Date.valueOf("2009-05-05")), SwimmingRecord( "100 m butterfly", - 49.82F, + 49.82f, "Michael Phelps", "United States", Date.valueOf("2009-07-29")) @@ -125,7 +125,7 @@ object Example extends App { val StringValue(name) = row("name").get val time = row("time").map { case FloatValue(f) => f - case _ => 0.0F + case _ => 0.0f }.get (name, time, date) diff --git a/repos/finagle/finagle-http/src/test/scala/com/twitter/finagle/http/path/PathTest.scala b/repos/finagle/finagle-http/src/test/scala/com/twitter/finagle/http/path/PathTest.scala index ad17a5dc852..d77a1818789 100644 --- a/repos/finagle/finagle-http/src/test/scala/com/twitter/finagle/http/path/PathTest.scala +++ b/repos/finagle/finagle-http/src/test/scala/com/twitter/finagle/http/path/PathTest.scala @@ -107,7 +107,7 @@ class PathTest extends FunSuite with GeneratorDrivenPropertyChecks { "l" -> "2147483648", "d" -> "1.3")) match { case Root / "test.json" :? (I(i) :& L(l) :& D(d)) => - i == 1 && l == 2147483648L && d == 1.3D + i == 1 && l == 2147483648L && d == 1.3d case _ => false } } diff --git a/repos/finagle/finagle-integration/src/test/scala/com/twitter/finagle/integration/ClientSessionTest.scala b/repos/finagle/finagle-integration/src/test/scala/com/twitter/finagle/integration/ClientSessionTest.scala index 9ea920bfd04..bdbf4ac6418 100644 --- a/repos/finagle/finagle-integration/src/test/scala/com/twitter/finagle/integration/ClientSessionTest.scala +++ b/repos/finagle/finagle-integration/src/test/scala/com/twitter/finagle/integration/ClientSessionTest.scala @@ -49,8 +49,7 @@ class ClientSessionTest extends FunSuite with MockitoSugar { mux.FailureDetector.NullConfig, "test", NullStatsReceiver) - () => - session.status + () => session.status } ) @@ -58,8 +57,7 @@ class ClientSessionTest extends FunSuite with MockitoSugar { "mux-dispatcher", { tr: Transport[mux.transport.Message, mux.transport.Message] => val dispatcher = mux.ClientDispatcher.newRequestResponse(tr) - () => - dispatcher.status + () => dispatcher.status } ) @@ -68,16 +66,14 @@ class ClientSessionTest extends FunSuite with MockitoSugar { val manager = mock[http.codec.ConnectionManager] when(manager.shouldClose).thenReturn(false) val wrappedT = new http.HttpTransport(tr, manager) - () => - wrappedT.status + () => wrappedT.status } ) testSessionStatus( "http-dispatcher", { tr: Transport[Any, Any] => val dispatcher = new HttpClientDispatcher(tr) - () => - dispatcher.status + () => dispatcher.status } ) @@ -91,8 +87,7 @@ class ClientSessionTest extends FunSuite with MockitoSugar { tr: Transport[memcached.protocol.Command, memcached.protocol.Response] => val cl: MyClient = new MyClient val svc = cl.newDisp(tr) - () => - svc.status + () => svc.status } ) @@ -101,8 +96,7 @@ class ClientSessionTest extends FunSuite with MockitoSugar { tr: Transport[mysql.transport.Packet, mysql.transport.Packet] => val handshake = mysql.Handshake(Some("username"), Some("password")) val dispatcher = new mysql.ClientDispatcher(tr, handshake) - () => - dispatcher.status + () => dispatcher.status } ) } diff --git a/repos/finagle/finagle-kestrel/src/main/scala/com/twitter/finagle/kestrel/Client.scala b/repos/finagle/finagle-kestrel/src/main/scala/com/twitter/finagle/kestrel/Client.scala index 92ea50642d9..149aff2a02e 100644 --- a/repos/finagle/finagle-kestrel/src/main/scala/com/twitter/finagle/kestrel/Client.scala +++ b/repos/finagle/finagle-kestrel/src/main/scala/com/twitter/finagle/kestrel/Client.scala @@ -521,7 +521,7 @@ protected[kestrel] class ConnectedClient( case Values(Seq()) => Return(None) case _ => Throw(new IllegalArgumentException("invalid reply from kestrel")) - }, + }, open, (Unit) => closeAndOpen, (Unit) => abort @@ -585,7 +585,7 @@ protected[kestrel] class ThriftConnectedClient( .flushQueue(queueName) .map { _ => Values(Nil) - }) + }) def delete(queueName: String): Future[Response] = withClient[Response]( @@ -594,7 +594,7 @@ protected[kestrel] class ThriftConnectedClient( .deleteQueue(queueName) .map { _ => Deleted() - }) + }) def set( queueName: String, @@ -607,7 +607,7 @@ protected[kestrel] class ThriftConnectedClient( .put(queueName, List(Buf.ByteBuffer.Owned.extract(value)), timeout) .map { _ => Stored() - }) + }) } def get( @@ -622,7 +622,7 @@ protected[kestrel] class ThriftConnectedClient( case Seq() => None case Seq(item: Item) => Some(Buf.ByteBuffer.Owned(item.data)) case _ => throw new IllegalArgumentException - }) + }) } private def openRead(queueName: String)( @@ -654,7 +654,7 @@ protected[kestrel] class ThriftConnectedClient( case Seq() => Return(None) case _ => Throw(new IllegalArgumentException("invalid reply from kestrel")) - }, + }, openRead(queueName), confirmAndOpenRead(queueName), abortReadCommand(queueName) diff --git a/repos/finagle/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/ZookeeperStateMonitor.scala b/repos/finagle/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/ZookeeperStateMonitor.scala index 4ba459193a5..007fc0e5078 100644 --- a/repos/finagle/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/ZookeeperStateMonitor.scala +++ b/repos/finagle/finagle-memcached/src/main/scala/com/twitter/finagle/memcached/ZookeeperStateMonitor.scala @@ -136,7 +136,7 @@ trait ZookeeperStateMonitor { .getData(zkPath, true, null) applyZKData(data) - } + } /** * Load the zookeeper node children as well as leaving a children watch, then invoke the @@ -155,7 +155,7 @@ trait ZookeeperStateMonitor { .getChildren(zkPath, true, null) applyZKChildren(children.toList) - } + } /** * Reconnect to the zookeeper, this maybe invoked when zookeeper connection expired and the @@ -175,7 +175,7 @@ trait ZookeeperStateMonitor { .get( Amount.of(DefaultZKWaitTimeout.inMilliseconds, Time.MILLISECONDS)) .getChildren(zkPath, true, null) - } + } // Register top-level connection watcher to monitor zk change. // This watcher will live across different zk connection diff --git a/repos/finagle/finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/SimpleClientTest.scala b/repos/finagle/finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/SimpleClientTest.scala index 91638a28cf6..74b0b7deee7 100644 --- a/repos/finagle/finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/SimpleClientTest.scala +++ b/repos/finagle/finagle-memcached/src/test/scala/com/twitter/finagle/memcached/integration/SimpleClientTest.scala @@ -156,7 +156,9 @@ class SimpleClientTest extends FunSuite with BeforeAndAfter { Await.result(client.set(" ", Buf.Utf8("bar"))) } - try { Await.result(client.set("\t", Buf.Utf8("bar"))) } catch { + try { + Await.result(client.set("\t", Buf.Utf8("bar"))) + } catch { case _: ClientError => fail("\t is allowed") } diff --git a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/ThresholdFailureDetector.scala b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/ThresholdFailureDetector.scala index ad930bb97cf..f9dab7ecd14 100644 --- a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/ThresholdFailureDetector.scala +++ b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/ThresholdFailureDetector.scala @@ -70,7 +70,7 @@ private class ThresholdFailureDetector( x match { case _: TimeoutException => markBusy() case _ => - } + } def status: Status = state.get diff --git a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Alarm.scala b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Alarm.scala index 7b8567e51e3..d8be19f35fe 100644 --- a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Alarm.scala +++ b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Alarm.scala @@ -67,8 +67,7 @@ private[lease] class GenerationAlarm( ctr: ByteCounter ) extends PredicateAlarm({ val generation = ctr.info.generation() - () => - generation != ctr.info.generation() + () => generation != ctr.info.generation() }) private[lease] class IntervalAlarm(val sleeptime: Duration) extends Alarm { diff --git a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/ClockedDrainer.scala b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/ClockedDrainer.scala index 2ed6d6f55b1..8bfcc2e6e3b 100644 --- a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/ClockedDrainer.scala +++ b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/ClockedDrainer.scala @@ -88,14 +88,14 @@ private[finagle] class ClockedDrainer( val openForGauge = statsReceiver.addGauge("openfor_ms") { openFor() match { case Duration.Finite(d) => d.inMilliseconds.toFloat - case _ => -1F + case _ => -1f } } val closedForGauge = statsReceiver.addGauge("closedfor_ms") { closedFor() match { case Duration.Finite(d) => d.inMilliseconds.toFloat - case _ => -1F + case _ => -1f } } diff --git a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Coordinator.scala b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Coordinator.scala index e71fe58ce9c..24e90ad95d9 100644 --- a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Coordinator.scala +++ b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/Coordinator.scala @@ -36,8 +36,7 @@ private[lease] class Coordinator( new BytesAlarm( counter, { val saved = counter.info.remaining() - () => - saved - 1.byte + () => saved - 1.byte } ) } diff --git a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/GarbageCollector.scala b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/GarbageCollector.scala index 1eb734feed2..e48775732a1 100644 --- a/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/GarbageCollector.scala +++ b/repos/finagle/finagle-mux/src/main/scala/com/twitter/finagle/mux/lease/exp/GarbageCollector.scala @@ -10,8 +10,7 @@ private[lease] object GarbageCollector { // a minor collection. val meth = Class.forName("com.twitter.hotspot.System").getMethod("minorGc") log.log(Level.INFO, "Found com.twitter.hotspot.System.minorGc") - () => - meth.invoke(null) + () => meth.invoke(null) } catch { case exc: ClassNotFoundException => log.log( @@ -19,7 +18,6 @@ private[lease] object GarbageCollector { "Failed to resolve com.twitter.hotspot.System; falling " + "back to full GC", exc) - () => - System.gc() + () => System.gc() } } diff --git a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/ClientTest.scala b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/ClientTest.scala index 5ea3e8f7fef..2749a523951 100644 --- a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/ClientTest.scala +++ b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/ClientTest.scala @@ -36,37 +36,37 @@ object SwimmingRecord { val allRecords = List[SwimmingRecord]( SwimmingRecord( "50 m freestyle", - 20.91F, + 20.91f, "Cesar Cielo", "Brazil", Date.valueOf("2009-12-18")), SwimmingRecord( "100 m freestyle", - 46.91F, + 46.91f, "Cesar Cielo", "Brazil", Date.valueOf("2009-08-02")), SwimmingRecord( "50 m backstroke", - 24.04F, + 24.04f, "Liam Tancock", "Great Britain", Date.valueOf("2009-08-02")), SwimmingRecord( "100 m backstroke", - 51.94F, + 51.94f, "Aaron Peirsol", "United States", Date.valueOf("2009-07-08")), SwimmingRecord( "50 m butterfly", - 22.43F, + 22.43f, "Rafael Munoz", "Spain", Date.valueOf("2009-05-05")), SwimmingRecord( "100 m butterfly", - 49.82F, + 49.82f, "Michael Phelps", "United States", Date.valueOf("2009-07-29")) diff --git a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/TypeTest.scala b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/TypeTest.scala index 14b355d93aa..53e6c0578c7 100644 --- a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/TypeTest.scala +++ b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/integration/TypeTest.scala @@ -86,7 +86,7 @@ class NumericTypeTest extends FunSuite with IntegrationClient { test("extract %s from %s".format("float", rowType)) { row("float") match { case Some(FloatValue(f)) => - assert(math.abs((f - 1.61F)) <= .000001) + assert(math.abs((f - 1.61f)) <= .000001) case v => fail("expected FloatValue but got %s".format(v)) } } diff --git a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/RequestTest.scala b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/RequestTest.scala index f6ae2da0c6c..0c9baf17ca2 100644 --- a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/RequestTest.scala +++ b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/RequestTest.scala @@ -91,7 +91,7 @@ class ExecuteRequestTest extends FunSuite { val shortVal = 2.toShort val intVal = 3 val longVal = 4L - val floatVal = 1.5F + val floatVal = 1.5f val doubleVal = 2.345 val cal = Calendar.getInstance() val millis = cal.getTimeInMillis diff --git a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/transport/BufferTest.scala b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/transport/BufferTest.scala index cf77409d13e..533565a4b5c 100644 --- a/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/transport/BufferTest.scala +++ b/repos/finagle/finagle-mysql/src/test/scala/com/twitter/finagle/mysql/unit/transport/BufferTest.scala @@ -50,7 +50,7 @@ class BufferTest extends FunSuite { test("read Long") { val br = BufferReader(bytes) - assert(br.readLong() == 0x7877665544332211L) + assert(br.readLong() == 0X7877665544332211L) } test("read null terminated string") { @@ -103,8 +103,8 @@ class BufferTest extends FunSuite { test("write Long") { val ctx = writerCtx() import ctx._ - bw.writeLong(0x7877665544332211L) - assert(0x7877665544332211L == br.readLong) + bw.writeLong(0X7877665544332211L) + assert(0X7877665544332211L == br.readLong) } test("tiny length coded binary") { diff --git a/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/Netty4Listener.scala b/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/Netty4Listener.scala index daa1a7d2567..83c7de07a1f 100644 --- a/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/Netty4Listener.scala +++ b/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/Netty4Listener.scala @@ -86,7 +86,7 @@ private[finagle] case class Netty4Listener[In, Out]( new ServerBridge( transportFactory, serveTransport - ) + ) val bossLoop: EventLoopGroup = new NioEventLoopGroup( 1 /*nThreads*/, diff --git a/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/codec/EncodeHandler.scala b/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/codec/EncodeHandler.scala index e63bfb19d20..c019ca5a092 100644 --- a/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/codec/EncodeHandler.scala +++ b/repos/finagle/finagle-netty4/src/main/scala/com/twitter/finagle/netty4/codec/EncodeHandler.scala @@ -28,7 +28,9 @@ private[netty4] class EncodeHandler[Out](frameEncoder: FrameEncoder[Out]) ctx: ChannelHandlerContext, msg: Any, promise: ChannelPromise): Unit = { - val encoded = try { frameEncoder(msg.asInstanceOf[Out]) } catch { + val encoded = try { + frameEncoder(msg.asInstanceOf[Out]) + } catch { case NonFatal(e) => ctx.pipeline.fireExceptionCaught(Failure("encoding failure", e)) Buf.Empty diff --git a/repos/finagle/finagle-netty4/src/test/scala/com/twitter/finagle/netty4/BufAsByteBufTest.scala b/repos/finagle/finagle-netty4/src/test/scala/com/twitter/finagle/netty4/BufAsByteBufTest.scala index c022cfc436b..5c090bf3f7b 100644 --- a/repos/finagle/finagle-netty4/src/test/scala/com/twitter/finagle/netty4/BufAsByteBufTest.scala +++ b/repos/finagle/finagle-netty4/src/test/scala/com/twitter/finagle/netty4/BufAsByteBufTest.scala @@ -430,7 +430,7 @@ class BufAsByteBufTest extends FunSuite with BeforeAndAfter { random.setSeed(seed) 0.until(Capacity - 3, 4).foreach { i => - val value = random.nextInt() & 0xFFFFFFFFL + val value = random.nextInt() & 0XFFFFFFFFL assert(value == wrappedBuf.getUnsignedInt(i)) } } @@ -630,7 +630,7 @@ class BufAsByteBufTest extends FunSuite with BeforeAndAfter { random.setSeed(seed) 0.until(Capacity, 4).foreach { i => - val value = random.nextInt() & 0xFFFFFFFFL + val value = random.nextInt() & 0XFFFFFFFFL assert(i == wrappedBuf.readerIndex) assert(wrappedBuf.isReadable) assert(value == wrappedBuf.readUnsignedInt()) diff --git a/repos/finagle/finagle-serversets/src/main/scala/com/twitter/finagle/serverset2/Parse.scala b/repos/finagle/finagle-serversets/src/main/scala/com/twitter/finagle/serverset2/Parse.scala index 887b87dbab5..d9c7d440c99 100644 --- a/repos/finagle/finagle-serversets/src/main/scala/com/twitter/finagle/serverset2/Parse.scala +++ b/repos/finagle/finagle-serversets/src/main/scala/com/twitter/finagle/serverset2/Parse.scala @@ -52,7 +52,6 @@ private[serverset2] object JsonDict { case NonFatal(_) => return Function.const(None) } - key => - Option(o.get(key)) + key => Option(o.get(key)) } } diff --git a/repos/finagle/finagle-serversets/src/test/scala/com/twitter/finagle/serverset2/StabilizerTest.scala b/repos/finagle/finagle-serversets/src/test/scala/com/twitter/finagle/serverset2/StabilizerTest.scala index e54c141f961..ff5d4993d89 100644 --- a/repos/finagle/finagle-serversets/src/test/scala/com/twitter/finagle/serverset2/StabilizerTest.scala +++ b/repos/finagle/finagle-serversets/src/test/scala/com/twitter/finagle/serverset2/StabilizerTest.scala @@ -15,9 +15,9 @@ class StabilizerTest extends FunSuite { val addr1 = Address(1) val addr2 = Address(2) val addr3 = Address(3) - val waddr1 = WeightedAddress(addr1, 1D) - val waddr2 = WeightedAddress(addr1, 2D) - val waddr3 = WeightedAddress(addr2, 2D) + val waddr1 = WeightedAddress(addr1, 1d) + val waddr2 = WeightedAddress(addr1, 2d) + val waddr3 = WeightedAddress(addr2, 2d) val va = Var[Addr](Addr.Pending) val removalEvent = Event[Unit]() diff --git a/repos/finagle/finagle-thrift/src/test/scala/com/twitter/finagle/thrift/ThriftTest.scala b/repos/finagle/finagle-thrift/src/test/scala/com/twitter/finagle/thrift/ThriftTest.scala index 47338ab0bc5..4ca4c036a30 100644 --- a/repos/finagle/finagle-thrift/src/test/scala/com/twitter/finagle/thrift/ThriftTest.scala +++ b/repos/finagle/finagle-thrift/src/test/scala/com/twitter/finagle/thrift/ThriftTest.scala @@ -69,7 +69,7 @@ trait ThriftTest { self: FunSuite => def close() { server.close() } - } + } private val newBuilderClient = ( protocolFactory: TProtocolFactory, @@ -90,7 +90,7 @@ trait ThriftTest { self: FunSuite => def close() { service.close() } - } + } private val newAPIServer = (protocolFactory: TProtocolFactory) => new { @@ -103,7 +103,7 @@ trait ThriftTest { self: FunSuite => def close() { server.close() } - } + } private val newAPIClient = ( protocolFactory: TProtocolFactory, @@ -121,7 +121,7 @@ trait ThriftTest { self: FunSuite => } def close() = () - } + } private val protocols = Map( // Commenting out due to flakiness - see DPT-175 and DPT-181 diff --git a/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LAFuture.scala b/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LAFuture.scala index 9f79fd14d14..7de3d04afc3 100644 --- a/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LAFuture.scala +++ b/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LAFuture.scala @@ -121,7 +121,7 @@ class LAFuture[T](val scheduler: LAScheduler) { case e: EmptyBox => ret.complete(e) } case e: EmptyBox => ret.complete(e) - }) + }) ret } diff --git a/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LiftActor.scala b/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LiftActor.scala index 3369fc7c3ca..935f493a09d 100644 --- a/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LiftActor.scala +++ b/repos/framework/core/actor/src/main/scala/net/liftweb/actor/LiftActor.scala @@ -189,13 +189,11 @@ trait SpecializedLiftActor[T] extends SimpleActor[T] { if (!processing) { if (LAScheduler.onSameThread) { processing = true - () => - processMailbox(true) + () => processMailbox(true) } else { if (startCnt == 0) { startCnt += 1 - () => - LAScheduler.execute(() => processMailbox(false)) + () => LAScheduler.execute(() => processMailbox(false)) } else () => {} } } else () => {} @@ -214,13 +212,11 @@ trait SpecializedLiftActor[T] extends SimpleActor[T] { if (!processing) { if (LAScheduler.onSameThread) { processing = true - () => - processMailbox(true) + () => processMailbox(true) } else { if (startCnt == 0) { startCnt += 1 - () => - LAScheduler.execute(() => processMailbox(false)) + () => LAScheduler.execute(() => processMailbox(false)) } else () => {} } } else () => {} diff --git a/repos/framework/core/common/src/test/scala/net/liftweb/common/BoxSpec.scala b/repos/framework/core/common/src/test/scala/net/liftweb/common/BoxSpec.scala index 5b84d50df56..f64dc08d8dc 100644 --- a/repos/framework/core/common/src/test/scala/net/liftweb/common/BoxSpec.scala +++ b/repos/framework/core/common/src/test/scala/net/liftweb/common/BoxSpec.scala @@ -203,7 +203,7 @@ class BoxSpec extends Specification with ScalaCheck with BoxGenerator { } "define a 'asA' method must work with Double" in { - Full(44d).asA[Double] must_== Full(44D) + Full(44d).asA[Double] must_== Full(44d) Full(44d).asA[Boolean] must_== Empty } diff --git a/repos/framework/core/json/src/main/scala/net/liftweb/json/Extraction.scala b/repos/framework/core/json/src/main/scala/net/liftweb/json/Extraction.scala index 4f6c7e1ded9..ade7c445099 100644 --- a/repos/framework/core/json/src/main/scala/net/liftweb/json/Extraction.scala +++ b/repos/framework/core/json/src/main/scala/net/liftweb/json/Extraction.scala @@ -62,7 +62,9 @@ object Extraction { */ def extractOpt[A]( json: JValue)(implicit formats: Formats, mf: Manifest[A]): Option[A] = - try { Some(extract(json)(formats, mf)) } catch { + try { + Some(extract(json)(formats, mf)) + } catch { case _: MappingException => None } diff --git a/repos/framework/core/json/src/main/scala/net/liftweb/json/JsonParser.scala b/repos/framework/core/json/src/main/scala/net/liftweb/json/JsonParser.scala index 2e2931895fd..e63ff671e17 100644 --- a/repos/framework/core/json/src/main/scala/net/liftweb/json/JsonParser.scala +++ b/repos/framework/core/json/src/main/scala/net/liftweb/json/JsonParser.scala @@ -55,13 +55,17 @@ object JsonParser { /** Return parsed JSON. */ def parseOpt(s: String): Option[JValue] = - try { parse(s).toOpt } catch { case e: Exception => None } + try { + parse(s).toOpt + } catch { case e: Exception => None } /** Return parsed JSON. * @param closeAutomatically true (default) if the Reader is automatically closed on EOF */ def parseOpt(s: Reader, closeAutomatically: Boolean = true): Option[JValue] = - try { parse(s, closeAutomatically).toOpt } catch { + try { + parse(s, closeAutomatically).toOpt + } catch { case e: Exception => None } @@ -85,7 +89,9 @@ object JsonParser { } catch { case e: ParseException => throw e case e: Exception => throw new ParseException("parsing failed", e) - } finally { buf.release } + } finally { + buf.release + } } private[json] def unquote(string: String): String = @@ -227,7 +233,9 @@ object JsonParser { private def convert[A](x: Any, expectedType: Class[A]): A = { if (x == null) parser.fail("expected object or array") - try { x.asInstanceOf[A] } catch { + try { + x.asInstanceOf[A] + } catch { case _: ClassCastException => parser.fail("unexpected " + x) } } diff --git a/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala b/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala index 8daffb8265c..6c7a7778c19 100644 --- a/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala +++ b/repos/framework/core/json/src/test/scala/net/liftweb/json/JsonQueryExamples.scala @@ -45,9 +45,9 @@ object JsonQueryExamples extends Specification { val ips = { for { - field <-ipsList + field <- ipsList JString(ip) <- field.value - } yield { ip } + } yield {ip} } ips mustEqual 192.168.1.125192.168.1.126192.168.1.127192.168.2.125192.168.2.126 diff --git a/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala b/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala index 4a1e5e6d933..e1060149a6a 100644 --- a/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala +++ b/repos/framework/core/json/src/test/scala/net/liftweb/json/XmlExamples.scala @@ -138,8 +138,8 @@ object XmlExamples extends Specification { val url = "test" val groupedText = - { Group(List(Text("foo"), Text("bar"))) } - http://example.com/{ url } + {Group(List(Text("foo"), Text("bar")))} + http://example.com/{url} // Examples by Jonathan Ferguson. See http://groups.google.com/group/liftweb/browse_thread/thread/f3bdfcaf1c21c615/c311a91e44f9c178?show_docid=c311a91e44f9c178 diff --git a/repos/framework/core/util/src/main/scala/net/liftweb/util/ClassHelpers.scala b/repos/framework/core/util/src/main/scala/net/liftweb/util/ClassHelpers.scala index 06f09fd81e6..62c9af31baa 100644 --- a/repos/framework/core/util/src/main/scala/net/liftweb/util/ClassHelpers.scala +++ b/repos/framework/core/util/src/main/scala/net/liftweb/util/ClassHelpers.scala @@ -377,7 +377,7 @@ trait ClassHelpers { self: ControlHelpers => case Failure(_, Full(c), _) => if (c.getCause != null) throw c.getCause else throw c case _ => false - }) match { + }) match { case Some(result @ Full(_)) => result case _ => Failure("invokeMethod " + meth, Empty, Empty) } diff --git a/repos/framework/core/util/src/main/scala/net/liftweb/util/ListHelpers.scala b/repos/framework/core/util/src/main/scala/net/liftweb/util/ListHelpers.scala index c0174d69973..fa97b64a4e1 100644 --- a/repos/framework/core/util/src/main/scala/net/liftweb/util/ListHelpers.scala +++ b/repos/framework/core/util/src/main/scala/net/liftweb/util/ListHelpers.scala @@ -226,7 +226,7 @@ trait ListHelpers { (x: @unchecked) match { case x :: xs => permuteList(xs).map(x :: _) case _ => Nil - }) + }) } /** @@ -245,7 +245,7 @@ trait ListHelpers { val ret = rot.flatMap(z => (z: @unchecked) match { case x :: xs => permuteList(xs).map(x :: _) - }) + }) ret ::: rot .map(z => (z: @unchecked) match { case x :: xs => xs }) .flatMap(internal(_)) diff --git a/repos/framework/core/util/src/main/scala/net/liftweb/util/RE.scala b/repos/framework/core/util/src/main/scala/net/liftweb/util/RE.scala index ef5bf0c7697..9242f5433ed 100644 --- a/repos/framework/core/util/src/main/scala/net/liftweb/util/RE.scala +++ b/repos/framework/core/util/src/main/scala/net/liftweb/util/RE.scala @@ -148,7 +148,10 @@ class REMatcher(val str: String, val compiled: Pattern) { } } - if (!matcher.find) return else { runIt(0); doIt } + if (!matcher.find) return + else { + runIt(0); doIt + } } doIt diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala index bad2be93df5..a545edfb527 100644 --- a/repos/framework/core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala +++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/CombParserHelpersSpec.scala @@ -58,7 +58,7 @@ object CombParserHelpersSpec extends Specification with ScalaCheck { val whiteSpaceParse = (s: String) => whiteSpace(s) must beLike { case Success(x, y) => x.toString must_== "()" - } + } forAll(whiteSpaceParse) } "provide an acceptCI parser to parse whatever string matching another string ignoring case" in { @@ -68,7 +68,7 @@ object CombParserHelpersSpec extends Specification with ScalaCheck { acceptCI(s).apply(s2) match { case Success(x, y) => s2.toUpperCase must startWith(s.toUpperCase) case _ => true - } + } forAll(ignoreCaseStringParse) } @@ -77,7 +77,7 @@ object CombParserHelpersSpec extends Specification with ScalaCheck { digit(s) match { case Success(x, y) => s must beMatching("(?s)\\p{Nd}.*") case _ => true - } + } forAll(isDigit) } "provide an aNumber parser - returning an Int if succeeding" in { diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/ListHelpersSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/ListHelpersSpec.scala index 857ae1589c3..f409d70b86d 100644 --- a/repos/framework/core/util/src/test/scala/net/liftweb/util/ListHelpersSpec.scala +++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/ListHelpersSpec.scala @@ -87,7 +87,7 @@ object ListHelpersSpec extends Specification with ListHelpers { i >= 2 match { case true => Full(3) case false => Empty - } + } first(List(1, 2, 3))(f) must_== Full(3) } } diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/StringHelpersSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/StringHelpersSpec.scala index b28adada0c4..35f44a4866e 100644 --- a/repos/framework/core/util/src/test/scala/net/liftweb/util/StringHelpersSpec.scala +++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/StringHelpersSpec.scala @@ -70,19 +70,20 @@ object StringHelpersSpec extends Specification with ScalaCheck with StringGen { camelify(name).charAt(correspondingIndexInCamelCase(name, i)) val doesntContainUnderscores = forAll(underscoredStrings) { - ((name: String) => !camelify(name).contains("_")) + ((name: String) => + !camelify(name).contains("_")) } val isCamelCased = forAll(underscoredStrings)((name: String) => { name.forall(_ == '_') && camelify(name).isEmpty || - name.toList.zipWithIndex.forall { - case (c, i) => - c == '_' || correspondingIndexInCamelCase(name, i) == 0 && - correspondingCharInCamelCase(name, i) == c.toUpper || - !previousCharacterIsUnderscore(name, i) && - correspondingCharInCamelCase(name, i) == c || - previousCharacterIsUnderscore(name, i) && - correspondingCharInCamelCase(name, i) == c.toUpper - } + name.toList.zipWithIndex.forall { + case (c, i) => + c == '_' || correspondingIndexInCamelCase(name, i) == 0 && + correspondingCharInCamelCase(name, i) == c.toUpper || + !previousCharacterIsUnderscore(name, i) && + correspondingCharInCamelCase(name, i) == c || + previousCharacterIsUnderscore(name, i) && + correspondingCharInCamelCase(name, i) == c.toUpper + } }) (doesntContainUnderscores && isCamelCased) } diff --git a/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala b/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala index 31d66ead25a..7f8070edb46 100644 --- a/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala +++ b/repos/framework/core/util/src/test/scala/net/liftweb/util/XmlParserSpec.scala @@ -48,8 +48,8 @@ object XmlParserSpec extends Specification with XmlMatchers { "XML can contain PCData" in { val data = { - PCData("Hello Yak") - } + PCData("Hello Yak") + } val str = AltXML.toXML(data, false, true) @@ -58,8 +58,8 @@ object XmlParserSpec extends Specification with XmlMatchers { "XML can contain Unparsed" in { val data = { - Unparsed("Hello & goodbye > + Unparsed("Hello & goodbye > val str = AltXML.toXML(data, false, true) @@ -69,14 +69,14 @@ object XmlParserSpec extends Specification with XmlMatchers { "XML cannot contain Control characters" in { val data = { - '\u0085' - }{ - Text("hello \u0000 \u0085 \u0080") - }{ - "hello \u0000 \u0003 \u0085 \u0080" - }{ - '\u0003' - } + '\u0085' + }{ + Text("hello \u0000 \u0085 \u0080") + }{ + "hello \u0000 \u0003 \u0085 \u0080" + }{ + '\u0003' + } val str = AltXML.toXML(data, false, true) diff --git a/repos/framework/persistence/db/src/main/scala/net/liftweb/db/DB.scala b/repos/framework/persistence/db/src/main/scala/net/liftweb/db/DB.scala index 3c6d8b9364e..19732a589db 100644 --- a/repos/framework/persistence/db/src/main/scala/net/liftweb/db/DB.scala +++ b/repos/framework/persistence/db/src/main/scala/net/liftweb/db/DB.scala @@ -603,7 +603,7 @@ trait DB extends Loggable { use(connectionIdentifier)(conn => prepareStatement(query, conn) { ps => resultSetTo(setPreparedParams(ps, params).executeQuery) - }) + }) } /** @@ -631,7 +631,7 @@ trait DB extends Loggable { use(connectionIdentifier)(conn => prepareStatement(query, conn) { ps => resultSetToAny(setPreparedParams(ps, params).executeQuery) - }) + }) } /** @@ -656,7 +656,7 @@ trait DB extends Loggable { use(connectionIdentifier)(conn => prepareStatement(query, conn) { ps => setPreparedParams(ps, params).executeUpdate - }) + }) } def runQuery(query: String): (List[String], List[List[String]]) = diff --git a/repos/framework/persistence/db/src/test/scala/net/liftweb/db/DBSpec.scala b/repos/framework/persistence/db/src/test/scala/net/liftweb/db/DBSpec.scala index 19536db4b3f..8b78640bc66 100644 --- a/repos/framework/persistence/db/src/test/scala/net/liftweb/db/DBSpec.scala +++ b/repos/framework/persistence/db/src/test/scala/net/liftweb/db/DBSpec.scala @@ -54,7 +54,7 @@ class DBSpec extends Specification with Mockito { DB.appendPostTransaction(DefaultConnectionIdentifier, m.f _) DB.currentConnection.map { c => DB.exec(c, "stuff") { dummy => - } + } } } there was one(activeConnection).commit @@ -74,7 +74,7 @@ class DBSpec extends Specification with Mockito { DB.appendPostTransaction(DefaultConnectionIdentifier, m.f _) DB.currentConnection.map { c => DB.exec(c, "stuff") { dummy => - } + } } throw new RuntimeException("oh no") 42 @@ -96,11 +96,11 @@ class DBSpec extends Specification with Mockito { DB.use(DefaultConnectionIdentifier) { c => DB.appendPostTransaction(DefaultConnectionIdentifier, m.f _) DB.exec(c, "stuff") { dummy => - } + } } DB.use(DefaultConnectionIdentifier) { c => DB.exec(c, "more stuff") { dummy => - } + } } } there was one(activeConnection).commit @@ -119,7 +119,7 @@ class DBSpec extends Specification with Mockito { tryo(lw.apply { DB.use(DefaultConnectionIdentifier) { c => DB.exec(c, "more stuff") { dummy => - } + } } DB.use(DefaultConnectionIdentifier) { c => DB.appendPostTransaction(m.f _) @@ -145,7 +145,7 @@ class DBSpec extends Specification with Mockito { DB.use(DefaultConnectionIdentifier) { c => DB.appendPostTransaction(DefaultConnectionIdentifier, m.f _) DB.exec(c, "stuff") { dummy => - } + } } there was one(activeConnection).commit diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala index 1271eac6bee..9226e8643d1 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/AjaxMapper.scala @@ -30,7 +30,9 @@ trait AjaxEditableField[FieldType, OwnerType <: Mapper[OwnerType]] if (editableField) { { toForm.map { form => - SHtml.ajaxEditable(super.asHtml, form, () => {fieldOwner.save; onSave; net.liftweb.http.js.JsCmds.Noop}) + SHtml.ajaxEditable(super.asHtml, form, () => { + fieldOwner.save; onSave; net.liftweb.http.js.JsCmds.Noop + }) } openOr super.asHtml } } else { diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedBinary.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedBinary.scala index aa10f748edb..206a5989f53 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedBinary.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedBinary.scala @@ -148,7 +148,7 @@ abstract class MappedBinary[T <: Mapper[T]](val fieldOwner: T) f.data() = toSet f.orgData() = toSet } - ) + ) def buildSetLongValue( accessor: Method, @@ -302,7 +302,7 @@ abstract class MappedText[T <: Mapper[T]](val fieldOwner: T) f.data() = toSet f.orgData() = toSet } - ) + ) def buildSetLongValue( accessor: Method, @@ -465,7 +465,7 @@ abstract class MappedFakeClob[T <: Mapper[T]](val fieldOwner: T) f.data() = toSet f.orgData() = toSet } - ) + ) def buildSetLongValue( accessor: Method, diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala index 0c2cf8e4fe0..d82d03be156 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDate.scala @@ -157,7 +157,12 @@ abstract class MappedDate[T <: Mapper[T]](val fieldOwner: T) }) { funcName => Full(appendFieldId( "" case s => format(s)}}/>)) + value={ + get match { + case null => "" + case s => format(s) + } + }/>)) } override def setFromAny(f: Any): Date = f match { diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala index 929b240333a..e79d31bdde2 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedDateTime.scala @@ -150,7 +150,12 @@ abstract class MappedDateTime[T <: Mapper[T]](val fieldOwner: T) }) { funcName => Full(appendFieldId( "" case s => format(s)}}/>)) + value={ + get match { + case null => "" + case s => format(s) + } + }/>)) } override def setFromAny(f: Any): Date = f match { diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala index 0a5cce7f4f2..3add1753206 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedField.scala @@ -254,12 +254,14 @@ trait MappedNullableField[ }) { funcName => Full(appendFieldId( "" - case Full(null) => "" - case Full(s) => s.toString - case _ => "" - }}/>)) + value={ + get match { + case null => "" + case Full(null) => "" + case Full(s) => s.toString + case _ => "" + } + }/>)) } } @@ -487,7 +489,12 @@ trait MappedField[FieldType <: Any, OwnerType <: Mapper[OwnerType]] }) { funcName => Full(appendFieldId( "" case s => s.toString}}/>)) + value={ + get match { + case null => "" + case s => s.toString + } + }/>)) } /** diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala index 927211b92e0..cc50958deee 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedString.scala @@ -160,7 +160,12 @@ abstract class MappedString[T <: Mapper[T]](val fieldOwner: T, val maxLen: Int) }) { name => Full(appendFieldId( "" case s => s.toString}}/>)) + value={ + get match { + case null => "" + case s => s.toString + } + }/>)) } protected def i_obscure_!(in: String): String = { diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala index 1d6d2fa8152..d00af0e1e93 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTextarea.scala @@ -36,9 +36,11 @@ abstract class MappedTextarea[T <: Mapper[T]](owner: T, maxLen: Int) Full(appendFieldId()) + get match { + case null => "" + case s => s + } + })) } } diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala index ced81377555..8e0f4d3786c 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MappedTime.scala @@ -157,7 +157,12 @@ abstract class MappedTime[T <: Mapper[T]](val fieldOwner: T) }) { funcName => Full(appendFieldId( "" case s => format(s)}}/>)) + value={ + get match { + case null => "" + case s => format(s) + } + }/>)) } override def setFromAny(f: Any): Date = f match { diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala index 32d85afc37e..410a1bf9cee 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala @@ -495,7 +495,11 @@ trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A] { var wav = whereAdded - def whereOrAnd = if (wav) " AND " else { wav = true; " WHERE " } + def whereOrAnd = + if (wav) " AND " + else { + wav = true; " WHERE " + } class DBFuncWrapper(dbFunc: Box[String]) { def apply(field: String) = dbFunc match { @@ -551,7 +555,7 @@ trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A] { .map( v => MapperRules.quoteColumnName.vend(field._dbColumnNameLC) + - " = ?") + " = ?") .mkString(whereOrAnd + " (", " OR ", ")") case in: InRaw[A, _] => @@ -754,7 +758,7 @@ trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A] { } _afterDelete(toDelete) ret - }) + }) .openOr(false) } @@ -1350,7 +1354,7 @@ trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A] { ??(f.method, in) match { case field if (field.i_name_! eq null) => field.setName_!(f.name) case _ => - }) + }) } /** @@ -1717,7 +1721,7 @@ trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A] { e._2.invoke(what) match { case lccb: LifecycleCallbacks => f(lccb) case _ => - }) + }) toRun.foreach { tf => tf(what) } @@ -2552,7 +2556,7 @@ trait KeyedMetaMapper[Type, A <: KeyedMapper[Type, A]] obj match { case Full(obj) => true case _ => false - }) match { + }) match { case obj :: _ => obj case _ => Empty } diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala index f3edea64985..6ce175eecfa 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/ProtoUser.scala @@ -177,7 +177,7 @@ trait ProtoUser[T <: ProtoUser[T]] case _ => email.get } - def niceNameWEmailLink = {niceName} + def niceNameWEmailLink = {niceName} } /** diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Schemifier.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Schemifier.scala index d7293df0fa1..69ad254e613 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Schemifier.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/Schemifier.scala @@ -378,7 +378,7 @@ object Schemifier extends Loggable { logger.trace( "Column exists: %s.%s ".format(table.dbTableName, columnName)) } - }) + }) // FIXME deal with column types (field .dbColumnNames(field.name) @@ -541,7 +541,7 @@ object Schemifier extends Loggable { foundIt = (field._dbColumnNameLC.toLowerCase == fkName.toLowerCase && field.dbKeyToColumn._dbColumnNameLC.toLowerCase == pkName.toLowerCase) - }) + }) if (!foundIt) { cmds += maybeWrite(performWrite, logFunc, connection) { () => diff --git a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala index 02f3e4a1641..d853f81a0b8 100644 --- a/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala +++ b/repos/framework/persistence/mapper/src/main/scala/net/liftweb/mapper/view/TableEditor.scala @@ -172,14 +172,12 @@ trait ItemsList[T <: Mapper[T]] { } def sortFn(field: MappedField[_, T]) = (sortField, ascending) match { case (Some(f), true) if f eq field => - () => - ascending = false + () => ascending = false case _ | null => - () => - { - sortField = Some(field) - ascending = true - } + () => { + sortField = Some(field) + ascending = true + } } reload @@ -271,7 +269,9 @@ trait ItemsListEditor[T <: Mapper[T]] { def customBind(item: T): NodeSeq => NodeSeq = (ns: NodeSeq) => ns def edit: (NodeSeq) => NodeSeq = { - def unsavedScript = ({Script(Run(""" + def unsavedScript = + ({ + Script(Run(""" var safeToContinue = false window.onbeforeunload = function(evt) {{ // thanks Tim! if(!safeToContinue) {{ @@ -281,7 +281,8 @@ trait ItemsListEditor[T <: Mapper[T]] { return reply; }} }} - """))}) + """)) + }) val noPrompt = "onclick" -> "safeToContinue=true" val optScript = if ((items.added.length + items.removed.length == 0) && diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/MongoMetaRecord.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/MongoMetaRecord.scala index 047672c6683..a1b67063cd3 100644 --- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/MongoMetaRecord.scala +++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/MongoMetaRecord.scala @@ -91,7 +91,7 @@ trait MongoMetaRecord[BaseRecord <: MongoRecord[BaseRecord]] coll.findOne(qry) match { case null => Empty case dbo => Full(fromDBObject(dbo)) - }) + }) } /** @@ -385,7 +385,7 @@ trait MongoMetaRecord[BaseRecord <: MongoRecord[BaseRecord]] pair._2 match { case Empty => true case _ => false - } + } ) .map(_._1) diff --git a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoListField.scala b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoListField.scala index 6b1581e22fe..c8e5c26c5c2 100644 --- a/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoListField.scala +++ b/repos/framework/persistence/mongodb-record/src/main/scala/net/liftweb/mongodb/record/field/MongoListField.scala @@ -143,7 +143,7 @@ class MongoListField[OwnerType <: BsonRecord[OwnerType], ListType: Manifest]( case x if datetype_?(x.getClass) => datetype2jvalue(x)(owner.meta.formats) case _ => JNothing - })) + })) /* * Convert this field's value into a DBObject so it can be stored in Mongo. diff --git a/repos/framework/persistence/mongodb/src/main/scala/net/liftweb/mongodb/MongoDocument.scala b/repos/framework/persistence/mongodb/src/main/scala/net/liftweb/mongodb/MongoDocument.scala index 89bda8315e0..385bede559d 100644 --- a/repos/framework/persistence/mongodb/src/main/scala/net/liftweb/mongodb/MongoDocument.scala +++ b/repos/framework/persistence/mongodb/src/main/scala/net/liftweb/mongodb/MongoDocument.scala @@ -85,7 +85,7 @@ trait MongoDocumentMeta[BaseDocument] case dbo => { Some(create(dbo)) } - }) + }) } /** diff --git a/repos/framework/persistence/mongodb/src/test/scala/net/liftweb/mongodb/MongoDocumentExamplesSpec.scala b/repos/framework/persistence/mongodb/src/test/scala/net/liftweb/mongodb/MongoDocumentExamplesSpec.scala index e489412a853..a21fa3faf36 100644 --- a/repos/framework/persistence/mongodb/src/test/scala/net/liftweb/mongodb/MongoDocumentExamplesSpec.scala +++ b/repos/framework/persistence/mongodb/src/test/scala/net/liftweb/mongodb/MongoDocumentExamplesSpec.scala @@ -591,7 +591,7 @@ class MongoDocumentExamplesSpec extends Specification with MongoTestKit { 2147483647, 2147483648L, 1797693, - 3.4028235F, + 3.4028235f, 1000, 0, true, diff --git a/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala b/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala index f7d04bc6048..fd9150990b9 100644 --- a/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala +++ b/repos/framework/persistence/proto/src/main/scala/net/liftweb/proto/Crudify.scala @@ -676,9 +676,11 @@ trait Crudify { if (first < rowsPerPage) { ClearNodes } else { - "^ <*>" #> " #> " #> + "^ <*>" #> {niceName} + {niceName} } /** @@ -688,7 +688,7 @@ trait ProtoUser { def signupXhtml(user: TheUserType) = { (
    + colspan="2">{S.?("sign.up")} {localForm(user, false, signupFields)}
    { S.?("sign.up") }
     
    ) diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala index 5af113ed851..a0af0f13179 100644 --- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala +++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/Field.scala @@ -490,9 +490,9 @@ trait DisplayWithLabel[OwnerType <: Record[OwnerType]] extends OwnedField[OwnerType] { override abstract def toForm: Box[NodeSeq] = for (id <- uniqueFieldId; control <- super.toForm) - yield
    -
    - { control } + yield
    +
    + {control}
    } diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala index d397796c1b2..c88f4555cb7 100644 --- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala +++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/MetaRecord.scala @@ -367,7 +367,7 @@ trait MetaRecord[BaseRecord <: Record[BaseRecord]] { self: BaseRecord => child = toForm(inst, elem.child.flatMap(n => toForm(inst, n)))) case x => x - }) + }) } } @@ -416,8 +416,7 @@ trait MetaRecord[BaseRecord <: Record[BaseRecord]] { self: BaseRecord => def apply(r: Req): () => Box[LiftResponse] = { val rec = fromReq(r) - () => - func(r)(rec) + () => func(r)(rec) } } diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala index d957763033e..3e3199418b0 100644 --- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala +++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/ProtoUser.scala @@ -173,7 +173,7 @@ trait ProtoUser[T <: ProtoUser[T]] extends Record[T] { self: T => case _ => email.get } - def niceNameWEmailLink = {niceName} + def niceNameWEmailLink = {niceName} } /** diff --git a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala index 8d5688b349c..66a370f7c35 100644 --- a/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala +++ b/repos/framework/persistence/record/src/main/scala/net/liftweb/record/field/NumericField.scala @@ -43,7 +43,9 @@ trait NumericTypedField[MyType] extends TypedField[MyType] { private def elem = S.fmapFunc((s: List[String]) => setFromAny(s)) { funcName => - + } /** diff --git a/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala b/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala index bebc99d39fd..49392eda03c 100644 --- a/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala +++ b/repos/framework/persistence/record/src/test/scala/net/liftweb/record/FieldSpec.scala @@ -372,7 +372,9 @@ object FieldSpec extends Specification { Str(country.toString), JInt(country.id), Full( - ) + ) ) } } @@ -411,8 +413,9 @@ object FieldSpec extends Specification { rec.customFormatDateTimeField, Str(dtStr), JString(dtStr), - Full( - ) + Full() ) } @@ -477,8 +480,9 @@ object FieldSpec extends Specification { rec.mandatoryEmailField, Str(email), JString(email), - Full( - ) + Full() ) "pass validation if field is optional and value is Empty" in { S.initIfUninitted(session) { @@ -522,7 +526,9 @@ object FieldSpec extends Specification { Str(ev.toString), JInt(ev.id), Full( - ) + ) ) } @@ -696,8 +702,9 @@ object FieldSpec extends Specification { rec.mandatoryStringField, Str(str), JString(str), - Full( - ) + Full() ) } @@ -791,7 +798,9 @@ object FieldSpec extends Specification { Str(txt), JString(txt), Full( - ) + ) ) } @@ -817,7 +826,9 @@ object FieldSpec extends Specification { Str(example), JString(example), Full( - ) + ) ) } diff --git a/repos/framework/persistence/squeryl-record/src/main/scala/net/liftweb/squerylrecord/RecordMetaDataFactory.scala b/repos/framework/persistence/squeryl-record/src/main/scala/net/liftweb/squerylrecord/RecordMetaDataFactory.scala index 43e5b9da8a7..ee9d1046f54 100644 --- a/repos/framework/persistence/squeryl-record/src/main/scala/net/liftweb/squerylrecord/RecordMetaDataFactory.scala +++ b/repos/framework/persistence/squeryl-record/src/main/scala/net/liftweb/squerylrecord/RecordMetaDataFactory.scala @@ -240,8 +240,7 @@ class RecordMetaDataFactory extends FieldMetaDataFactory { .get(null) .asInstanceOf[MetaRecord[_]] - () => - metaRecord.createRecord.asInstanceOf[AnyRef] + () => metaRecord.createRecord.asInstanceOf[AnyRef] } /** diff --git a/repos/framework/persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/SquerylRecordSpec.scala b/repos/framework/persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/SquerylRecordSpec.scala index 70fecf8fad4..f02b3bfe1af 100644 --- a/repos/framework/persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/SquerylRecordSpec.scala +++ b/repos/framework/persistence/squeryl-record/src/test/scala/net/liftweb/squerylrecord/SquerylRecordSpec.scala @@ -332,7 +332,7 @@ class SquerylRecordSpec extends Specification with AroundExample { bridge.save val id = company.id company.isPersisted must_== true - id must be_>(0l) + id must be_>(0L) company.postCode("10001") bridge.save val company2 = Company.findForParam(id.toString) diff --git a/repos/framework/project/Developers.scala b/repos/framework/project/Developers.scala index 354e0edebc3..d912c2a7a3b 100644 --- a/repos/framework/project/Developers.scala +++ b/repos/framework/project/Developers.scala @@ -51,12 +51,14 @@ object Developers { def toXml = - {members map { m => + { + members map { m => {m._1} {m._2} http://github.com/{m._1} - }} + } + } } diff --git a/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestFramework.scala b/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestFramework.scala index 66f11fbe5dc..f2cda5c86a0 100644 --- a/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestFramework.scala +++ b/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestFramework.scala @@ -936,7 +936,10 @@ abstract class BaseResponse( } yield new String(b, "UTF-8") def !@(msg: => String)(implicit errorFunc: ReportFailure): SelfType = - if (code == 200) this.asInstanceOf[SelfType] else { errorFunc.fail(msg) } + if (code == 200) this.asInstanceOf[SelfType] + else { + errorFunc.fail(msg) + } def !(msg: => String)(implicit errorFunc: ReportFailure): SelfType = this.asInstanceOf[SelfType] diff --git a/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestRunner.scala b/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestRunner.scala index f0bee68914c..e980fcbd062 100644 --- a/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestRunner.scala +++ b/repos/framework/web/testkit/src/main/scala/net/liftweb/http/testing/TestRunner.scala @@ -230,10 +230,9 @@ class Item( (func, forkFunc) match { case (Full(f), _) => f case (_, Full(cf)) => - () => - cf(cnt) + () => cf(cnt) case _ => () => - } + } } } diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala index d1ca39b2ac5..2920a42cf3f 100644 --- a/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala +++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/builtin/snippet/CSS.scala @@ -27,11 +27,9 @@ import scala.xml._ object CSS extends DispatchSnippet { def dispatch: DispatchIt = { case "blueprint" => - _ => - blueprint + _ => blueprint case "fancyType" => - _ => - fancyType + _ => fancyType } /** @@ -46,11 +44,15 @@ object CSS extends DispatchSnippet { */ def blueprint: NodeSeq = { - - + ++ Unparsed( """ " + (if (display5 ne null) display5.map(x=> if (x eq null) "." else x + "->" +x.asInstanceOf[Array[AnyRef]].mkString("")).mkString(" ") else "null")) //println("DISPLAY 4: " + display4 + " ---> " + (if (display4 ne null) display4.map(x=> if (x eq null) "." else x + "->" +x.asInstanceOf[Array[AnyRef]].mkString("")).mkString(" ") else "null")) //println("DISPLAY 3: " + display3 + " ---> " + (if (display3 ne null) display3.map(x=> if (x eq null) "." else x + "->" +x.asInstanceOf[Array[AnyRef]].mkString("")).mkString(" ") else "null")) diff --git a/repos/scala/src/library/scala/collection/mutable/DefaultMapModel.scala b/repos/scala/src/library/scala/collection/mutable/DefaultMapModel.scala index cc1ac644032..1c39a90ba03 100644 --- a/repos/scala/src/library/scala/collection/mutable/DefaultMapModel.scala +++ b/repos/scala/src/library/scala/collection/mutable/DefaultMapModel.scala @@ -34,7 +34,9 @@ trait DefaultMapModel[A, B] extends Map[A, B] { override def put(key: A, value: B): Option[B] = { val e = findEntry(key) - if (e == null) { addEntry(new Entry(key, value)); None } else { + if (e == null) { + addEntry(new Entry(key, value)); None + } else { val v = e.value; e.value = value; Some(v) } } diff --git a/repos/scala/src/library/scala/collection/mutable/FlatHashTable.scala b/repos/scala/src/library/scala/collection/mutable/FlatHashTable.scala index f1285a2c710..66d89600a04 100644 --- a/repos/scala/src/library/scala/collection/mutable/FlatHashTable.scala +++ b/repos/scala/src/library/scala/collection/mutable/FlatHashTable.scala @@ -212,7 +212,9 @@ trait FlatHashTable[A] extends FlatHashTable.HashUtils[A] { i < table.length } def next(): A = - if (hasNext) { i += 1; entryToElem(table(i - 1)) } else + if (hasNext) { + i += 1; entryToElem(table(i - 1)) + } else Iterator.empty.next() } diff --git a/repos/scala/src/library/scala/collection/mutable/HashMap.scala b/repos/scala/src/library/scala/collection/mutable/HashMap.scala index 6ef2bebc3d6..802e85f1c72 100644 --- a/repos/scala/src/library/scala/collection/mutable/HashMap.scala +++ b/repos/scala/src/library/scala/collection/mutable/HashMap.scala @@ -75,7 +75,9 @@ class HashMap[A, B] private[collection] ( override def put(key: A, value: B): Option[B] = { val e = findOrAddEntry(key, value) if (e eq null) None - else { val v = e.value; e.value = value; Some(v) } + else { + val v = e.value; e.value = value; Some(v) + } } override def update(key: A, value: B): Unit = put(key, value) diff --git a/repos/scala/src/library/scala/collection/mutable/HashTable.scala b/repos/scala/src/library/scala/collection/mutable/HashTable.scala index 1703a7339fe..20cdb11e898 100644 --- a/repos/scala/src/library/scala/collection/mutable/HashTable.scala +++ b/repos/scala/src/library/scala/collection/mutable/HashTable.scala @@ -170,7 +170,10 @@ trait HashTable[A, Entry >: Null <: HashEntry[A, Entry]] protected def findOrAddEntry[B](key: A, value: B): Entry = { val h = index(elemHashCode(key)) val e = findEntry0(key, h) - if (e ne null) e else { addEntry0(createNewEntry(key, value), h); null } + if (e ne null) e + else { + addEntry0(createNewEntry(key, value), h); null + } } /** Creates new entry to be immediately inserted into the hashtable. diff --git a/repos/scala/src/library/scala/collection/mutable/LinkedHashMap.scala b/repos/scala/src/library/scala/collection/mutable/LinkedHashMap.scala index abc95c90406..bf9a5584cb9 100644 --- a/repos/scala/src/library/scala/collection/mutable/LinkedHashMap.scala +++ b/repos/scala/src/library/scala/collection/mutable/LinkedHashMap.scala @@ -70,7 +70,9 @@ class LinkedHashMap[A, B] override def put(key: A, value: B): Option[B] = { val e = findOrAddEntry(key, value) if (e eq null) None - else { val v = e.value; e.value = value; Some(v) } + else { + val v = e.value; e.value = value; Some(v) + } } override def remove(key: A): Option[B] = { @@ -99,7 +101,9 @@ class LinkedHashMap[A, B] private var cur = firstEntry def hasNext = cur ne null def next = - if (hasNext) { val res = (cur.key, cur.value); cur = cur.later; res } else + if (hasNext) { + val res = (cur.key, cur.value); cur = cur.later; res + } else Iterator.empty.next() } @@ -127,7 +131,9 @@ class LinkedHashMap[A, B] private var cur = firstEntry def hasNext = cur ne null def next = - if (hasNext) { val res = cur.key; cur = cur.later; res } else + if (hasNext) { + val res = cur.key; cur = cur.later; res + } else Iterator.empty.next() } @@ -135,7 +141,9 @@ class LinkedHashMap[A, B] private var cur = firstEntry def hasNext = cur ne null def next = - if (hasNext) { val res = cur.value; cur = cur.later; res } else + if (hasNext) { + val res = cur.value; cur = cur.later; res + } else Iterator.empty.next() } @@ -158,7 +166,9 @@ class LinkedHashMap[A, B] protected def createNewEntry[B1](key: A, value: B1): Entry = { val e = new Entry(key, value.asInstanceOf[B]) if (firstEntry eq null) firstEntry = e - else { lastEntry.later = e; e.earlier = lastEntry } + else { + lastEntry.later = e; e.earlier = lastEntry + } lastEntry = e e } diff --git a/repos/scala/src/library/scala/collection/mutable/LinkedHashSet.scala b/repos/scala/src/library/scala/collection/mutable/LinkedHashSet.scala index aa28538880c..ba4c045d8c7 100644 --- a/repos/scala/src/library/scala/collection/mutable/LinkedHashSet.scala +++ b/repos/scala/src/library/scala/collection/mutable/LinkedHashSet.scala @@ -84,7 +84,9 @@ class LinkedHashSet[A] private var cur = firstEntry def hasNext = cur ne null def next = - if (hasNext) { val res = cur.key; cur = cur.later; res } else + if (hasNext) { + val res = cur.key; cur = cur.later; res + } else Iterator.empty.next() } @@ -107,7 +109,9 @@ class LinkedHashSet[A] protected def createNewEntry[B](key: A, dummy: B): Entry = { val e = new Entry(key) if (firstEntry eq null) firstEntry = e - else { lastEntry.later = e; e.earlier = lastEntry } + else { + lastEntry.later = e; e.earlier = lastEntry + } lastEntry = e e } diff --git a/repos/scala/src/library/scala/collection/mutable/LinkedListLike.scala b/repos/scala/src/library/scala/collection/mutable/LinkedListLike.scala index 7fcf0d6acff..c5139484389 100644 --- a/repos/scala/src/library/scala/collection/mutable/LinkedListLike.scala +++ b/repos/scala/src/library/scala/collection/mutable/LinkedListLike.scala @@ -126,7 +126,9 @@ trait LinkedListLike[A, This <: Seq[A] with LinkedListLike[A, This]] else loop(x.next) } if (isEmpty) that - else { loop(repr); repr } + else { + loop(repr); repr + } } /** Insert linked list `that` at current position of this linked list diff --git a/repos/scala/src/library/scala/collection/mutable/ListMap.scala b/repos/scala/src/library/scala/collection/mutable/ListMap.scala index b2a3b3c5a6d..688bef1fd45 100644 --- a/repos/scala/src/library/scala/collection/mutable/ListMap.scala +++ b/repos/scala/src/library/scala/collection/mutable/ListMap.scala @@ -66,7 +66,9 @@ class ListMap[A, B] elems: List[(A, B)], acc: List[(A, B)]): List[(A, B)] = { if (elems.isEmpty) acc - else if (elems.head._1 == key) { siz -= 1; acc ::: elems.tail } else + else if (elems.head._1 == key) { + siz -= 1; acc ::: elems.tail + } else remove(key, elems.tail, elems.head :: acc) } diff --git a/repos/scala/src/library/scala/collection/mutable/LongMap.scala b/repos/scala/src/library/scala/collection/mutable/LongMap.scala index 1fc9f540e6a..f62285b2e61 100644 --- a/repos/scala/src/library/scala/collection/mutable/LongMap.scala +++ b/repos/scala/src/library/scala/collection/mutable/LongMap.scala @@ -94,7 +94,7 @@ final class LongMap[V] private[collection] ( private def toIndex(k: Long): Int = { // Part of the MurmurHash3 32 bit finalizer - val h = ((k ^ (k >>> 32)) & 0xFFFFFFFFL).toInt + val h = ((k ^ (k >>> 32)) & 0XFFFFFFFFL).toInt val x = (h ^ (h >>> 16)) * 0x85EBCA6B (x ^ (x >>> 13)) & mask } diff --git a/repos/scala/src/library/scala/collection/mutable/OpenHashMap.scala b/repos/scala/src/library/scala/collection/mutable/OpenHashMap.scala index 55204810305..1e5a19bc66e 100644 --- a/repos/scala/src/library/scala/collection/mutable/OpenHashMap.scala +++ b/repos/scala/src/library/scala/collection/mutable/OpenHashMap.scala @@ -260,7 +260,7 @@ class OpenHashMap[Key, Value](initialSize: Int) foreachUndeletedEntry(entry => if (!f(entry.key, entry.value.get)) { entry.value = None; size -= 1; deleted += 1 - }) + }) this } diff --git a/repos/scala/src/library/scala/collection/parallel/Tasks.scala b/repos/scala/src/library/scala/collection/parallel/Tasks.scala index 03dc2a44772..bb7930033a3 100644 --- a/repos/scala/src/library/scala/collection/parallel/Tasks.scala +++ b/repos/scala/src/library/scala/collection/parallel/Tasks.scala @@ -304,12 +304,11 @@ trait ThreadPoolTasks extends Tasks { // debuglog("-----------> Executing without wait: " + task) t.start() - () => - { - t.sync() - t.body.forwardThrowable() - t.body.result - } + () => { + t.sync() + t.body.forwardThrowable() + t.body.result + } } def executeAndWaitResult[R, Tp](task: Task[R, Tp]): R = { @@ -406,12 +405,11 @@ trait ForkJoinTasks extends Tasks with HavingForkJoinPool { forkJoinPool.execute(fjtask) } - () => - { - fjtask.sync() - fjtask.body.forwardThrowable() - fjtask.body.result - } + () => { + fjtask.sync() + fjtask.body.forwardThrowable() + fjtask.body.result + } } /** Executes a task on a fork/join pool and waits for it to finish. diff --git a/repos/scala/src/library/scala/collection/parallel/mutable/ParHashMap.scala b/repos/scala/src/library/scala/collection/parallel/mutable/ParHashMap.scala index c00aa99450c..d62a32700db 100644 --- a/repos/scala/src/library/scala/collection/parallel/mutable/ParHashMap.scala +++ b/repos/scala/src/library/scala/collection/parallel/mutable/ParHashMap.scala @@ -80,7 +80,9 @@ class ParHashMap[K, V] private[collection] ( def put(key: K, value: V): Option[V] = { val e = findOrAddEntry(key, value) if (e eq null) None - else { val v = e.value; e.value = value; Some(v) } + else { + val v = e.value; e.value = value; Some(v) + } } def update(key: K, value: V): Unit = put(key, value) diff --git a/repos/scala/src/library/scala/concurrent/Future.scala b/repos/scala/src/library/scala/concurrent/Future.scala index 32cd027d7c8..ec9651bebb0 100644 --- a/repos/scala/src/library/scala/concurrent/Future.scala +++ b/repos/scala/src/library/scala/concurrent/Future.scala @@ -724,7 +724,7 @@ object Future { if (ref.decrementAndGet == 0) { result tryComplete Success(None) } - } + } futuresBuffer.foreach(_ onComplete search) diff --git a/repos/scala/src/library/scala/concurrent/impl/ExecutionContextImpl.scala b/repos/scala/src/library/scala/concurrent/impl/ExecutionContextImpl.scala index 94de479d681..78e9b7bad83 100644 --- a/repos/scala/src/library/scala/concurrent/impl/ExecutionContextImpl.scala +++ b/repos/scala/src/library/scala/concurrent/impl/ExecutionContextImpl.scala @@ -185,15 +185,18 @@ private[concurrent] object ExecutionContextImpl { extends ForkJoinTask[Unit] { final override def setRawResult(u: Unit): Unit = () final override def getRawResult(): Unit = () - final override def exec(): Boolean = try { runnable.run(); true } catch { - case anything: Throwable => - val t = Thread.currentThread - t.getUncaughtExceptionHandler match { - case null => - case some => some.uncaughtException(t, anything) - } - throw anything - } + final override def exec(): Boolean = + try { + runnable.run(); true + } catch { + case anything: Throwable => + val t = Thread.currentThread + t.getUncaughtExceptionHandler match { + case null => + case some => some.uncaughtException(t, anything) + } + throw anything + } } def fromExecutor( diff --git a/repos/scala/src/library/scala/math/BigDecimal.scala b/repos/scala/src/library/scala/math/BigDecimal.scala index 979f1cb56f4..8048d147b3a 100644 --- a/repos/scala/src/library/scala/math/BigDecimal.scala +++ b/repos/scala/src/library/scala/math/BigDecimal.scala @@ -554,7 +554,9 @@ final class BigDecimal(val bigDecimal: BigDec, val mc: MathContext) } private def noArithmeticException(body: => Unit): Boolean = { - try { body; true } catch { case _: ArithmeticException => false } + try { + body; true + } catch { case _: ArithmeticException => false } } def isWhole() = scale <= 0 || bigDecimal.stripTrailingZeros.scale <= 0 diff --git a/repos/scala/src/library/scala/sys/process/BasicIO.scala b/repos/scala/src/library/scala/sys/process/BasicIO.scala index c67420b4532..4ff579cdb35 100644 --- a/repos/scala/src/library/scala/sys/process/BasicIO.scala +++ b/repos/scala/src/library/scala/sys/process/BasicIO.scala @@ -262,7 +262,9 @@ object BasicIO { if (byteCount > 0) { out.write(buffer, 0, byteCount) // flush() will throw an exception once the process has terminated - val available = try { out.flush(); true } catch { + val available = try { + out.flush(); true + } catch { case _: IOException => false } if (available) loop() diff --git a/repos/scala/src/library/scala/sys/process/ProcessImpl.scala b/repos/scala/src/library/scala/sys/process/ProcessImpl.scala index 213d1d725aa..653129d3314 100644 --- a/repos/scala/src/library/scala/sys/process/ProcessImpl.scala +++ b/repos/scala/src/library/scala/sys/process/ProcessImpl.scala @@ -42,7 +42,7 @@ private[process] trait ProcessImpl { self: Process.type => result.get match { case Right(value) => value case Left(exception) => throw exception - }) + }) } } diff --git a/repos/scala/src/library/scala/text/Document.scala b/repos/scala/src/library/scala/text/Document.scala index 10392cb5ae4..0eb5d15691e 100644 --- a/repos/scala/src/library/scala/text/Document.scala +++ b/repos/scala/src/library/scala/text/Document.scala @@ -68,10 +68,18 @@ abstract class Document { def spaces(n: Int) { var rem = n while (rem >= 16) { writer write " "; rem -= 16 } - if (rem >= 8) { writer write " "; rem -= 8 } - if (rem >= 4) { writer write " "; rem -= 4 } - if (rem >= 2) { writer write " "; rem -= 2 } - if (rem == 1) { writer write " " } + if (rem >= 8) { + writer write " "; rem -= 8 + } + if (rem >= 4) { + writer write " "; rem -= 4 + } + if (rem >= 2) { + writer write " "; rem -= 2 + } + if (rem == 1) { + writer write " " + } } def fmt(k: Int, state: List[FmtState]): Unit = state match { diff --git a/repos/scala/src/library/scala/util/Properties.scala b/repos/scala/src/library/scala/util/Properties.scala index 566b6524926..ac5ca9e70c3 100644 --- a/repos/scala/src/library/scala/util/Properties.scala +++ b/repos/scala/src/library/scala/util/Properties.scala @@ -40,8 +40,12 @@ private[scala] trait PropertiesTrait { } private def quietlyDispose(action: => Unit, disposal: => Unit) = - try { action } finally { - try { disposal } catch { case _: IOException => } + try { + action + } finally { + try { + disposal + } catch { case _: IOException => } } def propIsSet(name: String) = System.getProperty(name) != null diff --git a/repos/scala/src/library/scala/util/Sorting.scala b/repos/scala/src/library/scala/util/Sorting.scala index 77d2a9bdce6..e3ead207f59 100644 --- a/repos/scala/src/library/scala/util/Sorting.scala +++ b/repos/scala/src/library/scala/util/Sorting.scala @@ -70,7 +70,9 @@ object Sorting { else iK val pivot = a(pL) // pL is the start of the pivot block; move it into the middle if needed - if (pL != iK) { a(pL) = a(iK); a(iK) = pivot; pL = iK } + if (pL != iK) { + a(pL) = a(iK); a(iK) = pivot; pL = iK + } // Elements equal to the pivot will be in range pL until pR var pR = pL + 1 // Items known to be less than pivot are below iA (range i0 until iA) @@ -218,7 +220,9 @@ object Sorting { var k = i0 j = 0 while (i < iN && j < jN) { - if (ord.compare(a(i), scratch(j)) < 0) { a(k) = a(i); i += 1 } else { + if (ord.compare(a(i), scratch(j)) < 0) { + a(k) = a(i); i += 1 + } else { a(k) = scratch(j); j += 1 } k += 1 diff --git a/repos/scala/src/library/scala/util/Try.scala b/repos/scala/src/library/scala/util/Try.scala index 6b493dd437a..c5011e3c76d 100644 --- a/repos/scala/src/library/scala/util/Try.scala +++ b/repos/scala/src/library/scala/util/Try.scala @@ -240,12 +240,16 @@ final case class Failure[+T](exception: Throwable) extends Try[T] { override def recover[U >: T]( @deprecatedName('rescueException) pf: PartialFunction[Throwable, U]) : Try[U] = - try { if (pf isDefinedAt exception) Success(pf(exception)) else this } catch { + try { + if (pf isDefinedAt exception) Success(pf(exception)) else this + } catch { case NonFatal(e) => Failure(e) } override def recoverWith[U >: T]( @deprecatedName('f) pf: PartialFunction[Throwable, Try[U]]): Try[U] = - try { if (pf isDefinedAt exception) pf(exception) else this } catch { + try { + if (pf isDefinedAt exception) pf(exception) else this + } catch { case NonFatal(e) => Failure(e) } override def failed: Try[Throwable] = Success(exception) @@ -293,5 +297,7 @@ final case class Success[+T](value: T) extends Try[T] { override def toOption: Option[T] = Some(value) override def toEither: Either[Throwable, T] = Right(value) override def fold[U](fa: Throwable => U, fb: T => U): U = - try { fb(value) } catch { case NonFatal(e) => fa(e) } + try { + fb(value) + } catch { case NonFatal(e) => fa(e) } } diff --git a/repos/scala/src/library/scala/util/hashing/package.scala b/repos/scala/src/library/scala/util/hashing/package.scala index f4f565fc74a..5fd3b1e3c95 100644 --- a/repos/scala/src/library/scala/util/hashing/package.scala +++ b/repos/scala/src/library/scala/util/hashing/package.scala @@ -23,8 +23,8 @@ package object hashing { * for 64-bit values. */ def byteswap64(v: Long): Long = { - var hc = v * 0x9e3775cd9e3775cdL + var hc = v * 0X9E3775CD9E3775CDL hc = java.lang.Long.reverseBytes(hc) - hc * 0x9e3775cd9e3775cdL + hc * 0X9E3775CD9E3775CDL } } diff --git a/repos/scala/src/manual/scala/tools/docutil/EmitManPage.scala b/repos/scala/src/manual/scala/tools/docutil/EmitManPage.scala index aa827d8dc84..9bb5b2472e1 100644 --- a/repos/scala/src/manual/scala/tools/docutil/EmitManPage.scala +++ b/repos/scala/src/manual/scala/tools/docutil/EmitManPage.scala @@ -72,7 +72,9 @@ object EmitManPage { emitText(d.term) out.println emitText(d.description) - if (n > 1) { out.println; n -= 1 } + if (n > 1) { + out.println; n -= 1 + } } case Link(label, url) => diff --git a/repos/scala/src/partest-extras/scala/tools/partest/ASMConverters.scala b/repos/scala/src/partest-extras/scala/tools/partest/ASMConverters.scala index e48c9aca341..b9095802a33 100644 --- a/repos/scala/src/partest-extras/scala/tools/partest/ASMConverters.scala +++ b/repos/scala/src/partest-extras/scala/tools/partest/ASMConverters.scala @@ -267,7 +267,9 @@ object ASMConverters { if (m contains v1) m(v1) == v2 else if (m.valuesIterator contains v2) false // v2 is already associated with some different value v1 - else { m(v1) = v2; true } + else { + m(v1) = v2; true + } } def sameVar(v1: Int, v2: Int) = same(v1, v2, varMap) def sameLabel(l1: Label, l2: Label) = same(l1.offset, l2.offset, labelMap) diff --git a/repos/scala/src/partest-extras/scala/tools/partest/instrumented/Instrumentation.scala b/repos/scala/src/partest-extras/scala/tools/partest/instrumented/Instrumentation.scala index 16dab6a4000..9889e6dfa61 100644 --- a/repos/scala/src/partest-extras/scala/tools/partest/instrumented/Instrumentation.scala +++ b/repos/scala/src/partest-extras/scala/tools/partest/instrumented/Instrumentation.scala @@ -83,8 +83,8 @@ object Instrumentation { val standardFilter: MethodCallTrace => Boolean = t => { // ignore all calls to Console trigger by printing t.className != "scala/Console$" && - // console accesses DynamicVariable, let's discard it too - !t.className.startsWith("scala/util/DynamicVariable") + // console accesses DynamicVariable, let's discard it too + !t.className.startsWith("scala/util/DynamicVariable") } // Used in tests. diff --git a/repos/scala/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala b/repos/scala/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala index 55002c0f3fb..2110972552b 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/ExistentialsAndSkolems.scala @@ -68,7 +68,7 @@ trait ExistentialsAndSkolems { self: SymbolTable => s.existentialBound match { case TypeBounds(lo, hi) => TypeBounds(lo, hiBound(s)) case _ => hiBound(s) - }) + }) } /** Given a set `rawSyms` of term- and type-symbols, and a type diff --git a/repos/scala/src/reflect/scala/reflect/internal/Flags.scala b/repos/scala/src/reflect/scala/reflect/internal/Flags.scala index 73021402861..1142cf717e8 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/Flags.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/Flags.scala @@ -206,11 +206,11 @@ class Flags extends ModifierFlags { // they could be used as normal flags. final val InitialFlags = - 0x0007FFFFFFFFFFFFL // normal flags, enabled from the first phase: 1L to (1L << 50) + 0X0007FFFFFFFFFFFFL // normal flags, enabled from the first phase: 1L to (1L << 50) final val LateFlags = - 0x00F8000000000000L // flags that override flags in (1L << 4) to (1L << 8): DEFERRED, FINAL, INTERFACE, METHOD, MODULE + 0X00F8000000000000L // flags that override flags in (1L << 4) to (1L << 8): DEFERRED, FINAL, INTERFACE, METHOD, MODULE final val AntiFlags = - 0x0700000000000000L // flags that cancel flags in 1L to (1L << 2): PROTECTED, OVERRIDE, PRIVATE + 0X0700000000000000L // flags that cancel flags in 1L to (1L << 2): PROTECTED, OVERRIDE, PRIVATE final val LateShift = 47 final val AntiShift = 56 @@ -477,20 +477,20 @@ class Flags extends ModifierFlags { case JAVA_DEFAULTMETHOD => "" // (1L << 47) case JAVA_ENUM => "" // (1L << 48) case JAVA_ANNOTATION => "" // (1L << 49) - case 0x4000000000000L => "" // (1L << 50) + case 0X4000000000000L => "" // (1L << 50) case `lateDEFERRED` => "" // (1L << 51) case `lateFINAL` => "" // (1L << 52) case `lateMETHOD` => "" // (1L << 53) - case 0x80000000000000L => "" // (1L << 54) + case 0X80000000000000L => "" // (1L << 54) case `lateMODULE` => "" // (1L << 55) case `notPROTECTED` => "" // (1L << 56) case `notOVERRIDE` => "" // (1L << 57) case `notPRIVATE` => "" // (1L << 58) - case 0x800000000000000L => "" // (1L << 59) - case 0x1000000000000000L => "" // (1L << 60) - case 0x2000000000000000L => "" // (1L << 61) - case 0x4000000000000000L => "" // (1L << 62) - case 0x8000000000000000L => "" // (1L << 63) + case 0X800000000000000L => "" // (1L << 59) + case 0X1000000000000000L => "" // (1L << 60) + case 0X2000000000000000L => "" // (1L << 61) + case 0X4000000000000000L => "" // (1L << 62) + case 0X8000000000000000L => "" // (1L << 63) case _ => "" } diff --git a/repos/scala/src/reflect/scala/reflect/internal/Mirrors.scala b/repos/scala/src/reflect/scala/reflect/internal/Mirrors.scala index 60692546379..14b96be2c1e 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/Mirrors.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/Mirrors.scala @@ -51,7 +51,9 @@ trait Mirrors extends api.Mirrors { thisUniverse: SymbolTable => val result = if (path.isTermName) sym.suchThat(_ hasFlag MODULE) else sym if (result != NoSymbol) result else { - if (settings.debug) { log(sym.info); log(sym.info.members) } //debug + if (settings.debug) { + log(sym.info); log(sym.info.members) + } //debug thisMirror.missingHook(owner, name) orElse { MissingRequirementError.notFound( (if (path.isTermName) "object " else "class ") + path + " in " + diff --git a/repos/scala/src/reflect/scala/reflect/internal/Phase.scala b/repos/scala/src/reflect/scala/reflect/internal/Phase.scala index d4a3a973bce..c39d47bb254 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/Phase.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/Phase.scala @@ -14,10 +14,10 @@ abstract class Phase(val prev: Phase) { val id: Id = if (prev eq null) 0 else prev.id + 1 /** New flags visible after this phase has completed */ - def nextFlags: Long = 0l + def nextFlags: Long = 0L /** New flags visible once this phase has started */ - def newFlags: Long = 0l + def newFlags: Long = 0L val fmask = (if (prev eq null) Flags.InitialFlags diff --git a/repos/scala/src/reflect/scala/reflect/internal/SymbolTable.scala b/repos/scala/src/reflect/scala/reflect/internal/SymbolTable.scala index 028e4786c8a..43a18f7a2f1 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/SymbolTable.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/SymbolTable.scala @@ -402,14 +402,13 @@ abstract class SymbolTable recordCache(new Clearable { def clear(): Unit = cached = NoCached }) - () => - { - if (currentRunId != cachedRunId || cached == NoCached) { - cached = f - cachedRunId = currentRunId - } - cached + () => { + if (currentRunId != cachedRunId || cached == NoCached) { + cached = f + cachedRunId = currentRunId } + cached + } } } diff --git a/repos/scala/src/reflect/scala/reflect/internal/Symbols.scala b/repos/scala/src/reflect/scala/reflect/internal/Symbols.scala index ca3fda9d463..86ef6574674 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/Symbols.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/Symbols.scala @@ -494,8 +494,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => private def freshNamer: () => TermName = { var cnt = 0 - () => - { cnt += 1; nme.syntheticParamName(cnt) } + () => { cnt += 1; nme.syntheticParamName(cnt) } } /** Synthetic value parameters when parameter symbols are not available. @@ -690,7 +689,9 @@ trait Symbols extends api.Symbols { self: SymbolTable => recursionTable += (this -> 1) true } - } else { handler; false } + } else { + handler; false + } } else { _rawflags |= LOCKED true @@ -1895,7 +1896,9 @@ trait Symbols extends api.Symbols { self: SymbolTable => this } def maybeInitialize = { - try { initialize; true } catch { + try { + initialize; true + } catch { case _: CyclicReference => debuglog("Hit cycle in maybeInitialize of $this"); false } diff --git a/repos/scala/src/reflect/scala/reflect/internal/Types.scala b/repos/scala/src/reflect/scala/reflect/internal/Types.scala index 5ecc7414418..a695b040739 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/Types.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/Types.scala @@ -254,7 +254,7 @@ trait Types tpe match { case tpe: PackageTypeRef => ThisType(tpe.sym) case _ => tpe - }) + }) result } def substituteSymbols(from: List[Symbol], to: List[Symbol]): Type = @@ -563,8 +563,8 @@ trait Types def dealiasWidenChain: List[Type] = this :: (if (this ne widen) widen.dealiasWidenChain - else if (this ne betaReduce) betaReduce.dealiasWidenChain - else Nil) + else if (this ne betaReduce) betaReduce.dealiasWidenChain + else Nil) /** Performs a single step of beta-reduction on types. * Given: @@ -4334,7 +4334,9 @@ trait Types final def sameLength(xs1: List[_], xs2: List[_]) = compareLengths(xs1, xs2) == 0 @tailrec final def compareLengths(xs1: List[_], xs2: List[_]): Int = - if (xs1.isEmpty) { if (xs2.isEmpty) 0 else -1 } else if (xs2.isEmpty) 1 + if (xs1.isEmpty) { + if (xs2.isEmpty) 0 else -1 + } else if (xs2.isEmpty) 1 else compareLengths(xs1.tail, xs2.tail) /** Again avoiding calling length, but the lengthCompare interface is clunky. @@ -4961,7 +4963,11 @@ trait Types /** Execute `op` while printing a trace of the operations on types executed. */ def withTypesExplained[A](op: => A): A = { val s = explainSwitch - try { explainSwitch = true; op } finally { explainSwitch = s } + try { + explainSwitch = true; op + } finally { + explainSwitch = s + } } def isUnboundedGeneric(tp: Type) = tp match { diff --git a/repos/scala/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala b/repos/scala/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala index 8afaeb28521..fd9585813cf 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala @@ -43,7 +43,7 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) { * All but the last digits have bit 0x80 set. */ def writeNat(x: Int) = - writeLongNat(x.toLong & 0x00000000FFFFFFFFL) + writeLongNat(x.toLong & 0X00000000FFFFFFFFL) /** * Like writeNat, but for longs. This is not the same as diff --git a/repos/scala/src/reflect/scala/reflect/internal/transform/Transforms.scala b/repos/scala/src/reflect/scala/reflect/internal/transform/Transforms.scala index 43bb58f9d47..17d34157e6d 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/transform/Transforms.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/transform/Transforms.scala @@ -18,7 +18,9 @@ trait Transforms { self: SymbolTable => private var _isDefined = false def isDefined = _isDefined def force: T = { - if (!isDefined) { value = op; _isDefined = true } + if (!isDefined) { + value = op; _isDefined = true + } value } } diff --git a/repos/scala/src/reflect/scala/reflect/internal/util/HashSet.scala b/repos/scala/src/reflect/scala/reflect/internal/util/HashSet.scala index 4166dd9b6ee..0c5cda685ee 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/util/HashSet.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/util/HashSet.scala @@ -77,7 +77,9 @@ class HashSet[T >: Null <: AnyRef](val label: String, initialCapacity: Int) i < table.length } def next(): T = - if (hasNext) { i += 1; table(i - 1).asInstanceOf[T] } else null + if (hasNext) { + i += 1; table(i - 1).asInstanceOf[T] + } else null } private def addOldEntry(x: T) { diff --git a/repos/scala/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala b/repos/scala/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala index 4e2d5c931a8..fd8784e1572 100644 --- a/repos/scala/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala +++ b/repos/scala/src/reflect/scala/reflect/internal/util/ScalaClassLoader.scala @@ -30,7 +30,9 @@ trait ScalaClassLoader extends JClassLoader { /** Executing an action with this classloader as context classloader */ def asContext[T](action: => T): T = { val saved = contextLoader - try { setContext(this); action } finally setContext(saved) + try { + setContext(this); action + } finally setContext(saved) } def setAsContext() { setContext(this) } diff --git a/repos/scala/src/reflect/scala/reflect/io/ZipArchive.scala b/repos/scala/src/reflect/scala/reflect/io/ZipArchive.scala index cfa76459d33..9cc7ec46801 100644 --- a/repos/scala/src/reflect/scala/reflect/io/ZipArchive.scala +++ b/repos/scala/src/reflect/scala/reflect/io/ZipArchive.scala @@ -39,7 +39,9 @@ object ZipArchive { */ def fromFile(file: File): FileZipArchive = fromFile(file.jfile) def fromFile(file: JFile): FileZipArchive = - try { new FileZipArchive(file) } catch { case _: IOException => null } + try { + new FileZipArchive(file) + } catch { case _: IOException => null } /** * @param url the url of a zip file diff --git a/repos/scala/src/repl/scala/tools/nsc/interpreter/Formatting.scala b/repos/scala/src/repl/scala/tools/nsc/interpreter/Formatting.scala index 17e8b0e2206..7a6142960a1 100644 --- a/repos/scala/src/repl/scala/tools/nsc/interpreter/Formatting.scala +++ b/repos/scala/src/repl/scala/tools/nsc/interpreter/Formatting.scala @@ -30,7 +30,7 @@ class Formatting(indent: Int) { if (indenting(code)) str print indentation str println line str.flush() - }) + }) } object Formatting { def forPrompt(prompt: String) = diff --git a/repos/scala/src/repl/scala/tools/nsc/interpreter/ILoop.scala b/repos/scala/src/repl/scala/tools/nsc/interpreter/ILoop.scala index fdce45767a1..ecb880c1a9b 100644 --- a/repos/scala/src/repl/scala/tools/nsc/interpreter/ILoop.scala +++ b/repos/scala/src/repl/scala/tools/nsc/interpreter/ILoop.scala @@ -375,7 +375,10 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter) private def changeSettings(line: String): Result = { def showSettings() = for (s <- settings.userSetSettings.toSeq.sorted) echo(s.toString) - if (line.isEmpty) showSettings() else { updateSettings(line); () } + if (line.isEmpty) showSettings() + else { + updateSettings(line); () + } } private def updateSettings(line: String) = { val (ok, rest) = settings.processArguments(words(line), processAll = false) diff --git a/repos/scala/src/repl/scala/tools/nsc/interpreter/IMain.scala b/repos/scala/src/repl/scala/tools/nsc/interpreter/IMain.scala index e79d02af7b6..13a4e7916e1 100644 --- a/repos/scala/src/repl/scala/tools/nsc/interpreter/IMain.scala +++ b/repos/scala/src/repl/scala/tools/nsc/interpreter/IMain.scala @@ -1151,7 +1151,9 @@ class IMain( /** load and run the code using reflection */ def loadAndRun: (String, Boolean) = { - try { ("" + (lineRep call sessionNames.print), true) } catch { + try { + ("" + (lineRep call sessionNames.print), true) + } catch { case ex: Throwable => (lineRep.bindError(ex), false) } } diff --git a/repos/scala/src/repl/scala/tools/nsc/interpreter/NamedParam.scala b/repos/scala/src/repl/scala/tools/nsc/interpreter/NamedParam.scala index 862ae802692..736211ec074 100644 --- a/repos/scala/src/repl/scala/tools/nsc/interpreter/NamedParam.scala +++ b/repos/scala/src/repl/scala/tools/nsc/interpreter/NamedParam.scala @@ -37,8 +37,7 @@ object NamedParam extends NamedParamCreator { protected val freshName = { var counter = 0 - () => - { counter += 1; "p" + counter } + () => { counter += 1; "p" + counter } } } diff --git a/repos/scala/src/repl/scala/tools/nsc/interpreter/Naming.scala b/repos/scala/src/repl/scala/tools/nsc/interpreter/Naming.scala index d4b17d6c48c..1beaf7c225e 100644 --- a/repos/scala/src/repl/scala/tools/nsc/interpreter/Naming.scala +++ b/repos/scala/src/repl/scala/tools/nsc/interpreter/Naming.scala @@ -99,8 +99,7 @@ trait Naming { val freshLineId = { var x = 0 - () => - { x += 1; x } + () => { x += 1; x } } def freshUserVarName() = userVar() def freshInternalVarName() = internalVar() diff --git a/repos/scala/src/repl/scala/tools/nsc/interpreter/ReplVals.scala b/repos/scala/src/repl/scala/tools/nsc/interpreter/ReplVals.scala index 68a32aba45a..1dc0cce9bed 100644 --- a/repos/scala/src/repl/scala/tools/nsc/interpreter/ReplVals.scala +++ b/repos/scala/src/repl/scala/tools/nsc/interpreter/ReplVals.scala @@ -85,7 +85,6 @@ object ReplVals { compilerTypeFromTag(m2).asInstanceOf[Type]) } - (sym: Symbol) => - new AppliedTypeFromTags(sym) + (sym: Symbol) => new AppliedTypeFromTags(sym) } } diff --git a/repos/scala/src/scaladoc/scala/tools/nsc/ScalaDoc.scala b/repos/scala/src/scaladoc/scala/tools/nsc/ScalaDoc.scala index bae64aaeddd..d4f20c36fba 100644 --- a/repos/scala/src/scaladoc/scala/tools/nsc/ScalaDoc.scala +++ b/repos/scala/src/scaladoc/scala/tools/nsc/ScalaDoc.scala @@ -41,7 +41,9 @@ class ScalaDoc { else if (docSettings.help.value || !hasFiles) reporter.echo(command.usageMsg) else - try { new DocFactory(reporter, docSettings) document command.files } catch { + try { + new DocFactory(reporter, docSettings) document command.files + } catch { case ex @ FatalError(msg) => if (docSettings.debug.value) ex.printStackTrace() reporter.error(null, "fatal error: " + msg) diff --git a/repos/scala/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala b/repos/scala/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala index bdc575c893d..33fdbb7079c 100644 --- a/repos/scala/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala +++ b/repos/scala/src/scaladoc/scala/tools/nsc/doc/base/CommentFactoryBase.scala @@ -127,46 +127,46 @@ trait CommentFactoryBase { /** Dangerous HTML tags that should be replaced by something safer, * such as wiki syntax, or that should be dropped. */ private val DangerousTags = new Regex( - """<(/?(div|ol|ul|li|h[1-6]|p))( [^>]*)?/?>|""") + """<(/?(div|ol|ul|li|h[1-6]|p))( [^>]*)?/?>|""") /** Maps a dangerous HTML tag to a safe wiki replacement, or an empty string * if it cannot be salvaged. */ private def htmlReplacement(mtch: Regex.Match): String = mtch.group(1) match { - case "p" | "div" => "\n\n" - case "h1" => "\n= " - case "/h1" => " =\n" - case "h2" => "\n== " - case "/h2" => " ==\n" - case "h3" => "\n=== " - case "/h3" => " ===\n" - case "h4" | "h5" | "h6" => "\n==== " + case "p" | "div" => "\n\n" + case "h1" => "\n= " + case "/h1" => " =\n" + case "h2" => "\n== " + case "/h2" => " ==\n" + case "h3" => "\n=== " + case "/h3" => " ===\n" + case "h4" | "h5" | "h6" => "\n==== " case "/h4" | "/h5" | "/h6" => " ====\n" - case "li" => "\n * - " - case _ => "" + case "li" => "\n * - " + case _ => "" } /** Javadoc tags that should be replaced by something useful, such as wiki * syntax, or that should be dropped. */ private val JavadocTags = new Regex( - """\{\@(code|docRoot|linkplain|link|literal|value)\p{Zs}*([^}]*)\}""") + """\{\@(code|docRoot|linkplain|link|literal|value)\p{Zs}*([^}]*)\}""") /** Maps a javadoc tag to a useful wiki replacement, or an empty string if it cannot be salvaged. */ private def javadocReplacement(mtch: Regex.Match): String = { mtch.group(1) match { - case "code" => "" + mtch.group(2) + "" - case "docRoot" => "" - case "link" => "`[[" + mtch.group(2) + "]]`" + case "code" => "" + mtch.group(2) + "" + case "docRoot" => "" + case "link" => "`[[" + mtch.group(2) + "]]`" case "linkplain" => "[[" + mtch.group(2) + "]]" - case "literal" => "`" + mtch.group(2) + "`" - case "value" => "`" + mtch.group(2) + "`" - case _ => "" + case "literal" => "`" + mtch.group(2) + "`" + case "value" => "`" + mtch.group(2) + "`" + case _ => "" } } /** Safe HTML tags that can be kept. */ private val SafeTags = new Regex( - """((&\w+;)|(&#\d+;)|(]*)?/?>))""") + """((&\w+;)|(&#\d+;)|(]*)?/?>))""") private val safeTagMarker = '\u000E' @@ -179,15 +179,15 @@ trait CommentFactoryBase { /** A Scaladoc tag linked to a symbol. Returns the name of the tag, the name * of the symbol, and the rest of the line. */ private val SymbolTagRegex = new Regex( - """\s*@(param|tparam|throws|groupdesc|groupname|groupprio)\s+(\S*)\s*(.*)""") + """\s*@(param|tparam|throws|groupdesc|groupname|groupprio)\s+(\S*)\s*(.*)""") /** The start of a Scaladoc code block */ private val CodeBlockStartRegex = new Regex( - """(.*?)((?:\{\{\{)|(?:\u000E]*)?>\u000E))(.*)""") + """(.*?)((?:\{\{\{)|(?:\u000E]*)?>\u000E))(.*)""") /** The end of a Scaladoc code block */ private val CodeBlockEndRegex = new Regex( - """(.*?)((?:\}\}\})|(?:\u000E\u000E))(.*)""") + """(.*?)((?:\}\}\})|(?:\u000E\u000E))(.*)""") /** A key used for a tag map. The key is built from the name of the tag and * from the linked symbol if the tag has one. @@ -206,10 +206,11 @@ trait CommentFactoryBase { * @param comment The expanded comment string (including start and end markers) to be parsed. * @param src The raw comment source string. * @param pos The position of the comment in source. */ - protected def parseAtSymbol(comment: String, - src: String, - pos: Position, - site: Symbol = NoSymbol): Comment = { + protected def parseAtSymbol( + comment: String, + src: String, + pos: Position, + site: Symbol = NoSymbol): Comment = { /** The cleaned raw comment as a list of lines. Cleaning removes comment * start and end markers, line start markers and unnecessary whitespace. */ @@ -218,7 +219,7 @@ trait CommentFactoryBase { // Remove trailing whitespaces TrailingWhitespaceRegex.replaceAllIn(line, "") match { case CleanCommentLine(ctl) => ctl - case tl => tl + case tl => tl } } val strippedComment = comment.trim.stripPrefix("/*").stripSuffix("*/") @@ -228,10 +229,9 @@ trait CommentFactoryBase { val javadoclessComment = JavadocTags.replaceAllIn(safeComment, { javadocReplacement(_) }) - val markedTagComment = SafeTags.replaceAllIn(javadoclessComment, { - mtch => - java.util.regex.Matcher - .quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker) + val markedTagComment = SafeTags.replaceAllIn(javadoclessComment, { mtch => + java.util.regex.Matcher + .quoteReplacement(safeTagMarker + mtch.matched + safeTagMarker) }) markedTagComment.lines.toList map (cleanLine(_)) } @@ -255,248 +255,259 @@ trait CommentFactoryBase { inCodeBlock: Boolean ): Comment = remaining match { - case CodeBlockStartRegex(before, marker, after) :: ls - if (!inCodeBlock) => + case CodeBlockStartRegex(before, marker, after) :: ls if (!inCodeBlock) => if (!before.trim.isEmpty && !after.trim.isEmpty) - parse0(docBody, - tags, - lastTagKey, - before :: marker :: after :: ls, - inCodeBlock = false) + parse0( + docBody, + tags, + lastTagKey, + before :: marker :: after :: ls, + inCodeBlock = false) else if (!before.trim.isEmpty) - parse0(docBody, - tags, - lastTagKey, - before :: marker :: ls, - inCodeBlock = false) + parse0( + docBody, + tags, + lastTagKey, + before :: marker :: ls, + inCodeBlock = false) else if (!after.trim.isEmpty) - parse0(docBody, - tags, - lastTagKey, - marker :: after :: ls, - inCodeBlock = true) + parse0( + docBody, + tags, + lastTagKey, + marker :: after :: ls, + inCodeBlock = true) else lastTagKey match { case Some(key) => - val value = ( (tags get key): @unchecked) match { + val value = ((tags get key): @unchecked) match { case Some(b :: bs) => (b + endOfLine + marker) :: bs - case None => oops("lastTagKey set when no tag exists for key") + case None => oops("lastTagKey set when no tag exists for key") } - parse0(docBody, - tags + (key -> value), - lastTagKey, - ls, - inCodeBlock = true) + parse0( + docBody, + tags + (key -> value), + lastTagKey, + ls, + inCodeBlock = true) case None => - parse0(docBody append endOfLine append marker, - tags, - lastTagKey, - ls, - inCodeBlock = true) + parse0( + docBody append endOfLine append marker, + tags, + lastTagKey, + ls, + inCodeBlock = true) } case CodeBlockEndRegex(before, marker, after) :: ls => { - if (!before.trim.isEmpty && !after.trim.isEmpty) - parse0(docBody, - tags, - lastTagKey, - before :: marker :: after :: ls, - inCodeBlock = true) - if (!before.trim.isEmpty) - parse0(docBody, - tags, - lastTagKey, - before :: marker :: ls, - inCodeBlock = true) - else if (!after.trim.isEmpty) - parse0(docBody, - tags, - lastTagKey, - marker :: after :: ls, - inCodeBlock = false) - else - lastTagKey match { - case Some(key) => - val value = ( (tags get key): @unchecked) match { - case Some(b :: bs) => (b + endOfLine + marker) :: bs - case None => - oops("lastTagKey set when no tag exists for key") - } - parse0(docBody, - tags + (key -> value), - lastTagKey, - ls, - inCodeBlock = false) - case None => - parse0(docBody append endOfLine append marker, - tags, - lastTagKey, - ls, - inCodeBlock = false) - } - } + if (!before.trim.isEmpty && !after.trim.isEmpty) + parse0( + docBody, + tags, + lastTagKey, + before :: marker :: after :: ls, + inCodeBlock = true) + if (!before.trim.isEmpty) + parse0( + docBody, + tags, + lastTagKey, + before :: marker :: ls, + inCodeBlock = true) + else if (!after.trim.isEmpty) + parse0( + docBody, + tags, + lastTagKey, + marker :: after :: ls, + inCodeBlock = false) + else + lastTagKey match { + case Some(key) => + val value = ((tags get key): @unchecked) match { + case Some(b :: bs) => (b + endOfLine + marker) :: bs + case None => + oops("lastTagKey set when no tag exists for key") + } + parse0( + docBody, + tags + (key -> value), + lastTagKey, + ls, + inCodeBlock = false) + case None => + parse0( + docBody append endOfLine append marker, + tags, + lastTagKey, + ls, + inCodeBlock = false) + } + } case SymbolTagRegex(name, sym, body) :: ls if (!inCodeBlock) => { - val key = SymbolTagKey(name, sym) - val value = body :: tags.getOrElse(key, Nil) - parse0(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) - } + val key = SymbolTagKey(name, sym) + val value = body :: tags.getOrElse(key, Nil) + parse0(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) + } case SimpleTagRegex(name, body) :: ls if (!inCodeBlock) => { - val key = SimpleTagKey(name) - val value = body :: tags.getOrElse(key, Nil) - parse0(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) - } + val key = SimpleTagKey(name) + val value = body :: tags.getOrElse(key, Nil) + parse0(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) + } case SingleTagRegex(name) :: ls if (!inCodeBlock) => { - val key = SimpleTagKey(name) - val value = "" :: tags.getOrElse(key, Nil) - parse0(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) - } + val key = SimpleTagKey(name) + val value = "" :: tags.getOrElse(key, Nil) + parse0(docBody, tags + (key -> value), Some(key), ls, inCodeBlock) + } case line :: ls if (lastTagKey.isDefined) => { - val newtags = - if (!line.isEmpty) { - val key = lastTagKey.get - val value = ( (tags get key): @unchecked) match { - case Some(b :: bs) => (b + endOfLine + line) :: bs - case None => oops("lastTagKey set when no tag exists for key") - } - tags + (key -> value) - } else tags - parse0(docBody, newtags, lastTagKey, ls, inCodeBlock) - } + val newtags = + if (!line.isEmpty) { + val key = lastTagKey.get + val value = ((tags get key): @unchecked) match { + case Some(b :: bs) => (b + endOfLine + line) :: bs + case None => oops("lastTagKey set when no tag exists for key") + } + tags + (key -> value) + } else tags + parse0(docBody, newtags, lastTagKey, ls, inCodeBlock) + } case line :: ls => { - if (docBody.length > 0) docBody append endOfLine - docBody append line - parse0(docBody, tags, lastTagKey, ls, inCodeBlock) - } + if (docBody.length > 0) docBody append endOfLine + docBody append line + parse0(docBody, tags, lastTagKey, ls, inCodeBlock) + } case Nil => { - // Take the {inheritance, content} diagram keys aside, as it doesn't need any parsing - val inheritDiagramTag = SimpleTagKey("inheritanceDiagram") - val contentDiagramTag = SimpleTagKey("contentDiagram") - - val inheritDiagramText: List[String] = - tags.get(inheritDiagramTag) match { - case Some(list) => list - case None => List.empty - } + // Take the {inheritance, content} diagram keys aside, as it doesn't need any parsing + val inheritDiagramTag = SimpleTagKey("inheritanceDiagram") + val contentDiagramTag = SimpleTagKey("contentDiagram") + + val inheritDiagramText: List[String] = + tags.get(inheritDiagramTag) match { + case Some(list) => list + case None => List.empty + } - val contentDiagramText: List[String] = - tags.get(contentDiagramTag) match { - case Some(list) => list - case None => List.empty - } + val contentDiagramText: List[String] = + tags.get(contentDiagramTag) match { + case Some(list) => list + case None => List.empty + } - val stripTags = List(inheritDiagramTag, - contentDiagramTag, - SimpleTagKey("template"), - SimpleTagKey("documentable")) - val tagsWithoutDiagram = - tags.filterNot(pair => stripTags.contains(pair._1)) + val stripTags = List( + inheritDiagramTag, + contentDiagramTag, + SimpleTagKey("template"), + SimpleTagKey("documentable")) + val tagsWithoutDiagram = + tags.filterNot(pair => stripTags.contains(pair._1)) - val bodyTags: mutable.Map[TagKey, List[Body]] = mutable.Map( - tagsWithoutDiagram mapValues { tag => + val bodyTags: mutable.Map[TagKey, List[Body]] = + mutable.Map(tagsWithoutDiagram mapValues { tag => tag map (parseWikiAtSymbol(_, pos, site)) } toSeq: _*) - def oneTag( - key: SimpleTagKey, filterEmpty: Boolean = true): Option[Body] = - ( (bodyTags remove key): @unchecked) match { - case Some(r :: rs) if !(filterEmpty && r.blocks.isEmpty) => - if (!rs.isEmpty) - reporter.warning( - pos, s"Only one '@${key.name}' tag is allowed") - Some(r) - case _ => None - } + def oneTag( + key: SimpleTagKey, + filterEmpty: Boolean = true): Option[Body] = + ((bodyTags remove key): @unchecked) match { + case Some(r :: rs) if !(filterEmpty && r.blocks.isEmpty) => + if (!rs.isEmpty) + reporter.warning(pos, s"Only one '@${key.name}' tag is allowed") + Some(r) + case _ => None + } - def allTags(key: SimpleTagKey): List[Body] = - (bodyTags remove key).getOrElse(Nil).filterNot(_.blocks.isEmpty) - - def allSymsOneTag( - key: TagKey, filterEmpty: Boolean = true): Map[String, Body] = { - val keys: Seq[SymbolTagKey] = - bodyTags.keys.toSeq flatMap { - case stk: SymbolTagKey if (stk.name == key.name) => Some(stk) - case stk: SimpleTagKey if (stk.name == key.name) => - reporter.warning( - pos, - s"Tag '@${stk.name}' must be followed by a symbol name") - None - case _ => None - } - val pairs: Seq[(String, Body)] = for (key <- keys) yield { - val bs = (bodyTags remove key).get - if (bs.length > 1) + def allTags(key: SimpleTagKey): List[Body] = + (bodyTags remove key).getOrElse(Nil).filterNot(_.blocks.isEmpty) + + def allSymsOneTag( + key: TagKey, + filterEmpty: Boolean = true): Map[String, Body] = { + val keys: Seq[SymbolTagKey] = + bodyTags.keys.toSeq flatMap { + case stk: SymbolTagKey if (stk.name == key.name) => Some(stk) + case stk: SimpleTagKey if (stk.name == key.name) => reporter.warning( - pos, - s"Only one '@${key.name}' tag for symbol ${key.symbol} is allowed") - (key.symbol, bs.head) + pos, + s"Tag '@${stk.name}' must be followed by a symbol name") + None + case _ => None } - Map.empty[String, Body] ++ - (if (filterEmpty) pairs.filterNot(_._2.blocks.isEmpty) else pairs) + val pairs: Seq[(String, Body)] = for (key <- keys) yield { + val bs = (bodyTags remove key).get + if (bs.length > 1) + reporter.warning( + pos, + s"Only one '@${key.name}' tag for symbol ${key.symbol} is allowed") + (key.symbol, bs.head) } + Map.empty[String, Body] ++ + (if (filterEmpty) pairs.filterNot(_._2.blocks.isEmpty) else pairs) + } - def linkedExceptions: Map[String, Body] = { - val m = allSymsOneTag(SimpleTagKey("throws"), filterEmpty = false) - - m.map { - case (name, body) => - val link = memberLookup(pos, name, site) - val newBody = body match { - case Body(List(Paragraph(Chain(content)))) => - val descr = Text(" ") +: content - val entityLink = EntityLink(Monospace(Text(name)), link) - Body(List(Paragraph(Chain(entityLink +: descr)))) - case _ => body - } - (name, newBody) - } + def linkedExceptions: Map[String, Body] = { + val m = allSymsOneTag(SimpleTagKey("throws"), filterEmpty = false) + + m.map { + case (name, body) => + val link = memberLookup(pos, name, site) + val newBody = body match { + case Body(List(Paragraph(Chain(content)))) => + val descr = Text(" ") +: content + val entityLink = EntityLink(Monospace(Text(name)), link) + Body(List(Paragraph(Chain(entityLink +: descr)))) + case _ => body + } + (name, newBody) } - - val com = createComment( - body0 = Some(parseWikiAtSymbol(docBody.toString, pos, site)), - authors0 = allTags(SimpleTagKey("author")), - see0 = allTags(SimpleTagKey("see")), - result0 = oneTag(SimpleTagKey("return")), - throws0 = linkedExceptions, - valueParams0 = allSymsOneTag(SimpleTagKey("param")), - typeParams0 = allSymsOneTag(SimpleTagKey("tparam")), - version0 = oneTag(SimpleTagKey("version")), - since0 = oneTag(SimpleTagKey("since")), - todo0 = allTags(SimpleTagKey("todo")), - deprecated0 = oneTag( - SimpleTagKey("deprecated"), filterEmpty = false), - note0 = allTags(SimpleTagKey("note")), - example0 = allTags(SimpleTagKey("example")), - constructor0 = oneTag(SimpleTagKey("constructor")), - source0 = Some(clean(src).mkString("\n")), - inheritDiagram0 = inheritDiagramText, - contentDiagram0 = contentDiagramText, - group0 = oneTag(SimpleTagKey("group")), - groupDesc0 = allSymsOneTag(SimpleTagKey("groupdesc")), - groupNames0 = allSymsOneTag(SimpleTagKey("groupname")), - groupPrio0 = allSymsOneTag(SimpleTagKey("groupprio")), - hideImplicitConversions0 = allTags( - SimpleTagKey("hideImplicitConversion")), - shortDescription0 = allTags(SimpleTagKey("shortDescription")) - ) - - for ((key, _) <- bodyTags) reporter.warning( - pos, s"Tag '@${key.name}' is not recognised") - - com } + + val com = createComment( + body0 = Some(parseWikiAtSymbol(docBody.toString, pos, site)), + authors0 = allTags(SimpleTagKey("author")), + see0 = allTags(SimpleTagKey("see")), + result0 = oneTag(SimpleTagKey("return")), + throws0 = linkedExceptions, + valueParams0 = allSymsOneTag(SimpleTagKey("param")), + typeParams0 = allSymsOneTag(SimpleTagKey("tparam")), + version0 = oneTag(SimpleTagKey("version")), + since0 = oneTag(SimpleTagKey("since")), + todo0 = allTags(SimpleTagKey("todo")), + deprecated0 = oneTag(SimpleTagKey("deprecated"), filterEmpty = false), + note0 = allTags(SimpleTagKey("note")), + example0 = allTags(SimpleTagKey("example")), + constructor0 = oneTag(SimpleTagKey("constructor")), + source0 = Some(clean(src).mkString("\n")), + inheritDiagram0 = inheritDiagramText, + contentDiagram0 = contentDiagramText, + group0 = oneTag(SimpleTagKey("group")), + groupDesc0 = allSymsOneTag(SimpleTagKey("groupdesc")), + groupNames0 = allSymsOneTag(SimpleTagKey("groupname")), + groupPrio0 = allSymsOneTag(SimpleTagKey("groupprio")), + hideImplicitConversions0 = + allTags(SimpleTagKey("hideImplicitConversion")), + shortDescription0 = allTags(SimpleTagKey("shortDescription")) + ) + + for ((key, _) <- bodyTags) + reporter.warning(pos, s"Tag '@${key.name}' is not recognised") + + com + } } - parse0(new StringBuilder(comment.size), - Map.empty, - None, - clean(comment), - inCodeBlock = false) + parse0( + new StringBuilder(comment.size), + Map.empty, + None, + clean(comment), + inCodeBlock = false) } /** Parses a string containing wiki syntax into a `Comment` object. @@ -514,7 +525,9 @@ trait CommentFactoryBase { * @author Manohar Jonnalagedda * @author Gilles Dubochet */ protected final class WikiParser( - val buffer: String, pos: Position, site: Symbol) + val buffer: String, + pos: Position, + site: Symbol) extends CharReader(buffer) { wiki => var summaryParsed = false @@ -540,18 +553,19 @@ trait CommentFactoryBase { /** listStyle ::= '-' spc | '1.' spc | 'I.' spc | 'i.' spc | 'A.' spc | 'a.' spc * Characters used to build lists and their constructors */ protected val listStyles = Map[String, (Seq[Block] => Block)]( - // TODO Should this be defined at some list companion? - "- " -> (UnorderedList(_)), - "1. " -> (OrderedList(_, "decimal")), - "I. " -> (OrderedList(_, "upperRoman")), - "i. " -> (OrderedList(_, "lowerRoman")), - "A. " -> (OrderedList(_, "upperAlpha")), - "a. " -> (OrderedList(_, "lowerAlpha"))) + // TODO Should this be defined at some list companion? + "- " -> (UnorderedList(_)), + "1. " -> (OrderedList(_, "decimal")), + "I. " -> (OrderedList(_, "upperRoman")), + "i. " -> (OrderedList(_, "lowerRoman")), + "A. " -> (OrderedList(_, "upperAlpha")), + "a. " -> (OrderedList(_, "lowerAlpha")) + ) /** Checks if the current line is formed with more than one space and one the listStyles */ def checkList = (countWhitespace > 0) && - (listStyles.keys exists { checkSkipInitWhitespace(_) }) + (listStyles.keys exists { checkSkipInitWhitespace(_) }) /** {{{ * nListBlock ::= nLine { mListBlock } @@ -662,15 +676,15 @@ trait CommentFactoryBase { str match { case OPEN_TAG(s, _, standalone) => { - if (standalone != "/") { - stack += s - } + if (standalone != "/") { + stack += s } + } case CLOSE_TAG(s) => { - if (s == stack.last) { - stack.remove(stack.length - 1) - } + if (s == stack.last) { + stack.remove(stack.length - 1) } + } case _ => ; } } while (stack.length > 0 && char != endOfText) @@ -726,9 +740,9 @@ trait CommentFactoryBase { } inlines match { - case Nil => Text("") + case Nil => Text("") case i :: Nil => i - case is => Chain(is) + case is => Chain(is) } } @@ -787,8 +801,8 @@ trait CommentFactoryBase { def summary(): Inline = { val i = inline(checkSentenceEnded()) Summary( - if (jump(".")) Chain(List(i, Text("."))) - else i + if (jump(".")) Chain(List(i, Text("."))) + else i ) } @@ -821,7 +835,8 @@ trait CommentFactoryBase { def blockEnded(blockType: String): Unit = { if (char != endOfLine && char != endOfText) { reportError( - pos, "no additional content on same line after " + blockType) + pos, + "no additional content on same line after " + blockType) jumpUntil(endOfLine) } while (char == endOfLine) nextChar() @@ -841,7 +856,9 @@ trait CommentFactoryBase { def normalizeIndentation(_code: String): String = { val code = - _code.replaceAll("\\s+$", "").dropWhile(_ == '\n') // right-trim + remove all leading '\n' + _code + .replaceAll("\\s+$", "") + .dropWhile(_ == '\n') // right-trim + remove all leading '\n' val lines = code.split("\n") // maxSkip - size of the longest common whitespace prefix of non-empty lines @@ -859,16 +876,16 @@ trait CommentFactoryBase { def checkParaEnded(): Boolean = { (char == endOfText) || ((char == endOfLine) && { - val poff = offset - nextChar() // read EOL - val ok = { - checkSkipInitWhitespace(endOfLine) || - checkSkipInitWhitespace('=') || checkSkipInitWhitespace("{{{") || - checkList || checkSkipInitWhitespace('\u003D') - } - offset = poff - ok - }) + val poff = offset + nextChar() // read EOL + val ok = { + checkSkipInitWhitespace(endOfLine) || + checkSkipInitWhitespace('=') || checkSkipInitWhitespace("{{{") || + checkList || checkSkipInitWhitespace('\u003D') + } + offset = poff + ok + }) } def checkSentenceEnded(): Boolean = { @@ -949,7 +966,7 @@ trait CommentFactoryBase { final def jump(chars: String): Boolean = { var index = 0 while (index < chars.length && char == chars.charAt(index) && - char != endOfText) { + char != endOfText) { nextChar() index += 1 } diff --git a/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala b/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala index 038d85b7a8a..4f54e7f0a83 100644 --- a/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala +++ b/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala @@ -23,6 +23,7 @@ import java.io.Writer * @author David Bernard * @author Gilles Dubochet */ abstract class HtmlPage extends Page { thisPage => + /** The title of this page. */ protected def title: String @@ -32,7 +33,10 @@ abstract class HtmlPage extends Page { thisPage => /** The page description */ protected def description: String = // unless overwritten, will display the title in a spaced format, keeping - and . - title.replaceAll("[^a-zA-Z0-9\\.\\-]+", " ").replaceAll("\\-+", " - ").replaceAll(" +", " ") + title + .replaceAll("[^a-zA-Z0-9\\.\\-]+", " ") + .replaceAll("\\-+", " - ") + .replaceAll(" +", " ") /** The page keywords */ protected def keywords: String = @@ -52,13 +56,15 @@ abstract class HtmlPage extends Page { thisPage => - { title } - - - + + { inlineToHtml(title) } - case Monospace(in) => { inlineToHtml(in) } - case Text(text) => scala.xml.Text(text) - case Summary(in) => inlineToHtml(in) - case HtmlTag(tag) => scala.xml.Unparsed(tag) + case Chain(items) => items flatMap (inlineToHtml(_)) + case Italic(in) => {inlineToHtml(in)} + case Bold(in) => {inlineToHtml(in)} + case Underline(in) => {inlineToHtml(in)} + case Superscript(in) => {inlineToHtml(in)} + case Subscript(in) => {inlineToHtml(in)} + case Link(raw, title) => + {inlineToHtml(title)} + case Monospace(in) => {inlineToHtml(in)} + case Text(text) => scala.xml.Text(text) + case Summary(in) => inlineToHtml(in) + case HtmlTag(tag) => scala.xml.Unparsed(tag) case EntityLink(target, link) => linkToHtml(target, link, hasLinks = true) } def linkToHtml(text: Inline, link: LinkTo, hasLinks: Boolean) = link match { case LinkToTpl(dtpl: TemplateEntity) => if (hasLinks) - { inlineToHtml(text) } + { + inlineToHtml(text) + } else - { inlineToHtml(text) } + { + inlineToHtml(text) + } case LinkToMember(mbr: MemberEntity, inTpl: TemplateEntity) => if (hasLinks) - { inlineToHtml(text) } + { + inlineToHtml(text) + } else - { inlineToHtml(text) } + { + inlineToHtml(text) + } case Tooltip(tooltip) => - { inlineToHtml(text) } + {inlineToHtml(text)} case LinkToExternal(name, url) => - { inlineToHtml(text) } + {inlineToHtml(text)} case _ => inlineToHtml(text) } - def typeToHtml(tpes: List[model.TypeEntity], hasLinks: Boolean): NodeSeq = tpes match { - case Nil => - NodeSeq.Empty - case List(tpe) => - typeToHtml(tpe, hasLinks) - case tpe :: rest => - typeToHtml(tpe, hasLinks) ++ scala.xml.Text(" with ") ++ typeToHtml(rest, hasLinks) - } + def typeToHtml(tpes: List[model.TypeEntity], hasLinks: Boolean): NodeSeq = + tpes match { + case Nil => + NodeSeq.Empty + case List(tpe) => + typeToHtml(tpe, hasLinks) + case tpe :: rest => + typeToHtml(tpe, hasLinks) ++ scala.xml.Text(" with ") ++ typeToHtml( + rest, + hasLinks) + } def typeToHtml(tpe: model.TypeEntity, hasLinks: Boolean): NodeSeq = { val string = tpe.name @@ -169,7 +204,9 @@ abstract class HtmlPage extends Page { thisPage => else if (inPos == starts.head) toLinksIn(inPos, starts) else { - scala.xml.Text(string.slice(inPos, starts.head)) ++ toLinksIn(starts.head, starts) + scala.xml.Text(string.slice(inPos, starts.head)) ++ toLinksIn( + starts.head, + starts) } } def toLinksIn(inPos: Int, starts: List[Int]): NodeSeq = { @@ -183,10 +220,14 @@ abstract class HtmlPage extends Page { thisPage => scala.xml.Text(string) } - def typesToHtml(tpess: List[model.TypeEntity], hasLinks: Boolean, sep: NodeSeq): NodeSeq = tpess match { - case Nil => NodeSeq.Empty - case tpe :: Nil => typeToHtml(tpe, hasLinks) - case tpe :: tpes => typeToHtml(tpe, hasLinks) ++ sep ++ typesToHtml(tpes, hasLinks, sep) + def typesToHtml( + tpess: List[model.TypeEntity], + hasLinks: Boolean, + sep: NodeSeq): NodeSeq = tpess match { + case Nil => NodeSeq.Empty + case tpe :: Nil => typeToHtml(tpe, hasLinks) + case tpe :: tpes => + typeToHtml(tpe, hasLinks) ++ sep ++ typesToHtml(tpes, hasLinks, sep) } def hasPage(e: DocTemplateEntity) = { @@ -197,7 +238,9 @@ abstract class HtmlPage extends Page { thisPage => def templateToHtml(tpl: TemplateEntity, name: String = null) = tpl match { case dTpl: DocTemplateEntity => if (hasPage(dTpl)) { - { if (name eq null) dTpl.name else name } + { + if (name eq null) dTpl.name else name + } } else { scala.xml.Text(if (name eq null) dTpl.name else name) } @@ -206,25 +249,27 @@ abstract class HtmlPage extends Page { thisPage => } /** Returns the HTML code that represents the templates in `tpls` as a list of hyperlinked names. */ - def templatesToHtml(tplss: List[TemplateEntity], sep: NodeSeq): NodeSeq = tplss match { - case Nil => NodeSeq.Empty - case tpl :: Nil => templateToHtml(tpl) - case tpl :: tpls => templateToHtml(tpl) ++ sep ++ templatesToHtml(tpls, sep) - } + def templatesToHtml(tplss: List[TemplateEntity], sep: NodeSeq): NodeSeq = + tplss match { + case Nil => NodeSeq.Empty + case tpl :: Nil => templateToHtml(tpl) + case tpl :: tpls => + templateToHtml(tpl) ++ sep ++ templatesToHtml(tpls, sep) + } object Image extends Enumeration { val Trait, Class, Type, Object, Package = Value } /** Returns the _big image name and the alt attribute - * corresponding to the DocTemplate Entity (upper left icon) */ + * corresponding to the DocTemplate Entity (upper left icon) */ def docEntityKindToBigImage(ety: DocTemplateEntity) = { def entityToImage(e: DocTemplateEntity) = - if (e.isTrait) Image.Trait - else if (e.isClass) Image.Class + if (e.isTrait) Image.Trait + else if (e.isClass) Image.Class else if (e.isAbstractType || e.isAliasType) Image.Type - else if (e.isObject) Image.Object - else if (e.isPackage) Image.Package + else if (e.isObject) Image.Object + else if (e.isPackage) Image.Package else { // FIXME: an entity *should* fall into one of the above categories, // but AnyRef is somehow not @@ -232,8 +277,8 @@ abstract class HtmlPage extends Page { thisPage => } val image = entityToImage(ety) - val companionImage = ety.companion filter { - e => e.visibility.isPublic && ! e.inSource.isEmpty + val companionImage = ety.companion filter { e => + e.visibility.isPublic && !e.inSource.isEmpty } map { entityToImage } (image, companionImage) match { @@ -246,22 +291,22 @@ abstract class HtmlPage extends Page { thisPage => def permalink(template: Entity, isSelf: Boolean = true): Elem = - + - def docEntityKindToCompanionTitle(ety: DocTemplateEntity, baseString: String = "See companion") = - ety.companion match{ - case Some(companion) => - s"$baseString${ - if(companion.isObject) " object" - else if(companion.isTrait) " trait" - else if(companion.isClass) " class" - else "" - }" - case None => baseString - } + def docEntityKindToCompanionTitle( + ety: DocTemplateEntity, + baseString: String = "See companion") = + ety.companion match { + case Some(companion) => + s"$baseString${if (companion.isObject) " object" + else if (companion.isTrait) " trait" + else if (companion.isClass) " class" + else ""}" + case None => baseString + } def companionAndPackage(tpl: DocTemplateEntity): NodeSeq = { @@ -272,22 +317,27 @@ abstract class HtmlPage extends Page { thisPage => else if (companionTpl.isTrait) s"trait ${companionTpl.name}" else s"class ${companionTpl.name}"
    - Companion {objClassTrait} + Companion {objClassTrait}
    case None => NodeSeq.Empty } }
    private def memberToUrl(template: Entity, isSelf: Boolean = true): String = { - val (signature: Option[String], containingTemplate: TemplateEntity) = template match { - case dte: DocTemplateEntity if (!isSelf) => (Some(dte.signature), dte.inTemplate) - case dte: DocTemplateEntity => (None, dte) - case me: MemberEntity => (Some(me.signature), me.inTemplate) - case tpl => (None, tpl) - } + val (signature: Option[String], containingTemplate: TemplateEntity) = + template match { + case dte: DocTemplateEntity if (!isSelf) => + (Some(dte.signature), dte.inTemplate) + case dte: DocTemplateEntity => (None, dte) + case me: MemberEntity => (Some(me.signature), me.inTemplate) + case tpl => (None, tpl) + } val templatePath = templateToPath(containingTemplate) - val url = "../" * (templatePath.size - 1) + templatePath.reverse.mkString("/") + val url = "../" * (templatePath.size - 1) + templatePath.reverse.mkString( + "/") url + signature.map("#" + _).getOrElse("") } } diff --git a/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala b/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala index 2311e5a289a..b3cb5928a84 100644 --- a/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala +++ b/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/SyntaxHigh.scala @@ -210,7 +210,9 @@ private[html] object SyntaxHigh { val out = new StringBuilder("'") def charlit0(i: Int, bslash: Boolean): Int = { if (i == buf.length) i - else if (i > j + 6) { out setLength 0; j } else { + else if (i > j + 6) { + out setLength 0; j + } else { val ch = buf(i) out append ch ch match { diff --git a/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala b/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala index e45847da78e..7edf0febd58 100644 --- a/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala +++ b/repos/scala/src/scaladoc/scala/tools/nsc/doc/html/page/Entity.scala @@ -31,28 +31,50 @@ trait EntityPage extends HtmlPage { def title = { val s = universe.settings - ( if (!s.doctitle.isDefault) s.doctitle.value + " " else "" ) + - ( if (!s.docversion.isDefault) s.docversion.value else "" ) + - ( if ((!s.doctitle.isDefault || !s.docversion.isDefault) && tpl.qualifiedName != "_root_") " - " + tpl.qualifiedName else "" ) + (if (!s.doctitle.isDefault) s.doctitle.value + " " else "") + + (if (!s.docversion.isDefault) s.docversion.value else "") + + (if ((!s.doctitle.isDefault || !s.docversion.isDefault) && tpl.qualifiedName != "_root_") + " - " + tpl.qualifiedName + else "") } def headers = - - - - - - - - - - - - { if (universe.settings.docDiagrams.value) { - - - } else NodeSeq.Empty } + + + + + + + + + + + + { + if (universe.settings.docDiagrams.value) { + + + } else NodeSeq.Empty + } - } - } + (defaultScripts ++ scripts) map { pth => + + } + } } @@ -92,9 +92,9 @@ class TemplateExample displayPage( "Scalatra: Date Example",
      -
    • Year: { params("year") }
    • -
    • Month: { params("month") }
    • -
    • Day: { params("day") }
    • +
    • Year: {params("year")}
    • +
    • Month: {params("month")}
    • +
    • Day: {params("day")}
    Route: /date/:year/:month/:day
    ) @@ -103,7 +103,7 @@ class TemplateExample get("/form") { displayPage( "Scalatra: Form Post Example", -
    + Post something:
    @@ -114,7 +114,7 @@ class TemplateExample post("/post") { displayPage( "Scalatra: Form Post Result", -

    You posted: { params("submission") }

    +

    You posted: {params("submission")}

    Route: /post
    ) } @@ -123,12 +123,12 @@ class TemplateExample case (Some(first: String), Some(last: String)) => displayPage( "Scalatra: Session Example", -
    You have logged in as: { first + "-" + last }
    +
    You have logged in as: {first + "-" + last}
    Route: /login
    ) case x => displayPage( "Scalatra: Session Example" + x.toString, -
    + First Name: Last Name: @@ -145,7 +145,7 @@ class TemplateExample session("last") = last displayPage( "Scalatra: Session Example", -
    You have just logged in as: { first + " " + last }
    +
    You have just logged in as: {first + " " + last}
    Route: /login
    ) } } @@ -163,7 +163,7 @@ class TemplateExample displayPage( "Scalatra: Hello World",

    Hello world!

    -

    Referer: { (request referrer) map { Text(_) } getOrElse { none } }

    +

    Referer: {(request referrer) map { Text(_) } getOrElse { none }}

    Route: /
    ) } @@ -193,7 +193,7 @@ class TemplateExample get("/flash-map/result") { displayPage( title = "Scalatra: Flash Example", - content = Message = { flash.getOrElse("message", "") } + content = Message = {flash.getOrElse("message", "")} ) } diff --git a/repos/scalatra/slf4j/src/main/scala/org/scalatra/slf4j/ScalatraSlf4jRequestLogging.scala b/repos/scalatra/slf4j/src/main/scala/org/scalatra/slf4j/ScalatraSlf4jRequestLogging.scala index ecc2cec19cc..ad438131ff7 100644 --- a/repos/scalatra/slf4j/src/main/scala/org/scalatra/slf4j/ScalatraSlf4jRequestLogging.scala +++ b/repos/scalatra/slf4j/src/main/scala/org/scalatra/slf4j/ScalatraSlf4jRequestLogging.scala @@ -57,7 +57,11 @@ trait ScalatraSlf4jRequestLogging extends ScalatraBase with Handler { .map(_.multiParams) .getOrElse(Map.empty) fillMdc() - try { thunk } finally { request(MultiParamsKey) = originalParams } + try { + thunk + } finally { + request(MultiParamsKey) = originalParams + } } private[this] def fillMdc() { @@ -125,7 +129,9 @@ trait ScalatraSlf4jRequestLogging extends ScalatraBase with Handler { transformers: Seq[_root_.org.scalatra.RouteTransformer], action: => Any): Route = { val newAction = () => { - try { logRequest() } catch { case _: Throwable => } + try { + logRequest() + } catch { case _: Throwable => } action } val route = Route( diff --git a/repos/scalatra/swagger/src/main/scala/org/scalatra/swagger/SwaggerSupport.scala b/repos/scalatra/swagger/src/main/scala/org/scalatra/swagger/SwaggerSupport.scala index ac26530c0c4..59606d2213d 100644 --- a/repos/scalatra/swagger/src/main/scala/org/scalatra/swagger/SwaggerSupport.scala +++ b/repos/scalatra/swagger/src/main/scala/org/scalatra/swagger/SwaggerSupport.scala @@ -76,8 +76,7 @@ object SwaggerSupportSyntax { private def prefixedOptional: Parser[Builder => Builder] = ("." | "/") ~ "?:" ~ """\w+""".r ~ "?" ^^ { case p ~ "?:" ~ o ~ "?" => - builder => - builder addPrefixedOptional (o, p) + builder => builder addPrefixedOptional (o, p) } private def optional: Parser[Builder => Builder] = diff --git a/repos/scalatra/swagger/src/test/scala/org/scalatra/swagger/SwaggerSpec.scala b/repos/scalatra/swagger/src/test/scala/org/scalatra/swagger/SwaggerSpec.scala index 8d5dd5770d9..f15c02380ee 100644 --- a/repos/scalatra/swagger/src/test/scala/org/scalatra/swagger/SwaggerSpec.scala +++ b/repos/scalatra/swagger/src/test/scala/org/scalatra/swagger/SwaggerSpec.scala @@ -58,7 +58,12 @@ class SwaggerSpec extends ScalatraSpec with JsonMatchers { * Sets the port to listen on. 0 means listen on any available port. */ override lazy val port: Int = { - val s = new ServerSocket(0); try { s.getLocalPort } finally { s.close() } + val s = new ServerSocket(0); + try { + s.getLocalPort + } finally { + s.close() + } } //58468 val listResourceJValue = @@ -310,7 +315,9 @@ class SwaggerSpec extends ScalatraSpec with JsonMatchers { def countsmatch = (af.size must_== ef.size) .setMessage("The count for the responseMessages is different") - if (r.nonEmpty) { countsmatch and (r reduce (_ and _)) } else + if (r.nonEmpty) { + countsmatch and (r reduce (_ and _)) + } else countsmatch case "parameters" => val JArray(af) = act \ fn diff --git a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala index c31152f392d..49c65dbc6c2 100644 --- a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala +++ b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Future.scala @@ -483,7 +483,7 @@ object Future { Async((cb: A => Trampoline[Unit]) => listen { a => cb(a).run - }) + }) /** Create a `Future` that will evaluate `a` using the given `ExecutorService`. */ def apply[A](a: => A)( diff --git a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Strategy.scala b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Strategy.scala index d527b2b2437..adfcde37485 100644 --- a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Strategy.scala +++ b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Strategy.scala @@ -66,8 +66,7 @@ trait StrategysLow { implicit val Sequential: Strategy = new Strategy { def apply[A](a: => A) = { val v = a - () => - v + () => v } } @@ -84,8 +83,7 @@ trait StrategysLow { val fut = s.submit(new Callable[A] { def call = a }) - () => - fut.get + () => fut.get } } @@ -107,8 +105,7 @@ trait StrategysLow { def call = a }) thread.shutdown() - () => - fut.get + () => fut.get } } @@ -124,8 +121,7 @@ trait StrategysLow { def doInBackground = a } worker.execute - () => - worker.get + () => worker.get } } @@ -142,8 +138,7 @@ trait StrategysLow { def call = a }) invokeLater(task) - () => - task.get + () => task.get } } } diff --git a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala index c0d4e34f665..13c48c54872 100644 --- a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala +++ b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Task.scala @@ -170,8 +170,7 @@ class Task[+A](val get: Future[Throwable \/ A]) { })(Strategy.Sequential) get.unsafePerformAsyncInterruptibly(r => a ! Some(r), completed) - () => - { a ! None } + () => { a ! None } } @deprecated("use unsafePerformAsyncInterruptibly", "7.2") diff --git a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Timer.scala b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Timer.scala index 2cd535fa4fd..10310ba888a 100644 --- a/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Timer.scala +++ b/repos/scalaz/concurrent/src/main/scala/scalaz/concurrent/Timer.scala @@ -100,7 +100,7 @@ case class Timer( .get(waitTime) .map(current => (waitTime, timedCallback :: current)) .getOrElse((waitTime, List(timedCallback))) - } + } Future.async(listen) } else { Future.now(value) diff --git a/repos/scalaz/core/src/main/scala/scalaz/Cofree.scala b/repos/scalaz/core/src/main/scala/scalaz/Cofree.scala index 07903cd55ed..c5e8a3e3255 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Cofree.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Cofree.scala @@ -244,7 +244,7 @@ private trait CofreeZipApply[F[_]] .map(fab => F.apply2(Tags.Zip.subst(fat), Tags.Zip.subst(fab)) { (a, b) => Tag.unwrap(ap(a)(b)) - })) + })) ) ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/Digit.scala b/repos/scalaz/core/src/main/scala/scalaz/Digit.scala index ff5d5553ed1..027fe75ac3f 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Digit.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Digit.scala @@ -94,7 +94,7 @@ object Digit extends DigitInstances { Digit.digitFromChar(a) match { case None => F.empty[Digit] case Some(d) => F.point(d) - }) + }) def traverseDigits[F[_]](chars: F[Char])( implicit F: Traverse[F]): Option[F[Digit]] = { diff --git a/repos/scalaz/core/src/main/scala/scalaz/EitherT.scala b/repos/scalaz/core/src/main/scala/scalaz/EitherT.scala index e4e55664817..3d2f5df1b1d 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/EitherT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/EitherT.scala @@ -439,7 +439,7 @@ private trait EitherTBindRec[F[_], E] _.fold( e => \/.right(\/.left(e)), _.fold(a => \/.left(a), b => \/.right(\/.right(b)))) - })(a) + })(a) ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/EphemeralStream.scala b/repos/scalaz/core/src/main/scala/scalaz/EphemeralStream.scala index 2920f987456..0a049d71a8f 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/EphemeralStream.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/EphemeralStream.scala @@ -300,17 +300,16 @@ object EphemeralStream extends EphemeralStreamInstances { val latch = new Object // TODO I don't think this annotation does anything, as `v` isn't a class member. @volatile var v: Option[WeakReference[V]] = None - () => - { - val a = v.map(x => x.get) - if (a.isDefined && a.get != null) a.get - else - latch.synchronized { - val x = f - v = Some(new WeakReference(x)) - x - } - } + () => { + val a = v.map(x => x.get) + if (a.isDefined && a.get != null) a.get + else + latch.synchronized { + val x = f + v = Some(new WeakReference(x)) + x + } + } } def apply[A]: EphemeralStream[A] = diff --git a/repos/scalaz/core/src/main/scala/scalaz/FingerTree.scala b/repos/scalaz/core/src/main/scala/scalaz/FingerTree.scala index cf73614638a..519473b59a6 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/FingerTree.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/FingerTree.scala @@ -489,7 +489,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { pr1, addDigits0(m1, sf1, pr2, m2), sf2) - ) + ) ) } @@ -514,7 +514,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { pr1, addDigits1(m1, sf1, n, pr2, m2), sf2) - ) + ) ) } @@ -535,7 +535,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { pr1, addDigits2(m1, sf1, n1, n2, pr2, m2), sf2) - ) + ) ) } @@ -559,7 +559,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { pr1, addDigits3(m1, sf1, n1, n2, n3, pr2, m2), sf2) - ) + ) ) } @@ -591,7 +591,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { pr1, addDigits4(m1, sf1, n1, n2, n3, n4, pr2, m2), sf2) - ) + ) ) } @@ -957,7 +957,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { pr match { case One(v, x) => OnL[FingerTree[V, ?], A](x, rotL(m, sf)) case _ => OnL[FingerTree[V, ?], A](pr.lhead, deep(pr.ltail, m, sf)) - } + } ) def viewr: ViewR[FingerTree[V, ?], A] = @@ -968,7 +968,7 @@ sealed abstract class FingerTree[V, A](implicit measurer: Reducer[A, V]) { sf match { case One(v, x) => OnR[FingerTree[V, ?], A](rotR(pr, m), x) case _ => OnR[FingerTree[V, ?], A](deep(pr, m, sf.rtail), sf.rhead) - } + } ) /** diff --git a/repos/scalaz/core/src/main/scala/scalaz/Foldable.scala b/repos/scalaz/core/src/main/scala/scalaz/Foldable.scala index 27a355c8903..4020f200272 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Foldable.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Foldable.scala @@ -322,7 +322,7 @@ trait Foldable[F[_]] { self => else x, pa) } - })._1 + })._1 /** ``O(n log n)`` complexity */ def distinct[A](fa: F[A])(implicit A: Order[A]): IList[A] = diff --git a/repos/scalaz/core/src/main/scala/scalaz/Heap.scala b/repos/scalaz/core/src/main/scala/scalaz/Heap.scala index 7db9b54c7e5..a0ec2b87776 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Heap.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Heap.scala @@ -81,7 +81,7 @@ sealed abstract class Heap[A] { val f3 = zs.foldRight(f2)(skewInsert(leq, _, _)) Heap(s - 1, leq, Node(Ranked(0, x), f3)) } - } + } ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/IList.scala b/repos/scalaz/core/src/main/scala/scalaz/IList.scala index a09abe88bff..650b50c20cb 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/IList.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/IList.scala @@ -618,8 +618,7 @@ sealed abstract class IListInstances extends IListInstance0 { case (ICons(ah, at), ICons(bh, bt)) => loop(at, bt, f(\&/.Both(ah, bh)) :: accum) } - (a, b) => - loop(a, b, empty) + (a, b) => loop(a, b, empty) } override def toIList[A](fa: IList[A]) = fa @@ -724,9 +723,9 @@ sealed abstract class IListInstances extends IListInstance0 { } "[" +: (as match { - case INil() => Cord() - case ICons(x, xs) => commaSep(xs, A.show(x)) - }) :+ "]" + case INil() => Cord() + case ICons(x, xs) => commaSep(xs, A.show(x)) + }) :+ "]" } } } diff --git a/repos/scalaz/core/src/main/scala/scalaz/ISet.scala b/repos/scalaz/core/src/main/scala/scalaz/ISet.scala index 69ead45ab8a..17405cbde65 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/ISet.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/ISet.scala @@ -608,7 +608,7 @@ sealed abstract class ISet[A] { case EQ => r case GT => r.filterGt(a) } - }, + }, this) final def filterLt(a: Option[A])(implicit o: Order[A]): ISet[A] = @@ -622,7 +622,7 @@ sealed abstract class ISet[A] { case EQ => l case GT => l.filterLt(a) } - }, + }, this) override final def equals(other: Any): Boolean = diff --git a/repos/scalaz/core/src/main/scala/scalaz/IndexedContsT.scala b/repos/scalaz/core/src/main/scala/scalaz/IndexedContsT.scala index 480b34860b3..819d2356e80 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/IndexedContsT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/IndexedContsT.scala @@ -23,10 +23,11 @@ final class IndexedContsT[W[_], M[_], R, O, A] private ( def flatMap[E, B](f: A => IndexedContsT[W, M, O, E, B])( implicit W: Cobind[W]): IndexedContsT[W, M, R, E, B] = IndexedContsT { wbme => - run(W.cobind(wbme) { wk => - { a => - f(a).run(wk) - } + run(W.cobind(wbme) { + wk => + { a => + f(a).run(wk) + } }) } @@ -34,10 +35,11 @@ final class IndexedContsT[W[_], M[_], R, O, A] private ( implicit M: Functor[M], W: Functor[W]): IndexedContsT[W, M, R, I, A] = IndexedContsT { wami => - run(W.map(wami) { ami => - { a => - M.map(ami(a))(f) - } + run(W.map(wami) { + ami => + { a => + M.map(ami(a))(f) + } }) } @@ -57,10 +59,11 @@ final class IndexedContsT[W[_], M[_], R, O, A] private ( implicit M: Functor[M], W: Functor[W]): IndexedContsT[W, M, E, I, A] = IndexedContsT { wami => - M.map(run(W.map(wami) { ami => - { a => - M.map(ami(a))(g) - } + M.map(run(W.map(wami) { + ami => + { a => + M.map(ami(a))(g) + } }))(f) } @@ -70,10 +73,11 @@ final class IndexedContsT[W[_], M[_], R, O, A] private ( implicit M: Functor[M], W: Functor[W]): ContsT[W, M, Z, A] = IndexedContsT { wami => - M.map(run(W.map(wami) { ami => - { a => - M.map(ami(a))(f from _) - } + M.map(run(W.map(wami) { + ami => + { a => + M.map(ami(a))(f from _) + } }))(f to _) } } @@ -106,10 +110,11 @@ trait IndexedContsTFunctions { def apply[A]( fa: IndexedContsT[W, M, R, O, A]): IndexedContsT[W, N, R, O, A] = IndexedContsT { wk => - f(fa.run(W.map(wk) { k => - { x => - g(k(x)) - } + f(fa.run(W.map(wk) { + k => + { x => + g(k(x)) + } })) } } diff --git a/repos/scalaz/core/src/main/scala/scalaz/Kleisli.scala b/repos/scalaz/core/src/main/scala/scalaz/Kleisli.scala index c3946ff75a5..89ccaa21876 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Kleisli.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Kleisli.scala @@ -86,7 +86,7 @@ final case class Kleisli[M[_], A, B](run: A => M[B]) { self => (r, s) => M.map(self(r)) { b => (W.zero, b, s) - } + } ) def state(implicit M: Monad[M]): StateT[M, A, B] = diff --git a/repos/scalaz/core/src/main/scala/scalaz/LazyEitherT.scala b/repos/scalaz/core/src/main/scala/scalaz/LazyEitherT.scala index a66235ae7f5..8f653c7c2f2 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/LazyEitherT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/LazyEitherT.scala @@ -187,7 +187,7 @@ object LazyEitherT extends LazyEitherTInstances { z.fold( _ => g, _ => x.run - ))) + ))) } def toLazyOption(implicit F: Functor[F]): LazyOptionT[F, A] = @@ -405,7 +405,7 @@ private trait LazyEitherTPlus[F[_], E] extends Plus[LazyEitherT[F, E, ?]] { ll => LazyEither.lazyLeft(E.append(l, ll)), _ => rr ) - }, + }, _ => F.point(r) ) }) @@ -483,7 +483,7 @@ private trait LazyEitherTBindRec[F[_], E] _.fold( e => \/.right(LazyEither.lazyLeft(e)), _.map(b => LazyEither.lazyRight(b))) - })(a) + })(a) ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/LazyOptionT.scala b/repos/scalaz/core/src/main/scala/scalaz/LazyOptionT.scala index b25746ad84b..5139bae2b83 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/LazyOptionT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/LazyOptionT.scala @@ -171,7 +171,7 @@ private trait LazyOptionTBindRec[F[_]] _.fold( _.map(b => LazyOption.lazySome(b)), \/.right(LazyOption.lazyNone)) - })(a) + })(a) ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/MaybeT.scala b/repos/scalaz/core/src/main/scala/scalaz/MaybeT.scala index 877d6d3f834..d02c1f80ab3 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/MaybeT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/MaybeT.scala @@ -203,7 +203,7 @@ private trait MaybeTBindRec[F[_]] B.tailrecM[A, Maybe[B]](a => F.map(f(a).run) { _.cata(_.map(Maybe.just), \/.right(Maybe.empty)) - })(a) + })(a) ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/Memo.scala b/repos/scalaz/core/src/main/scala/scalaz/Memo.scala index e84cdf1aa8a..9266ba88adb 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Memo.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Memo.scala @@ -26,15 +26,14 @@ object Memo extends MemoInstances { private class ArrayMemo[V >: Null: ClassTag](n: Int) extends Memo[Int, V] { override def apply(f: (Int) => V) = { lazy val a = new Array[V](n) - k => - { - val t = a(k) - if (t == null) { - val v = f(k) - a(k) = v - v - } else t - } + k => { + val t = a(k) + if (t == null) { + val v = f(k) + a(k) = v + v + } else t + } } } @@ -48,15 +47,14 @@ object Memo extends MemoInstances { Array.fill(n)(sentinel) } } - k => - { - val t = a(k) - if (t == sentinel) { - val v = f(k) - a(k) = v - v - } else t - } + k => { + val t = a(k) + if (t == sentinel) { + val v = f(k) + a(k) = v + v + } else t + } } } @@ -99,7 +97,7 @@ object Memo extends MemoInstances { a = a updated (k, v) v } - }) + }) } /** Cache results in a hash map. Nonsensical unless `K` has diff --git a/repos/scalaz/core/src/main/scala/scalaz/Monoid.scala b/repos/scalaz/core/src/main/scala/scalaz/Monoid.scala index 00e9eb25a26..cb02fc58561 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/Monoid.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/Monoid.scala @@ -36,7 +36,11 @@ trait Monoid[F] extends Semigroup[F] { self => eq.equal(a, zero) final def ifEmpty[B](a: F)(t: => B)(f: => B)(implicit eq: Equal[F]): B = - if (isMZero(a)) { t } else { f } + if (isMZero(a)) { + t + } else { + f + } final def onNotEmpty[B](a: F)( v: => B)(implicit eq: Equal[F], mb: Monoid[B]): B = diff --git a/repos/scalaz/core/src/main/scala/scalaz/OptionT.scala b/repos/scalaz/core/src/main/scala/scalaz/OptionT.scala index 0ae946e80af..7ee4875cef3 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/OptionT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/OptionT.scala @@ -239,7 +239,7 @@ private trait OptionTBindRec[F[_]] B.tailrecM[A, Option[B]](a0 => F.map(f(a0).run) { _.fold(\/.right[A, Option[B]](None: Option[B]))(_.map(Some.apply)) - })(a) + })(a) ) } diff --git a/repos/scalaz/core/src/main/scala/scalaz/PLens.scala b/repos/scalaz/core/src/main/scala/scalaz/PLens.scala index 1a68cb971d8..1396c2b0ec2 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/PLens.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/PLens.scala @@ -123,7 +123,7 @@ sealed abstract class PLensFamily[A1, A2, B1, B2] { val r = f(w.pos) (w put r, Some(r)) } - }) + }) def :=[A >: A2 <: A1](b: => B2): PState[A, B2] = %=(_ => b) @@ -139,7 +139,7 @@ sealed abstract class PLensFamily[A1, A2, B1, B2] { val r = s.run(w.pos): (B2, C) (w put r._1, Some(r._2)) } - }) + }) def >-[A >: A2 <: A1, C](f: B1 => C): PState[A, C] = State(a => (a, get(a) map f)) @@ -152,7 +152,7 @@ sealed abstract class PLensFamily[A1, A2, B1, B2] { f(w) apply a match { case (y, x) => (y, Some(x)) } - }) + }) def ->>-[A >: A2 <: A1, C](f: => State[A, C]): PState[A, C] = >>-(_ => f) @@ -592,7 +592,7 @@ trait PLensFunctions extends PLensInstances with PLensFamilyFunctions { else lookupr((EphemeralStream.emptyEphemeralStream, s.head(), s.tail())) map { case (l, (k, v), r) => Store(w => l.reverse ++ cons((k, w), r), v) - }) + }) } def ephemeralStreamLookupPLens[K: Equal, V]( diff --git a/repos/scalaz/core/src/main/scala/scalaz/ReaderWriterStateT.scala b/repos/scalaz/core/src/main/scala/scalaz/ReaderWriterStateT.scala index aa3584e29a4..2081c17409a 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/ReaderWriterStateT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/ReaderWriterStateT.scala @@ -15,7 +15,7 @@ sealed abstract class IndexedReaderWriterStateT[F[_], -R, W, -S1, S2, A] { IndexedStateT((s: S1) => F.map(run(r, s)) { case (w, a, s1) => (s1, a) - }) + }) /** Calls `run` using `Monoid[S].zero` as the initial state */ def runZero[S <: S1]( @@ -55,7 +55,7 @@ sealed abstract class IndexedReaderWriterStateT[F[_], -R, W, -S1, S2, A] { case (w2, b, s3) => (W.append(w1, w2), b, s3) } } - }) + }) } object IndexedReaderWriterStateT @@ -212,7 +212,7 @@ private trait ReaderWriterStateTBindRec[F[_], R, W, S] F.bind(f(a).run(r, s)) { case (w, -\/(a0), s0) => F.tailrecM(go(r))(w, a0, s0) case (w, \/-(b), s0) => A.point((w, b, s0)) - }) + }) } } diff --git a/repos/scalaz/core/src/main/scala/scalaz/StateT.scala b/repos/scalaz/core/src/main/scala/scalaz/StateT.scala index 337867d6ae0..24d5b5e6b53 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/StateT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/StateT.scala @@ -73,7 +73,7 @@ sealed abstract class IndexedStateT[F[_], -S1, S2, A] { self => F.bind[(S2, A), (S3, B)](sf(s)) { t => val sfb: F[(S2 => F[(S3, B)])] = f(t._2).getF(F) F.bind[S2 => F[(S3, B)], (S3, B)](sfb)(ff => ff(t._1)) - }) + }) def lift[M[_]]( implicit F: Monad[F], @@ -91,7 +91,7 @@ sealed abstract class IndexedStateT[F[_], -S1, S2, A] { self => (m: Monad[FF]) => (s: S) => { M.copoint(ev(self)(s)) - } + } ) def unliftId[M[_], S <: S1]( @@ -109,7 +109,7 @@ sealed abstract class IndexedStateT[F[_], -S1, S2, A] { self => (sf: (S1 => F[(S2, A)])) => F.map(sf(s)) { case (s, a) => (W.zero, a, s) - }) + }) ) def zoom[S0, S3, S <: S1](l: LensFamily[S0, S3, S, S2])( diff --git a/repos/scalaz/core/src/main/scala/scalaz/StoreT.scala b/repos/scalaz/core/src/main/scala/scalaz/StoreT.scala index fa689f705e8..3f439acbee1 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/StoreT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/StoreT.scala @@ -78,9 +78,7 @@ final case class IndexedStoreT[F[_], +I, A, B](run: (F[A => B], I)) { def product[J, C, D](that: IndexedStoreT[F, J, C, D])( implicit M: Bind[F]): IndexedStoreT[F, (I, J), (A, C), (B, D)] = IndexedStoreT(M.bind(set) { s => - M.map(that.set)(t => { (ac: (A, C)) => - (s(ac._1), t(ac._2)) - }) + M.map(that.set)(t => { (ac: (A, C)) => (s(ac._1), t(ac._2)) }) }, (pos, that.pos)) /** alias for `product` */ diff --git a/repos/scalaz/core/src/main/scala/scalaz/TreeLoc.scala b/repos/scalaz/core/src/main/scala/scalaz/TreeLoc.scala index 8afee0c5098..f63da569271 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/TreeLoc.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/TreeLoc.scala @@ -181,7 +181,7 @@ final case class TreeLoc[A]( val f = () => std.stream.unfold(tz.firstChild) { (o: Option[TreeLoc[A]]) => for (c <- o) yield (c, c.right) - } + } (tz, f) } def uf[A]( @@ -298,7 +298,7 @@ sealed abstract class TreeLocInstances { lefts = lefts.head #:: lefts.tail, rights = rights.head #:: rights.tail, parents = parents.head #:: parents.tail - ) + ) ) case Empty => G.apply3(fa.tree.traverse1(f), lefts1, rights1)( @@ -308,7 +308,7 @@ sealed abstract class TreeLocInstances { lefts = lefts.head #:: lefts.tail, rights = rights.head #:: rights.tail, parents = Empty - ) + ) ) } case Empty => @@ -324,7 +324,7 @@ sealed abstract class TreeLocInstances { lefts = lefts.head #:: lefts.tail, rights = Empty, parents = parents.head #:: parents.tail - ) + ) ) case Empty => G.apply2(fa.tree.traverse1(f), lefts1)( @@ -334,7 +334,7 @@ sealed abstract class TreeLocInstances { lefts = lefts.head #:: lefts.tail, rights = Empty, parents = Empty - ) + ) ) } } @@ -354,7 +354,7 @@ sealed abstract class TreeLocInstances { lefts = Empty, rights = rights.head #:: rights.tail, parents = parents.head #:: parents.tail - ) + ) ) case Empty => G.apply2(fa.tree.traverse1(f), rights1)( @@ -364,7 +364,7 @@ sealed abstract class TreeLocInstances { lefts = Empty, rights = rights.head #:: rights.tail, parents = Empty - ) + ) ) } case Empty => @@ -379,7 +379,7 @@ sealed abstract class TreeLocInstances { lefts = Empty, rights = Empty, parents = parents.head #:: parents.tail - ) + ) ) case Empty => G.map(fa.tree.traverse1(f))(t => diff --git a/repos/scalaz/core/src/main/scala/scalaz/WriterT.scala b/repos/scalaz/core/src/main/scala/scalaz/WriterT.scala index 8e88ffdbc34..56032d023f0 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/WriterT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/WriterT.scala @@ -102,7 +102,7 @@ final case class WriterT[F[_], W, A](run: F[(W, A)]) { self => (r, s) => F.map(self.run) { case (w, a) => (w, a, s) - } + } ) def wpoint[G[_]]( diff --git a/repos/scalaz/core/src/main/scala/scalaz/std/List.scala b/repos/scalaz/core/src/main/scala/scalaz/std/List.scala index 6d92817d8f3..36b562846dc 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/std/List.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/std/List.scala @@ -58,8 +58,7 @@ trait ListInstances extends ListInstances0 { case (ah :: at, bh :: bt) => loop(at, bt, f(\&/.Both(ah, bh)) :: accum) } - (a, b) => - loop(a, b, Nil) + (a, b) => loop(a, b, Nil) } def traverseImpl[F[_], A, B](l: List[A])(f: A => F[B])( implicit F: Applicative[F]) = { @@ -163,9 +162,9 @@ trait ListInstances extends ListInstances0 { } "[" +: (as match { - case Nil => Cord() - case x :: xs => commaSep(xs, Show[A].show(x)) - }) :+ "]" + case Nil => Cord() + case x :: xs => commaSep(xs, Show[A].show(x)) + }) :+ "]" } } diff --git a/repos/scalaz/effect/src/main/scala/scalaz/effect/IO.scala b/repos/scalaz/effect/src/main/scala/scalaz/effect/IO.scala index bb79c9a7756..bab7c5a2ff8 100644 --- a/repos/scalaz/effect/src/main/scala/scalaz/effect/IO.scala +++ b/repos/scalaz/effect/src/main/scala/scalaz/effect/IO.scala @@ -57,14 +57,14 @@ sealed abstract class IO[A] { io(rw => apply(rw) map { case (nw, a) => (nw, f(a)) - }) + }) /** Continues this action with the given action. */ def flatMap[B](f: A => IO[B]): IO[B] = io(rw => apply(rw) flatMap { case (nw, a) => f(a)(nw) - }) + }) /** Lift this action to a given IO-like monad. */ def liftIO[M[_]](implicit m: MonadIO[M]): M[A] = @@ -73,9 +73,11 @@ sealed abstract class IO[A] { /** Executes the handler if an exception is raised. */ def except(handler: Throwable => IO[A]): IO[A] = io(rw => - try { Free.pure(this(rw).run) } catch { + try { + Free.pure(this(rw).run) + } catch { case e: Throwable => handler(e)(rw) - }) + }) /** * Executes the handler for exceptions that are raised and match the given predicate. @@ -86,7 +88,7 @@ sealed abstract class IO[A] { p(e) match { case Some(z) => handler(z) case None => throw e - }) + }) /** * Returns a disjunction result which is right if no exception was raised, or left if an diff --git a/repos/scalaz/effect/src/main/scala/scalaz/effect/IoExceptionOr.scala b/repos/scalaz/effect/src/main/scala/scalaz/effect/IoExceptionOr.scala index 57d7b7c1c80..8ff0c3b31cb 100644 --- a/repos/scalaz/effect/src/main/scala/scalaz/effect/IoExceptionOr.scala +++ b/repos/scalaz/effect/src/main/scala/scalaz/effect/IoExceptionOr.scala @@ -42,7 +42,7 @@ object IoExceptionOr { new IoExceptionOr[A] { def fold[X](ioException: IoException => X, or: A => X) = ioException(e) - } + } def ioExceptionOr[A](a: A): IoExceptionOr[A] = new IoExceptionOr[A] { def fold[X](ioException: IoException => X, or: A => X) = diff --git a/repos/scalaz/effect/src/main/scala/scalaz/effect/MonadCatchIO.scala b/repos/scalaz/effect/src/main/scala/scalaz/effect/MonadCatchIO.scala index 100ae1313c6..6c515f2bfb7 100644 --- a/repos/scalaz/effect/src/main/scala/scalaz/effect/MonadCatchIO.scala +++ b/repos/scalaz/effect/src/main/scala/scalaz/effect/MonadCatchIO.scala @@ -28,7 +28,7 @@ sealed abstract class MonadCatchIOFunctions { p(e) match { case Some(z) => handler(z) case None => throw e - }) + }) /** * Returns a disjunction result which is right if no exception was raised, or left if an diff --git a/repos/scalaz/effect/src/main/scala/scalaz/effect/ST.scala b/repos/scalaz/effect/src/main/scala/scalaz/effect/ST.scala index 4e35f95c1ec..158e920bf86 100644 --- a/repos/scalaz/effect/src/main/scala/scalaz/effect/ST.scala +++ b/repos/scalaz/effect/src/main/scala/scalaz/effect/ST.scala @@ -131,13 +131,13 @@ sealed abstract class ST[S, A] { st(s => apply(s) match { case (ns, a) => g(a)(ns) - }) + }) def map[B](g: A => B): ST[S, B] = st(s => apply(s) match { case (ns, a) => (ns, g(a)) - }) + }) } object ST extends STInstances { diff --git a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Enumeratee2T.scala b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Enumeratee2T.scala index ebf1ff9d3b3..5e57c155e76 100644 --- a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Enumeratee2T.scala +++ b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Enumeratee2T.scala @@ -105,7 +105,7 @@ trait Enumeratee2TFunctions { in.flatMap(_.middleOr(emptyInput[(J, K)]) { elInput(_) }) contf(nextInput) >>== (s => cstep(s).pointI) - }, + }, done = (a, r) => sdone( sdone(a, if (r.isEof) eofInput else emptyInput), @@ -175,7 +175,7 @@ trait Enumeratee2TFunctions { } contf(nextInput) >>== (s => cstep(s).pointI) - }, + }, done = (a, r) => sdone( sdone(a, if (r.isEof) eofInput else emptyInput), diff --git a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumerateeT.scala b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumerateeT.scala index 9fd4780a692..50ca2261883 100644 --- a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumerateeT.scala +++ b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumerateeT.scala @@ -53,7 +53,7 @@ trait EnumerateeTFunctions { empty = contf(emptyInput) >>== loop, eof = done(step, emptyInput) ) - }, + }, done = (a, _) => done(sdone(a, emptyInput), emptyInput) ) } @@ -117,8 +117,7 @@ trait EnumerateeTFunctions { } } - s => - step(s, emptyInput).map(sdone(_, emptyInput)) + s => step(s, emptyInput).map(sdone(_, emptyInput)) } } diff --git a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala index eeaa649f47c..a354b57d2c3 100644 --- a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala +++ b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/EnumeratorT.scala @@ -72,7 +72,7 @@ trait EnumeratorT[E, F[_]] { self => cont = k => k(eofInput) >>== { s => s.mapContOr(_ => sys.error("diverging iteratee"), check(s)) - }, + }, done = (a, _) => step.mapCont(f => f(elInput(a))) ) @@ -166,7 +166,7 @@ trait EnumeratorTFunctions { case h #:: t => s.mapCont(k => k(elInput(h)) >>== enumStream[E, F](t).apply[A]) case _ => s.pointI - } + } } def enumList[E, F[_]: Monad](xs: List[E]): EnumeratorT[E, F] = @@ -177,7 +177,7 @@ trait EnumeratorTFunctions { case h :: t => s.mapCont(k => k(elInput(h)) >>== enumList[E, F](t).apply[A]) case Nil => s.pointI - } + } } def enumIterator[E, F[_]](x: => Iterator[E])( @@ -212,7 +212,7 @@ trait EnumeratorTFunctions { if (gotdata(i)) k(elInput(i.map(render))) >>== apply[A] else s.pointI } - ) + ) } def enumReader[F[_]](r: => java.io.Reader)( diff --git a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Input.scala b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Input.scala index e40154a2216..1ada27f3c12 100644 --- a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Input.scala +++ b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Input.scala @@ -123,7 +123,7 @@ sealed abstract class InputInstances { empty = elInput(xa), el = ya => elInput(A.append(xa, ya)), eof = eofInput - ), + ), eof = eofInput ) } diff --git a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Iteratee.scala b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Iteratee.scala index bb3faefff58..f8755aca40c 100644 --- a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Iteratee.scala +++ b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/Iteratee.scala @@ -29,8 +29,8 @@ trait IterateeFunctions { h <- k2(in) t <- this.repeatBuild[E, A, F](iter) } yield mon.append(acc, mon.append(F.point(h), t))) - ) - ), + ) + ), empty = cont(step(acc)), eof = done(acc, eofInput) ) diff --git a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/IterateeT.scala b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/IterateeT.scala index 3e0e36d2444..f1e9240627a 100644 --- a/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/IterateeT.scala +++ b/repos/scalaz/iteratee/src/main/scala/scalaz/iteratee/IterateeT.scala @@ -35,7 +35,7 @@ sealed abstract class IterateeT[E, F[_], A] { s.fold( cont = _ => sys.error("diverging iteratee"), done = (a, _) => F.point(a) - )) + )) } def flatMap[B](f: A => IterateeT[E, F, B])( @@ -52,7 +52,7 @@ sealed abstract class IterateeT[E, F[_], A] { cont = kk => kk(i).value, done = (aa, _) => F.point(StepT.sdone[E, F, B](aa, i)) )) - ))) + ))) through(this) } @@ -134,7 +134,7 @@ sealed abstract class IterateeT[E, F[_], A] { cont = k => k(eofInput) >>== { s => s.mapContOr(_ => sys.error("diverging iteratee"), check(s)) - }, + }, done = (a, _) => M0.point(a) ) @@ -155,7 +155,7 @@ sealed abstract class IterateeT[E, F[_], A] { isEof[E, F] flatMap { eof => if (eof) done(scont(k), eofInput) else step(k) - } + } def step: ( Input[A] => IterateeT[A, F, B]) => IterateeT[E, F, StepT[A, F, B]] = k => flatMap(a => k(elInput(a)) >>== loop) @@ -186,7 +186,7 @@ sealed abstract class IterateeT[E, F[_], A] { case _ => cont(loop(xx, yy)) } } - }, + }, empty = cont(loop(x, y)), eof = (x &= enumEofT[E, F]) flatMap (a => (y &= enumEofT[E, F]) map (b => (a, b))) diff --git a/repos/scalaz/project/build.scala b/repos/scalaz/project/build.scala index 96bb472106e..6cfa93c31b1 100644 --- a/repos/scalaz/project/build.scala +++ b/repos/scalaz/project/build.scala @@ -223,26 +223,26 @@ object build extends Build { { - Seq( - ("runarorama", "Runar Bjarnason"), - ("pchiusano", "Paul Chiusano"), - ("tonymorris", "Tony Morris"), - ("retronym", "Jason Zaugg"), - ("ekmett", "Edward Kmett"), - ("alexeyr", "Alexey Romanov"), - ("copumpkin", "Daniel Peebles"), - ("rwallace", "Richard Wallace"), - ("nuttycom", "Kris Nuttycombe"), - ("larsrh", "Lars Hupel") - ).map { - case (id, name) => - + Seq( + ("runarorama", "Runar Bjarnason"), + ("pchiusano", "Paul Chiusano"), + ("tonymorris", "Tony Morris"), + ("retronym", "Jason Zaugg"), + ("ekmett", "Edward Kmett"), + ("alexeyr", "Alexey Romanov"), + ("copumpkin", "Daniel Peebles"), + ("rwallace", "Richard Wallace"), + ("nuttycom", "Kris Nuttycombe"), + ("larsrh", "Lars Hupel") + ).map { + case (id, name) => + {id} {name} http://github.com/{id} - } } + } ), // kind-projector plugin resolvers += Resolver.sonatypeRepo("releases"), diff --git a/repos/scalaz/tests/src/test/scala/scalaz/Foldable1Test.scala b/repos/scalaz/tests/src/test/scala/scalaz/Foldable1Test.scala index 8166852d3ce..c79d7283067 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/Foldable1Test.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/Foldable1Test.scala @@ -10,7 +10,7 @@ object Foldable1Test extends SpecLite { (xs.maximum1) must_=== (xs.list.toList.max) } "maximumOf1" ! forAll { (xs: NonEmptyList[Int]) => - val f: Int => Double = 1D + _ + val f: Int => Double = 1d + _ (xs maximumOf1 f) must_=== ((xs.list.toList.iterator map f).max) } "maximumBy1" ! forAll { (xs: NonEmptyList[Int]) => @@ -22,7 +22,7 @@ object Foldable1Test extends SpecLite { (xs.minimum1) must_=== (xs.list.toList.min) } "minimumOf1" ! forAll { (xs: NonEmptyList[Int]) => - val f: Int => Double = 1D + _ + val f: Int => Double = 1d + _ (xs minimumOf1 f) must_=== ((xs.list.toList.iterator map f).min) } "minimumBy1" ! forAll { (xs: NonEmptyList[Int]) => diff --git a/repos/scalaz/tests/src/test/scala/scalaz/FoldableTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/FoldableTest.scala index 89493d0bc9d..5a59b677421 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/FoldableTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/FoldableTest.scala @@ -16,7 +16,7 @@ object FoldableTest extends SpecLite { else (xs.maximum) must_== Some((xs.max)) } "maximumOf" ! forAll { (xs: List[Int]) => - val f: Int => Double = 1D + _ + val f: Int => Double = 1d + _ if (xs.isEmpty) (xs maximumOf f) must_== (None) else (xs maximumOf f) must_== (Some((xs.iterator map f).max)) } @@ -30,7 +30,7 @@ object FoldableTest extends SpecLite { else (xs.minimum) must_== Some(xs.min) } "minimumOf" ! forAll { (xs: List[Int]) => - val f: Int => Double = 1D + _ + val f: Int => Double = 1d + _ if (xs.isEmpty) (xs minimumOf f) must_== None else (xs minimumOf f) must_== Some((xs.iterator map f).min) } diff --git a/repos/scalaz/tests/src/test/scala/scalaz/StreamTTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/StreamTTest.scala index ead679f7aa5..30734b3d326 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/StreamTTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/StreamTTest.scala @@ -14,8 +14,7 @@ object StreamTTest extends SpecLite { "fromStream / asStream" ! forAll { import Id._ - (as: Stream[Int]) => - StreamT.fromStream[Id, Int](as).asStream must_=== (as) + (as: Stream[Int]) => StreamT.fromStream[Id, Int](as).asStream must_=== (as) } "asStream" should { diff --git a/repos/scalaz/tests/src/test/scala/scalaz/TraverseTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/TraverseTest.scala index 6227d39826e..6768346d134 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/TraverseTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/TraverseTest.scala @@ -105,12 +105,11 @@ object TraverseTest extends SpecLite { "mapAccumL/R" ! forAll { val L = Traverse[List]; import L.traverseSyntax._ - (l: List[Int]) => - { - val (acc, l2) = l.mapAccumL(List[Int]())((acc, a) => (a :: acc, a)) - val (acc2, l3) = l.mapAccumR(List[Int]())((acc, a) => (a :: acc, a)) - acc == l.reverse && l2 == l && acc2 == l3 && l3 == l - } + (l: List[Int]) => { + val (acc, l2) = l.mapAccumL(List[Int]())((acc, a) => (a :: acc, a)) + val (acc2, l3) = l.mapAccumR(List[Int]())((acc, a) => (a :: acc, a)) + acc == l.reverse && l2 == l && acc2 == l3 && l3 == l + } } "double reverse" ! forAll { (is: List[Int]) => diff --git a/repos/scalaz/tests/src/test/scala/scalaz/ZipperTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/ZipperTest.scala index b9e23c2dbd0..a3d909df7cc 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/ZipperTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/ZipperTest.scala @@ -448,8 +448,10 @@ object ZipperTest extends SpecLite { "findBy should not blow the stack" ! prop { z: Zipper[Int] => var limit = 10 * 1000 - z.findBy(z => if (limit > 0) { limit -= 1; some(z.nextC) } else none)(x => - false) + z.findBy(z => + if (limit > 0) { + limit -= 1; some(z.nextC) + } else none)(x => false) true } diff --git a/repos/scalaz/tests/src/test/scala/scalaz/std/ListTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/std/ListTest.scala index 40aa3ac22ff..08a702a5219 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/std/ListTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/std/ListTest.scala @@ -42,8 +42,7 @@ object ListTest extends SpecLite { case x :: Nil => x :: Nil case h :: t => h :: a :: intersperse(t, a) } - (a: List[Int], b: Int) => - (a.intersperse(b) must_=== (intersperse(a, b))) + (a: List[Int], b: Int) => (a.intersperse(b) must_=== (intersperse(a, b))) } "groupWhenM[Id].flatten is identity" ! forAll { @@ -119,7 +118,7 @@ object ListTest extends SpecLite { val j = i + (if (f(a)) 0 else 1) val done = j >= n (j, !done) - }) + }) .evalZero[Int] val actual = takeWhileN("/abc/def/hij/klm".toList, 4)(_ != '/').mkString diff --git a/repos/scalaz/tests/src/test/scala/scalaz/std/MapTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/std/MapTest.scala index b3924d256c0..0f82c9c3e33 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/std/MapTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/std/MapTest.scala @@ -47,18 +47,17 @@ abstract class XMapTest[ "map ordering" ! forAll { val O = implicitly[Order[Map[String, Int]]] val O2 = SOrdering.Iterable(implicitly[SOrdering[(String, Int)]]) - (kvs: List[(String, Int)], kvs2: List[(String, Int)]) => - { - val (m1, m2) = (fromSeq(kvs: _*), fromSeq(kvs2: _*)) - ((m1.size == kvs.size) && (m2.size == kvs2.size)) ==> { - val l: Boolean = O.lessThan(m1, m2) - val r: Boolean = - (if (m1.size < m2.size) true - else if (m1.size > m2.size) false - else O2.lt(kvs.sortBy(_._1), kvs2.sortBy(_._1))) - l == r - } + (kvs: List[(String, Int)], kvs2: List[(String, Int)]) => { + val (m1, m2) = (fromSeq(kvs: _*), fromSeq(kvs2: _*)) + ((m1.size == kvs.size) && (m2.size == kvs2.size)) ==> { + val l: Boolean = O.lessThan(m1, m2) + val r: Boolean = + (if (m1.size < m2.size) true + else if (m1.size > m2.size) false + else O2.lt(kvs.sortBy(_._1), kvs2.sortBy(_._1))) + l == r } + } } "align" ! forAll { (a: Map[Int, String], b: Map[Int, Long]) => diff --git a/repos/scalaz/tests/src/test/scala/scalaz/std/StreamTest.scala b/repos/scalaz/tests/src/test/scala/scalaz/std/StreamTest.scala index 7554c2ffb68..614b7869f59 100644 --- a/repos/scalaz/tests/src/test/scala/scalaz/std/StreamTest.scala +++ b/repos/scalaz/tests/src/test/scala/scalaz/std/StreamTest.scala @@ -60,8 +60,7 @@ object StreamTest extends SpecLite { case h #:: t => h #:: loop(t) } } - (a: Stream[Int], b: Int) => - (a.intersperse(b) must_=== (intersperse(a, b))) + (a: Stream[Int], b: Int) => (a.intersperse(b) must_=== (intersperse(a, b))) } "foldl is foldLeft" ! forAll { (rnge: Stream[List[Int]]) => diff --git a/repos/scalding/scalding-args/src/main/scala/com/twitter/scalding/Args.scala b/repos/scalding/scalding-args/src/main/scala/com/twitter/scalding/Args.scala index 4a2b5a55f85..81a52dcb8b4 100644 --- a/repos/scalding/scalding-args/src/main/scala/com/twitter/scalding/Args.scala +++ b/repos/scalding/scalding-args/src/main/scala/com/twitter/scalding/Args.scala @@ -186,7 +186,7 @@ class Args(val m: Map[String, List[String]]) extends java.io.Serializable { catch { case NonFatal(_) => throw ArgsException(s"Invalid value ${value} for -- ${key}") - }) + }) .getOrElse(default) } @@ -207,7 +207,7 @@ class Args(val m: Map[String, List[String]]) extends java.io.Serializable { catch { case NonFatal(_) => throw ArgsException(s"Invalid value ${value} for -- ${key}") - }) + }) .getOrElse(default) } @@ -228,7 +228,7 @@ class Args(val m: Map[String, List[String]]) extends java.io.Serializable { catch { case NonFatal(_) => throw ArgsException(s"Invalid value ${value} for -- ${key}") - }) + }) .getOrElse(default) } @@ -249,7 +249,7 @@ class Args(val m: Map[String, List[String]]) extends java.io.Serializable { catch { case NonFatal(_) => throw ArgsException(s"Invalid value ${value} for -- ${key}") - }) + }) .getOrElse(default) } diff --git a/repos/scalding/scalding-commons/src/main/scala/com/twitter/scalding/examples/PageRank.scala b/repos/scalding/scalding-commons/src/main/scala/com/twitter/scalding/examples/PageRank.scala index 94b10a93296..3882d4ae93a 100644 --- a/repos/scalding/scalding-commons/src/main/scala/com/twitter/scalding/examples/PageRank.scala +++ b/repos/scalding/scalding-commons/src/main/scala/com/twitter/scalding/examples/PageRank.scala @@ -106,7 +106,9 @@ class PageRank(args: Args) extends Job(args) { */ @tailrec final def doPageRank(steps: Int)(pagerank: RichPipe): RichPipe = { - if (steps <= 0) { pagerank } else { + if (steps <= 0) { + pagerank + } else { val nodeRows = pagerank //remove any EDGE rows from the previous loop .filter('rowtype) { (rowtype: Int) => diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/JobTest.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/JobTest.scala index 03403d73e62..adfd89b2409 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/JobTest.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/JobTest.scala @@ -249,7 +249,11 @@ class JobTest(cons: (Args) => Job) { // Make sure to clean the state: job.clear - val next: Option[Job] = if (runNext) { job.next } else { None } + val next: Option[Job] = if (runNext) { + job.next + } else { + None + } next match { case Some(nextjob) => runJob(nextjob, runNext) case None => { diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/LibJarsExpansion.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/LibJarsExpansion.scala index edb4b29d0cd..5451c9ce4c2 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/LibJarsExpansion.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/LibJarsExpansion.scala @@ -48,9 +48,9 @@ object ExpandLibJarsGlobs { else root #:: (root.listFiles match { - case null => Stream.empty - case files => files.toStream.flatMap(tree(_, skipHidden)) - }) + case null => Stream.empty + case files => files.toStream.flatMap(tree(_, skipHidden)) + }) def fromGlob(glob: String, filesOnly: Boolean = true): Stream[Path] = { import java.nio._ diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/SkewReplication.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/SkewReplication.scala index 435912d7aba..7d61264e273 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/SkewReplication.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/SkewReplication.scala @@ -59,8 +59,8 @@ case class SkewReplicationA(replicationFactor: Int = 1) * See https://github.com/twitter/scalding/pull/229#issuecomment-10792296 */ case class SkewReplicationB( - maxKeysInMemory: Int = 1E6.toInt, - maxReducerOutput: Int = 1E7.toInt) + maxKeysInMemory: Int = 1e6.toInt, + maxReducerOutput: Int = 1e7.toInt) extends SkewReplication { override def getReplications( diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Stats.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Stats.scala index 61a3e9ca254..02ad5b4a5e0 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Stats.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Stats.scala @@ -197,11 +197,10 @@ object RuntimeStats extends java.io.Serializable { def getKeepAliveFunction(implicit flowDef: FlowDef): () => Unit = { // Don't capture the flowDef, just the id val id = UniqueID.getIDFor(flowDef) - () => - { - val flowProcess = RuntimeStats.getFlowProcessForUniqueId(id) - flowProcess.keepAlive - } + () => { + val flowProcess = RuntimeStats.getFlowProcessForUniqueId(id) + flowProcess.keepAlive + } } } diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Tool.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Tool.scala index 36378778af0..bb1a4421c61 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Tool.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/Tool.scala @@ -142,7 +142,9 @@ class Tool extends Configured with HTool { "Job failed to run: " + jobName + (if (cnt > 0) { " child: " + cnt.toString + ", class: " + j.getClass.getName - } else { "" })) + } else { + "" + })) } } //start a counter to see how deep we recurse: diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix.scala index 6acfbb8d61e..a32b9e2f11a 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix.scala @@ -372,7 +372,12 @@ class Matrix[RowT, ColT, ValT]( def binarizeAs[NewValT]( implicit mon: Monoid[ValT], ring: Ring[NewValT]): Matrix[RowT, ColT, NewValT] = { - mapValues(x => if (mon.isNonZero(x)) { ring.one } else { ring.zero })(ring) + mapValues(x => + if (mon.isNonZero(x)) { + ring.one + } else { + ring.zero + })(ring) } // Row Operations @@ -1211,7 +1216,9 @@ class RowVector[ColT, ValT]( def topElems(k: Int)(implicit ord: Ordering[ValT]): RowVector[ColT, ValT] = { // TODO this should be tunable: - if (k < 1000) { topWithTiny(k) } else { + if (k < 1000) { + topWithTiny(k) + } else { val fieldName = valS.toString val ordValS = new Fields(fieldName) ordValS.setComparator(fieldName, ord) @@ -1355,7 +1362,9 @@ class ColVector[RowT, ValT]( } def topElems(k: Int)(implicit ord: Ordering[ValT]): ColVector[RowT, ValT] = { - if (k < 1000) { topWithTiny(k) } else { + if (k < 1000) { + topWithTiny(k) + } else { val newPipe = pipe .groupAll { _.sortBy(valS).reverse.take(k) diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix2.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix2.scala index dc8ae28958e..2506c73980b 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix2.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/Matrix2.scala @@ -163,7 +163,11 @@ sealed trait Matrix2[R, C, V] extends Serializable { lazy val newPipe = toTypedPipe .map { case (r, c, x) => - (r, c, if (mon.isNonZero(x)) { ring.one } else { ring.zero }) + (r, c, if (mon.isNonZero(x)) { + ring.one + } else { + ring.zero + }) } .filter { kv => ring.isNonZero(kv._3) diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/SizeHint.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/SizeHint.scala index 8aa03f1729e..cd66aa42861 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/SizeHint.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/mathematics/SizeHint.scala @@ -88,7 +88,10 @@ case class FiniteHint(rows: BigInt = -1L, cols: BigInt = -1L) extends SizeHint { case sp @ SparseHint(_, _, _) => (sp #*# this) } } - def total = if (rows >= 0 && cols >= 0) { Some(rows * cols) } else None + def total = + if (rows >= 0 && cols >= 0) { + Some(rows * cols) + } else None def setCols(ncols: Long) = FiniteHint(rows, ncols) def setRows(nrows: Long) = FiniteHint(nrows, cols) def setColsToRows = FiniteHint(rows, rows) diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/HashEqualsArrayWrapper.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/HashEqualsArrayWrapper.scala index 39afa993f0c..1950ad78635 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/HashEqualsArrayWrapper.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/HashEqualsArrayWrapper.scala @@ -30,32 +30,23 @@ object HashEqualsArrayWrapper { val fn = clazz match { case c if classOf[Array[Long]].equals(c) => - a: Array[Long] => - new HashEqualsLongArrayWrapper(a) + a: Array[Long] => new HashEqualsLongArrayWrapper(a) case c if classOf[Array[Int]].equals(c) => - a: Array[Int] => - new HashEqualsIntArrayWrapper(a) + a: Array[Int] => new HashEqualsIntArrayWrapper(a) case c if classOf[Array[Short]].equals(c) => - a: Array[Short] => - new HashEqualsShortArrayWrapper(a) + a: Array[Short] => new HashEqualsShortArrayWrapper(a) case c if classOf[Array[Char]].equals(c) => - a: Array[Char] => - new HashEqualsCharArrayWrapper(a) + a: Array[Char] => new HashEqualsCharArrayWrapper(a) case c if classOf[Array[Byte]].equals(c) => - a: Array[Byte] => - new HashEqualsByteArrayWrapper(a) + a: Array[Byte] => new HashEqualsByteArrayWrapper(a) case c if classOf[Array[Boolean]].equals(c) => - a: Array[Boolean] => - new HashEqualsBooleanArrayWrapper(a) + a: Array[Boolean] => new HashEqualsBooleanArrayWrapper(a) case c if classOf[Array[Float]].equals(c) => - a: Array[Float] => - new HashEqualsFloatArrayWrapper(a) + a: Array[Float] => new HashEqualsFloatArrayWrapper(a) case c if classOf[Array[Double]].equals(c) => - a: Array[Double] => - new HashEqualsDoubleArrayWrapper(a) + a: Array[Double] => new HashEqualsDoubleArrayWrapper(a) case c => - a: Array[T] => - new HashEqualsObjectArrayWrapper(a) + a: Array[T] => new HashEqualsObjectArrayWrapper(a) } fn.asInstanceOf[(Array[T] => HashEqualsArrayWrapper[T])] diff --git a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/TypedPipe.scala b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/TypedPipe.scala index d72c90b6a16..15e008d808d 100644 --- a/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/TypedPipe.scala +++ b/repos/scalding/scalding-core/src/main/scala/com/twitter/scalding/typed/TypedPipe.scala @@ -798,7 +798,7 @@ trait TypedPipe[+T] extends Serializable { */ def sketch[K, V]( reducers: Int, - eps: Double = 1.0E-5, //272k width = 1MB per row + eps: Double = 1.0e-5, //272k width = 1MB per row delta: Double = 0.01, //5 rows (= 5 hashes) seed: Int = 12345)( implicit ev: TypedPipe[T] <:< TypedPipe[(K, V)], diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/BlockJoinTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/BlockJoinTest.scala index 382c0f9247c..b8876f460c9 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/BlockJoinTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/BlockJoinTest.scala @@ -99,21 +99,21 @@ class BlockJoinPipeTest extends WordSpec with Matchers { "throw an exception when used with OuterJoin" in { an[InvalidJoinModeException] should be thrownBy runJobWithArguments( joiner = "o") { _ => - } + } } "throw an exception when used with an invalid LeftJoin" in { an[InvalidJoinModeException] should be thrownBy runJobWithArguments( joiner = "l", left = 2) { _ => - } + } } "throw an exception when used with an invalid RightJoin" in { an[InvalidJoinModeException] should be thrownBy runJobWithArguments( joiner = "r", right = 2) { _ => - } + } } } } diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/ReduceOperationsTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/ReduceOperationsTest.scala index 330d10e3f86..9e1c2041d54 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/ReduceOperationsTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/ReduceOperationsTest.scala @@ -23,7 +23,9 @@ class SortWithTakeJob(args: Args) extends Job(args) { .groupBy('key) { _.sortWithTake[(Long, Double)]((('item_id, 'score), 'top_items), 5) { (item_0: (Long, Double), item_1: (Long, Double)) => - if (item_0._2 == item_1._2) { item_0._1 > item_1._1 } else { + if (item_0._2 == item_1._2) { + item_0._1 > item_1._1 + } else { item_0._2 > item_1._2 } } diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedFieldsTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedFieldsTest.scala index 751d041244a..ab9b50aa04a 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedFieldsTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedFieldsTest.scala @@ -60,7 +60,7 @@ class TypedFieldsTest extends WordSpec with Matchers { TextLine("inputFile"), List("0" -> "5,foo", "1" -> "6,bar", "2" -> "9,foo")) .sink[(Opaque, Int)](Tsv("outputFile")) { _ => - } + } .run .finish } diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedPipeTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedPipeTest.scala index 5f3cb5c8f62..2d3fa4466af 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedPipeTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/TypedPipeTest.scala @@ -28,7 +28,9 @@ import typed.MultiJoin object TUtil { def printStack(fn: => Unit) { - try { fn } catch { case e: Throwable => e.printStackTrace; throw e } + try { + fn + } catch { case e: Throwable => e.printStackTrace; throw e } } } diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/bdd/TypedApiTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/bdd/TypedApiTest.scala index 723026bf501..664036617b6 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/bdd/TypedApiTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/bdd/TypedApiTest.scala @@ -155,7 +155,7 @@ class TypedApiTest extends WordSpec with Matchers with TBddDsl { } And { List(("user1", 40), ("user2", 22)) } And { - List(("user1", 1000l), ("user2", 800l)) + List(("user1", 1000L), ("user2", 800L)) } And { List(("user1", true), ("user2", false)) } When { pipes: List[TypedPipe[_]] => diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/MatrixTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/MatrixTest.scala index 9936358d30d..a0784435736 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/MatrixTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/MatrixTest.scala @@ -22,7 +22,9 @@ import com.twitter.algebird.Group object TUtil { def printStack(fn: => Unit) { - try { fn } catch { case e: Throwable => e.printStackTrace; throw e } + try { + fn + } catch { case e: Throwable => e.printStackTrace; throw e } } } diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/TypedSimilarityTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/TypedSimilarityTest.scala index 9bbdb6150d4..1cbb285309d 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/TypedSimilarityTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/mathematics/TypedSimilarityTest.scala @@ -75,7 +75,9 @@ class TypedSimilarityTest extends WordSpec with Matchers { val edges = (0 to nodes).flatMap { n => // try to get at least 6 edges for each node (0 to ((nodes / 5) max (6))).foldLeft(Set[(Int, Int)]()) { (set, idx) => - if (set.size > 6) { set } else { + if (set.size > 6) { + set + } else { set + (n -> rand.nextInt(nodes)) } } @@ -86,7 +88,9 @@ class TypedSimilarityTest extends WordSpec with Matchers { // try to get at least 10 edges for each node (0 to ((nodes / 5) max (10))).foldLeft(Set[(Int, Int, Double)]()) { (set, idx) => - if (set.size > 10) { set } else { + if (set.size > 10) { + set + } else { set + ((n, rand.nextInt(nodes), rand.nextDouble * MaxWeight)) } } diff --git a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/typed/MultiJoinTest.scala b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/typed/MultiJoinTest.scala index 240c5b79d7e..3e96fcbcb59 100644 --- a/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/typed/MultiJoinTest.scala +++ b/repos/scalding/scalding-core/src/test/scala/com/twitter/scalding/typed/MultiJoinTest.scala @@ -25,7 +25,7 @@ class MultiJoinTest extends WordSpec { def addKeys[V](t: Seq[V]): Seq[(Int, V)] = t.iterator.zipWithIndex.map { case (v, k) => (k, v) }.toSeq - val doubles = TypedPipe.from(addKeys(List(1.0D, 2.0D, 3.0D))) + val doubles = TypedPipe.from(addKeys(List(1.0d, 2.0d, 3.0d))) val longs = TypedPipe.from(addKeys(List(10L, 20L, 30L))) val strings = TypedPipe.from(addKeys(List("one", "two", "three"))) val sets = TypedPipe.from(addKeys(List(Set(1), Set(2), Set(3)))) diff --git a/repos/scalding/scalding-json/src/main/scala/com/twitter/scalding/JsonLine.scala b/repos/scalding/scalding-json/src/main/scala/com/twitter/scalding/JsonLine.scala index 025e64d0717..63d820d5643 100644 --- a/repos/scalding/scalding-json/src/main/scala/com/twitter/scalding/JsonLine.scala +++ b/repos/scalding/scalding-json/src/main/scala/com/twitter/scalding/JsonLine.scala @@ -107,7 +107,9 @@ object JsonLine } private[this] def typeFromManifest(m: Manifest[_]): Type = { - if (m.typeArguments.isEmpty) { m.runtimeClass } else + if (m.typeArguments.isEmpty) { + m.runtimeClass + } else new ParameterizedType { def getRawType = m.runtimeClass diff --git a/repos/scalding/scalding-parquet/src/main/scala/com/twitter/scalding/parquet/tuple/scheme/ParquetTupleConverter.scala b/repos/scalding/scalding-parquet/src/main/scala/com/twitter/scalding/parquet/tuple/scheme/ParquetTupleConverter.scala index ae4616e97dd..6fe0ab212dd 100644 --- a/repos/scalding/scalding-parquet/src/main/scala/com/twitter/scalding/parquet/tuple/scheme/ParquetTupleConverter.scala +++ b/repos/scalding/scalding-parquet/src/main/scala/com/twitter/scalding/parquet/tuple/scheme/ParquetTupleConverter.scala @@ -54,13 +54,13 @@ class StringConverter extends PrimitiveFieldConverter[String] { } class DoubleConverter extends PrimitiveFieldConverter[Double] { - override val defaultValue: Double = 0D + override val defaultValue: Double = 0d override def addDouble(v: Double): Unit = value = v } class FloatConverter extends PrimitiveFieldConverter[Float] { - override val defaultValue: Float = 0F + override val defaultValue: Float = 0f override def addFloat(v: Float): Unit = value = v } diff --git a/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/TypedParquetTupleTest.scala b/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/TypedParquetTupleTest.scala index c80326111da..70f1e119d02 100644 --- a/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/TypedParquetTupleTest.scala +++ b/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/TypedParquetTupleTest.scala @@ -43,18 +43,18 @@ object TestValues { val values = Seq( SampleClassB( "B1", - Some(4.0D), - SampleClassA(bool = true, 5, 1L, 1.2F, 1), + Some(4.0d), + SampleClassA(bool = true, 5, 1L, 1.2f, 1), List(1, 2), List(SampleClassD(1, "1"), SampleClassD(2, "2")), - Set(1D, 2D), - Set(SampleClassF(1, 1F)), + Set(1d, 2d), + Set(SampleClassF(1, 1f)), Map(1 -> "foo") ), SampleClassB( "B2", - Some(3.0D), - SampleClassA(bool = false, 4, 2L, 2.3F, 2), + Some(3.0d), + SampleClassA(bool = false, 4, 2L, 2.3f, 2), List(3, 4), Nil, Set(3, 4), @@ -67,19 +67,19 @@ object TestValues { SampleClassB( "B3", None, - SampleClassA(bool = true, 6, 3L, 3.4F, 3), + SampleClassA(bool = true, 6, 3L, 3.4f, 3), List(5, 6), List(SampleClassD(3, "3"), SampleClassD(4, "4")), Set(5, 6), - Set(SampleClassF(2, 2F))), + Set(SampleClassF(2, 2f))), SampleClassB( "B4", - Some(5.0D), - SampleClassA(bool = false, 7, 4L, 4.5F, 4), + Some(5.0d), + SampleClassA(bool = false, 7, 4L, 4.5f, 4), Nil, List(SampleClassD(5, "5"), SampleClassD(6, "6")), Set(), - Set(SampleClassF(3, 3F), SampleClassF(5, 4F)), + Set(SampleClassF(3, 3f), SampleClassF(5, 4f)), Map(3 -> "foo2"), Map(SampleClassD(0, "q") -> SampleClassF(4, 3)) ) diff --git a/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/macros/MacroUnitTests.scala b/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/macros/MacroUnitTests.scala index ecdec63e8af..6677076d203 100644 --- a/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/macros/MacroUnitTests.scala +++ b/repos/scalding/scalding-parquet/src/test/scala/com/twitter/scalding/parquet/tuple/macros/MacroUnitTests.scala @@ -258,10 +258,10 @@ class MacroUnitTests extends WordSpec with Matchers with MockitoSugar { boolean.addBoolean(true) val float = converter.getConverter(4).asPrimitiveConverter() - float.addFloat(3F) + float.addFloat(3f) val double = converter.getConverter(5).asPrimitiveConverter() - double.addDouble(4D) + double.addDouble(4d) val string = converter.getConverter(6).asPrimitiveConverter() string.addBinary(Binary.fromString("foo")) @@ -274,8 +274,8 @@ class MacroUnitTests extends WordSpec with Matchers with MockitoSugar { 1L, 2, d = true, - 3F, - 4D, + 3f, + 4d, "foo", 1) } @@ -323,12 +323,12 @@ class MacroUnitTests extends WordSpec with Matchers with MockitoSugar { b.end() val c = converter.getConverter(2).asPrimitiveConverter() - c.addDouble(4D) + c.addDouble(4d) converter.end() converter.currentValue shouldEqual SampleClassF( 0, Some(SampleClassB(SampleClassA(2, "foo"), "b1")), - 4D) + 4d) } "Generate converters for case class with list fields" in { @@ -405,7 +405,7 @@ class MacroUnitTests extends WordSpec with Matchers with MockitoSugar { "Generate write support for class with all the primitive type fields" in { val writeSupport = Macros.caseClassParquetWriteSupport[SampleClassE] - val e = SampleClassE(0, 1L, 2, d = true, 3F, 4D, "foo", 1) + val e = SampleClassE(0, 1L, 2, d = true, 3f, 4d, "foo", 1) val schema = Macros.caseClassParquetSchema[SampleClassE] val rc = new StringBuilderRecordConsumer writeSupport.writeRecord( @@ -452,7 +452,7 @@ class MacroUnitTests extends WordSpec with Matchers with MockitoSugar { val writeSupport = Macros.caseClassParquetWriteSupport[SampleClassF] val f = - SampleClassF(0, Some(SampleClassB(SampleClassA(2, "foo"), "b1")), 4D) + SampleClassF(0, Some(SampleClassB(SampleClassA(2, "foo"), "b1")), 4d) val schema = MessageTypeParser.parseMessageType(schemaString) val rc = new StringBuilderRecordConsumer @@ -485,7 +485,7 @@ class MacroUnitTests extends WordSpec with Matchers with MockitoSugar { |end message""".stripMargin //test write tuple with optional field = None - val f2 = SampleClassF(0, None, 4D) + val f2 = SampleClassF(0, None, 4d) val rc2 = new StringBuilderRecordConsumer writeSupport.writeRecord(f2, rc2, schema) rc2.writeScenario shouldEqual """start message diff --git a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/OrderedSerialization.scala b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/OrderedSerialization.scala index 9d73376a46b..e89d1a72cff 100644 --- a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/OrderedSerialization.scala +++ b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/OrderedSerialization.scala @@ -175,7 +175,9 @@ object OrderedSerialization { */ def orderingTransitive[T](implicit ordb: OrderedSerialization[T]): Law3[T] = Law3("transitivity", { (a: T, b: T, c: T) => - if (ordb.lteq(a, b) && ordb.lteq(b, c)) { ordb.lteq(a, c) } else true + if (ordb.lteq(a, b) && ordb.lteq(b, c)) { + ordb.lteq(a, c) + } else true }) /** @@ -184,7 +186,9 @@ object OrderedSerialization { */ def orderingAntisymmetry[T](implicit ordb: OrderedSerialization[T]): Law2[T] = Law2("antisymmetry", { (a: T, b: T) => - if (ordb.lteq(a, b) && ordb.lteq(b, a)) { ordb.equiv(a, b) } else true + if (ordb.lteq(a, b) && ordb.lteq(b, a)) { + ordb.equiv(a, b) + } else true }) /** diff --git a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/UnsignedComparisons.scala b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/UnsignedComparisons.scala index ad24e7d1adb..51287ffecae 100644 --- a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/UnsignedComparisons.scala +++ b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/UnsignedComparisons.scala @@ -27,7 +27,7 @@ object UnsignedComparisons { else -1 } final def unsignedIntCompare(a: Int, b: Int): Int = - java.lang.Long.compare(a.toLong & 0xFFFFFFFFL, b.toLong & 0xFFFFFFFFL) + java.lang.Long.compare(a.toLong & 0XFFFFFFFFL, b.toLong & 0XFFFFFFFFL) final def unsignedShortCompare(a: Short, b: Short): Int = Integer.compare(a & 0xFFFF, b & 0xFFFF) diff --git a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Writer.scala b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Writer.scala index f4ffb41cd01..bf3ba906ced 100644 --- a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Writer.scala +++ b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Writer.scala @@ -119,7 +119,9 @@ object Writer { @annotation.tailrec def go(p: Int): Unit = if (p == size) () - else { writerT.write(os, a(p)); go(p + 1) } + else { + writerT.write(os, a(p)); go(p + 1) + } go(0) } diff --git a/repos/shapeless/core/jvm/src/test/scala/shapeless/lazy.scala b/repos/shapeless/core/jvm/src/test/scala/shapeless/lazy.scala index 3510f2f812b..526833c2391 100644 --- a/repos/shapeless/core/jvm/src/test/scala/shapeless/lazy.scala +++ b/repos/shapeless/core/jvm/src/test/scala/shapeless/lazy.scala @@ -88,7 +88,9 @@ class LazyStrictTestsJVM { val (ccTC3SO, genTC3SO, listTC3SO) = { import TC3._ def throwsStackOverflow[T](f: => T): Boolean = - try { f; false } catch { case _: StackOverflowError => true } + try { + f; false + } catch { case _: StackOverflowError => true } ( throwsStackOverflow(TC[CC]), diff --git a/repos/shapeless/core/src/test/scala/shapeless/coproduct.scala b/repos/shapeless/core/src/test/scala/shapeless/coproduct.scala index 5285cb4b6b0..acdbbc8091e 100644 --- a/repos/shapeless/core/src/test/scala/shapeless/coproduct.scala +++ b/repos/shapeless/core/src/test/scala/shapeless/coproduct.scala @@ -256,9 +256,9 @@ class CoproductTests { // See https://github.com/milessabin/shapeless/issues/242 case class Foo[T](c: T) val existentials1 = - Coproduct[Foo[Double] :+: Foo[Float] :+: CNil](Foo(23F)).unify + Coproduct[Foo[Double] :+: Foo[Float] :+: CNil](Foo(23f)).unify val existentials2 = Coproduct[ - Foo[Double] :+: Foo[Float] :+: Foo[Int] :+: CNil](Foo(23F)).unify + Foo[Double] :+: Foo[Float] :+: Foo[Int] :+: CNil](Foo(23f)).unify typed[Foo[_ >: Float with Double <: AnyVal]](existentials1) typed[Foo[_ >: Int with Float with Double <: AnyVal]](existentials2) diff --git a/repos/shapeless/core/src/test/scala/shapeless/labelledgeneric.scala b/repos/shapeless/core/src/test/scala/shapeless/labelledgeneric.scala index 6ba3d5648d7..c51b0ee347b 100644 --- a/repos/shapeless/core/src/test/scala/shapeless/labelledgeneric.scala +++ b/repos/shapeless/core/src/test/scala/shapeless/labelledgeneric.scala @@ -66,10 +66,10 @@ object LabelledGenericTestsAux { val dpRecord = ('title ->> "Design Patterns") :: ('id ->> 201633612) :: ('authors ->> Seq( - "Erich Gamma", - "Richard Helm", - "Ralph Johnson", - "John Vlissides")) :: HNil + "Erich Gamma", + "Richard Helm", + "Ralph Johnson", + "John Vlissides")) :: HNil type BookRec = Record.`'author -> String, 'title -> String, 'id -> Int, 'price -> Double`.T diff --git a/repos/shapeless/core/src/test/scala/shapeless/typeable.scala b/repos/shapeless/core/src/test/scala/shapeless/typeable.scala index 840ebe71a8b..45b59c65e08 100644 --- a/repos/shapeless/core/src/test/scala/shapeless/typeable.scala +++ b/repos/shapeless/core/src/test/scala/shapeless/typeable.scala @@ -47,7 +47,7 @@ class TypeableTests { val cl = l.cast[Long] assertTrue(cl.isDefined) - val f: Any = 23.0F + val f: Any = 23.0f val cf = f.cast[Float] assertTrue(cf.isDefined) @@ -86,7 +86,7 @@ class TypeableTests { val cl = l.cast[jl.Long] assertTrue(cl.isDefined) - val f: Any = 23.0F + val f: Any = 23.0f val cf = f.cast[jl.Float] assertTrue(cf.isDefined) @@ -533,12 +533,12 @@ class TypeableTests { assertEquals("Typeable[A with B]", typeableString(i1)) assertEquals("Typeable[A]", typeableString(new A {})) - val o: Option[Long] = Some(4l) + val o: Option[Long] = Some(4L) assertEquals("Typeable[Option[Long]]", typeableString(o)) val e: Either[Long, String] = Right("") assertEquals("Typeable[Either[Long, String]]", typeableString(e)) - assertEquals("Typeable[Right[Long]]", typeableString(Right(3l))) + assertEquals("Typeable[Right[Long]]", typeableString(Right(3L))) val l: List[Int] = List(1, 2) assertEquals("Typeable[List[Int]]", typeableString(l)) diff --git a/repos/shapeless/examples/src/main/scala/shapeless/examples/linearalgebra.scala b/repos/shapeless/examples/src/main/scala/shapeless/examples/linearalgebra.scala index 65cd72987ae..1f30b03afa6 100644 --- a/repos/shapeless/examples/src/main/scala/shapeless/examples/linearalgebra.scala +++ b/repos/shapeless/examples/src/main/scala/shapeless/examples/linearalgebra.scala @@ -58,7 +58,7 @@ object LinearAlgebraExamples extends App { newtype( gen.from((gen.to(p) :: gen.to(other.tupled) :: HNil).transpose .map(sum))) - } + } } def Vector(p: Double) = diff --git a/repos/slick/project/Build.scala b/repos/slick/project/Build.scala index d7b203e1f9e..1a8b44e3330 100644 --- a/repos/slick/project/Build.scala +++ b/repos/slick/project/Build.scala @@ -127,7 +127,7 @@ object SlickBuild extends Build { "-implicits", "-diagrams", // requires graphviz "-groups" - )), + )), logBuffered := false, repoKind <<= (version)( v => if (v.trim.endsWith("SNAPSHOT")) "snapshots" else "releases"), @@ -247,7 +247,7 @@ object SlickBuild extends Build { v + "/slick/src/main€{FILE_PATH}.scala", "-doc-root-content", "scaladoc-root.txt" - )), + )), (sphinxEnv in Sphinx) := (sphinxEnv in Sphinx).value + ("version" -> version.value.replaceFirst("""(\d*.\d*).*""", """$1""")) + ("release" -> version.value), @@ -333,7 +333,7 @@ object SlickBuild extends Build { "-doc-source-url", "https://github.com/slick/slick/blob/" + v + "/slick-testkit/src/main€{FILE_PATH}.scala" - )), + )), testOptions += Tests.Argument( TestFrameworks.JUnit, "-q", @@ -399,7 +399,7 @@ object SlickBuild extends Build { "-doc-source-url", "https://github.com/slick/slick/blob/" + v + "/slick-codegen/src/main€{FILE_PATH}.scala" - )), + )), unmanagedResourceDirectories in Test += (baseDirectory in aRootProject).value / "common-test-resources", test := (), @@ -421,7 +421,7 @@ object SlickBuild extends Build { "-doc-source-url", "https://github.com/slick/slick/blob/" + v + "/slick-hikaricp/src/main€{FILE_PATH}.scala" - )), + )), libraryDependencies += Dependencies.hikariCP, test := (), testOnly := (), // suppress test status output diff --git a/repos/slick/reactive-streams-tests/src/test/scala/slick/test/stream/JdbcPublisherTest.scala b/repos/slick/reactive-streams-tests/src/test/scala/slick/test/stream/JdbcPublisherTest.scala index 1d666eb5b28..d983770c44c 100644 --- a/repos/slick/reactive-streams-tests/src/test/scala/slick/test/stream/JdbcPublisherTest.scala +++ b/repos/slick/reactive-streams-tests/src/test/scala/slick/test/stream/JdbcPublisherTest.scala @@ -17,7 +17,9 @@ class JdbcPublisherTest driver = "org.h2.Driver", keepAliveConnection = true) // Wait until the database has been initialized and can process queries: - try { Await.result(db.run(sql"select 1".as[Int]), Duration.Inf) } catch { + try { + Await.result(db.run(sql"select 1".as[Int]), Duration.Inf) + } catch { case NonFatal(ex) => } db diff --git a/repos/slick/slick-codegen/src/main/scala/slick/codegen/AbstractSourceCodeGenerator.scala b/repos/slick/slick-codegen/src/main/scala/slick/codegen/AbstractSourceCodeGenerator.scala index 96cae692cf6..d62549ba638 100644 --- a/repos/slick/slick-codegen/src/main/scala/slick/codegen/AbstractSourceCodeGenerator.scala +++ b/repos/slick/slick-codegen/src/main/scala/slick/codegen/AbstractSourceCodeGenerator.scala @@ -77,7 +77,7 @@ abstract class AbstractSourceCodeGenerator(model: m.Model) .map(v => s"${c.name}: ${c.exposedType} = $v") .getOrElse( s"${c.name}: ${c.exposedType}" - )) + )) .mkString(", ") if (classEnabled) { val prns = (parents.take(1).map(" extends " + _) ++ parents diff --git a/repos/slick/slick-testkit/src/codegen/scala/slick/test/codegen/GenerateRoundtripSources.scala b/repos/slick/slick-testkit/src/codegen/scala/slick/test/codegen/GenerateRoundtripSources.scala index feac0b01525..67d9f08aa72 100644 --- a/repos/slick/slick-testkit/src/codegen/scala/slick/test/codegen/GenerateRoundtripSources.scala +++ b/repos/slick/slick-testkit/src/codegen/scala/slick/test/codegen/GenerateRoundtripSources.scala @@ -31,7 +31,7 @@ object GenerateRoundtripSources { "null" // testing null as table name case n => super.tableName(n) } - }) + }) val a2 = profile .createModel(ignoreInvalidDefaults = false) .map(m => @@ -39,7 +39,7 @@ object GenerateRoundtripSources { override def Table = new Table(_) { override def autoIncLastAsOption = true } - }) + }) val db = Database.forURL( url = url, driver = jdbcDriver, @@ -193,7 +193,7 @@ class Tables(val profile: JdbcProfile) { def Int = column[Int]("Int", O.Default(-5)) def Long = column[Long]("Long", O.Default(5L)) //def java_math_BigInteger = column[java.math.BigInteger]("java_math_BigInteger") - def Float = column[Float]("Float", O.Default(9.999F)) + def Float = column[Float]("Float", O.Default(9.999f)) def Double = column[Double]("Double", O.Default(9.999)) //def java_math_BigDecimal = column[java.math.BigDecimal]("java_math_BigDecimal") def String = @@ -215,7 +215,7 @@ class Tables(val profile: JdbcProfile) { def Option_Long = column[Option[Long]]("Option_Long", O.Default(Some(5L))) //def java_math_BigInteger = column[Option[java.math.BigInteger]]("java_math_BigInteger") def Option_Float = - column[Option[Float]]("Option_Float", O.Default(Some(9.999F))) + column[Option[Float]]("Option_Float", O.Default(Some(9.999f))) def Option_Double = column[Option[Double]]("Option_Double", O.Default(Some(9.999))) //def java_math_BigDecimal = column[Option[java.math.BigDecimal]]("java_math_BigDecimal") diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JoinTest.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JoinTest.scala index 80e3931e66a..0c71784ee8b 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JoinTest.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JoinTest.scala @@ -131,8 +131,8 @@ class JoinTest extends AsyncTest[RelationalTestDB] { q5 = ((xs joinLeft ys on (_.b === _.b)) joinLeft ys on (_._1.b === _.b)) .to[Set] r5 <- mark("q5", q5.result) - r5t: Set[(((Int, String), Option[(Int, String)]), - Option[(Int, String)])] = r5 + r5t: Set[ + (((Int, String), Option[(Int, String)]), Option[(Int, String)])] = r5 _ = r5 shouldBe Set( (((1, "a"), Some((1, "a"))), Some((1, "a"))), (((2, "b"), Some((2, "b"))), Some((2, "b"))), @@ -196,8 +196,8 @@ class JoinTest extends AsyncTest[RelationalTestDB] { q10 = ((ys joinRight xs on (_.b === _.b)) joinRight xs on (_._1.map(_.b) === _.b)).to[Set] r10 <- mark("q10", q10.result) - r10t: Set[(Option[(Option[(Int, String)], (Int, String))], - (Int, String))] = r10 + r10t: Set[ + (Option[(Option[(Int, String)], (Int, String))], (Int, String))] = r10 _ = r10 shouldBe Set( (Some((Some((1, "a")), (1, "a"))), (1, "a")), (Some((Some((2, "b")), (2, "b"))), (2, "b")), diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ModelBuilderTest.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ModelBuilderTest.scala index 7c81338138d..436db0f3656 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ModelBuilderTest.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/ModelBuilderTest.scala @@ -159,7 +159,7 @@ class ModelBuilderTest extends AsyncTest[JdbcTestDB] { def Int = column[Int]("Int", O.Default(-5)) def Long = column[Long]("Long", O.Default(5L)) //def java_math_BigInteger = column[java.math.BigInteger]("java_math_BigInteger") - def Float = column[Float]("Float", O.Default(9.999F)) + def Float = column[Float]("Float", O.Default(9.999f)) def Double = column[Double]("Double", O.Default(9.999)) //def java_math_BigDecimal = column[java.math.BigDecimal]("java_math_BigDecimal") def String = @@ -180,7 +180,7 @@ class ModelBuilderTest extends AsyncTest[JdbcTestDB] { def Option_Long = column[Option[Long]]("Option_Long", O.Default(Some(-5L))) //def java_math_BigInteger = column[Option[java.math.BigInteger]]("java_math_BigInteger") def Option_Float = - column[Option[Float]]("Option_Float", O.Default(Some(9.999F))) + column[Option[Float]]("Option_Float", O.Default(Some(9.999f))) def Option_Double = column[Option[Double]]("Option_Double", O.Default(Some(9.999))) //def java_math_BigDecimal = column[Option[java.math.BigDecimal]]("java_math_BigDecimal") diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalScalarFunctionTest.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalScalarFunctionTest.scala index 89993689dbd..b51dbd36b18 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalScalarFunctionTest.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalScalarFunctionTest.scala @@ -22,8 +22,8 @@ class RelationalScalarFunctionTest extends AsyncTest[RelationalTestDB] { checkLit(-17.5), checkLit(17.5f), checkLit(-17.5f), - checkLit(42l), - checkLit(-42l), + checkLit(42L), + checkLit(-42L), checkLit("foo"), check("42".asColumnOf[Int], 42), check(LiteralColumn("foo").length, 3), diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/SimpleParentRunner.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/SimpleParentRunner.scala index 81f5c793097..4410af2815f 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/SimpleParentRunner.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/SimpleParentRunner.scala @@ -77,7 +77,9 @@ abstract class SimpleParentRunner[T](testClass: Class[_]) children = children.filter { ch => if (!filter.shouldRun(describeChild(ch))) false else - try { filter.apply(ch); true } catch { + try { + filter.apply(ch); true + } catch { case _: NoTestsRemainException => false } } diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/Testkit.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/Testkit.scala index d126752262c..5e2dc9e5a7e 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/Testkit.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/util/Testkit.scala @@ -445,7 +445,9 @@ abstract class AsyncTest[TDB >: Null <: TestDB]( def shouldFail(f: T => Unit): Unit = { var ok = false - try { f(v); ok = true } catch { case t: Throwable => } + try { + f(v); ok = true + } catch { case t: Throwable => } if (ok) fixStack(Assert.fail("Expected failure")) } diff --git a/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGenRoundTripTest.scala b/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGenRoundTripTest.scala index 7edac46a520..2c9bce6dbf4 100644 --- a/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGenRoundTripTest.scala +++ b/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGenRoundTripTest.scala @@ -58,34 +58,44 @@ class CodeGeneratorRoundTripTest(val tdb: JdbcTestDB) extends DBTest { }, (X.map(r => (r.pk, r.pk2, r.column, r.schemaNameXX, r.schemaNameX)) += (1, 1, - 1, 1.1, "test")).map { _ => - // testing name and types especially in case of collisions - import slick.lifted._ - X.map(r => { (r.pk: Rep[Int]) == null }) - X.map(r => { (r.pk2: Rep[Int]) == null }) - X.map(r => { (r.`val`: Rep[Option[Int]]) == null }) - X.map(r => { (r.column: Rep[Int]) == null }) - X.map(r => { (r.schemaNameXX: Rep[Double]) == null }) - X.map(r => { (r.schemaNameX: Rep[String]) == null }) - X.map(r => { (r.index1: Rep[Option[Int]]) == null }) - X.map(r => { (r.posts: Rep[Option[Int]]) == null }) - X.map(r => { (r.pkX: PrimaryKey) == null }) - X.map(r => { (r.postsFk: ForeignKeyQuery[Posts, PostsRow]) == null }) - X.map(r => { - (r.categoriesFk2: ForeignKeyQuery[Categories, CategoriesRow]) == null - }) - X.map(r => { - (r.categoriesFk3: ForeignKeyQuery[Categories, CategoriesRow]) == null - }) - X.map(r => { (r.index1X: Index) == null }) - X.map(r => { (r.index2: Index) == null }) - X.map(r => { (r.index1X: Index) == null }) - X.map(r => { (r.index2: Index) == null }) - X.map(r => { (r.index3: Index) == null }) - X.map(r => { (r.index4: Index) == null }) + 1, 1.1, "test")) + .map { + _ => + // testing name and types especially in case of collisions + import slick.lifted._ + X.map(r => { (r.pk: Rep[Int]) == null }) + X.map(r => { (r.pk2: Rep[Int]) == null }) + X.map(r => { (r.`val`: Rep[Option[Int]]) == null }) + X.map(r => { (r.column: Rep[Int]) == null }) + X.map(r => { (r.schemaNameXX: Rep[Double]) == null }) + X.map(r => { (r.schemaNameX: Rep[String]) == null }) + X.map(r => { (r.index1: Rep[Option[Int]]) == null }) + X.map(r => { (r.posts: Rep[Option[Int]]) == null }) + X.map(r => { (r.pkX: PrimaryKey) == null }) + X.map(r => { + (r.postsFk: ForeignKeyQuery[Posts, PostsRow]) == null + }) + X.map( + r => { + (r.categoriesFk2: ForeignKeyQuery[ + Categories, + CategoriesRow]) == null + }) + X.map( + r => { + (r.categoriesFk3: ForeignKeyQuery[ + Categories, + CategoriesRow]) == null + }) + X.map(r => { (r.index1X: Index) == null }) + X.map(r => { (r.index2: Index) == null }) + X.map(r => { (r.index1X: Index) == null }) + X.map(r => { (r.index2: Index) == null }) + X.map(r => { (r.index3: Index) == null }) + X.map(r => { (r.index4: Index) == null }) - TypeTest.map(r => { (r.pk: PrimaryKey) == null }) - } + TypeTest.map(r => { (r.pk: PrimaryKey) == null }) + } ) .withPinnedSession } diff --git a/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGeneratorAllTest.scala b/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGeneratorAllTest.scala index 88db285a062..81571fa03b4 100644 --- a/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGeneratorAllTest.scala +++ b/repos/slick/slick-testkit/src/test/scala/slick/test/codegen/CodeGeneratorAllTest.scala @@ -69,7 +69,7 @@ class CodeGeneratorAllTest(val tdb: JdbcTestDB) extends DBTest { else super.rawType } } - }) + }) val profileName = tdb.profile.getClass.toString.dropRight(1).split("[\\. ]").last diff --git a/repos/slick/slick/src/main/scala/slick/basic/BasicBackend.scala b/repos/slick/slick/src/main/scala/slick/basic/BasicBackend.scala index 9434c8be149..da7d68e335c 100644 --- a/repos/slick/slick/src/main/scala/slick/basic/BasicBackend.scala +++ b/repos/slick/slick/src/main/scala/slick/basic/BasicBackend.scala @@ -140,7 +140,9 @@ trait BasicBackend { self => val ctx = createCtx(s) if (streamLogger.isDebugEnabled) streamLogger.debug(s"Signaling onSubscribe($ctx)") - val subscribed = try { s.onSubscribe(ctx.subscription); true } catch { + val subscribed = try { + s.onSubscribe(ctx.subscription); true + } catch { case NonFatal(ex) => streamLogger.warn("Subscriber.onSubscribe failed unexpectedly", ex) false @@ -324,7 +326,9 @@ trait BasicBackend { self => } releaseSession(ctx, false) res - } finally { ctx.sync = 0 } + } finally { + ctx.sync = 0 + } promise.success(res) } catch { case NonFatal(ex) => promise.tryFailure(ex) } }) diff --git a/repos/slick/slick/src/main/scala/slick/compiler/EmulateOuterJoins.scala b/repos/slick/slick/src/main/scala/slick/compiler/EmulateOuterJoins.scala index 49865cdc03d..3f5181e48b3 100644 --- a/repos/slick/slick/src/main/scala/slick/compiler/EmulateOuterJoins.scala +++ b/repos/slick/slick/src/main/scala/slick/compiler/EmulateOuterJoins.scala @@ -21,7 +21,7 @@ class EmulateOuterJoins(val useLeftJoin: Boolean, val useRightJoin: Boolean) ClientSideOp.mapServerSide(tree, true) { n => val n2 = convert(n) if (n2 eq n) n2 else Phase.forceOuterBinds.apply(n2) - }) + }) def convert(n: Node): Node = n match { case Join(leftGen, rightGen, left, right, JoinType.Left, on) diff --git a/repos/slick/slick/src/main/scala/slick/jdbc/Invoker.scala b/repos/slick/slick/src/main/scala/slick/jdbc/Invoker.scala index 302d04aed43..b8836b0c18a 100644 --- a/repos/slick/slick/src/main/scala/slick/jdbc/Invoker.scala +++ b/repos/slick/slick/src/main/scala/slick/jdbc/Invoker.scala @@ -55,7 +55,11 @@ trait Invoker[+R] { self => final def foreach(f: R => Unit, maxRows: Int = 0)( implicit session: JdbcBackend#Session) { val it = iteratorTo(maxRows) - try { it.foreach(f) } finally { it.close() } + try { + it.foreach(f) + } finally { + it.close() + } } } diff --git a/repos/slick/slick/src/main/scala/slick/jdbc/JdbcModelBuilder.scala b/repos/slick/slick/src/main/scala/slick/jdbc/JdbcModelBuilder.scala index e6bdaa21e76..d73456919e3 100644 --- a/repos/slick/slick/src/main/scala/slick/jdbc/JdbcModelBuilder.scala +++ b/repos/slick/slick/src/main/scala/slick/jdbc/JdbcModelBuilder.scala @@ -340,7 +340,7 @@ class JdbcModelBuilder(mTables: Seq[MTable], ignoreInvalidDefaults: Boolean)( d.getOrElse(throw new SlickException( s"Invalid default value $d for non-nullable column ${tableBuilder.namer.qualifiedName.asString}.$name of type $tpe, meta data: " + meta.toString)) - )) + )) } private def convenientDefault diff --git a/repos/slick/slick/src/main/scala/slick/lifted/ExtensionMethods.scala b/repos/slick/slick/src/main/scala/slick/lifted/ExtensionMethods.scala index 93bb0ace35d..1c201b52736 100644 --- a/repos/slick/slick/src/main/scala/slick/lifted/ExtensionMethods.scala +++ b/repos/slick/slick/src/main/scala/slick/lifted/ExtensionMethods.scala @@ -298,12 +298,12 @@ trait ExtensionMethodConversions { c: Rep[Option[B1]]): OptionColumnExtensionMethods[B1] = new OptionColumnExtensionMethods[B1](c) implicit def numericColumnExtensionMethods[B1](c: Rep[B1])( - implicit tm: BaseTypedType[B1] with NumericTypedType) - : BaseNumericColumnExtensionMethods[B1] = + implicit tm: BaseTypedType[B1] + with NumericTypedType): BaseNumericColumnExtensionMethods[B1] = new BaseNumericColumnExtensionMethods[B1](c) implicit def numericOptionColumnExtensionMethods[B1](c: Rep[Option[B1]])( - implicit tm: BaseTypedType[B1] with NumericTypedType) - : OptionNumericColumnExtensionMethods[B1] = + implicit tm: BaseTypedType[B1] + with NumericTypedType): OptionNumericColumnExtensionMethods[B1] = new OptionNumericColumnExtensionMethods[B1](c) implicit def stringColumnExtensionMethods( c: Rep[String]): StringColumnExtensionMethods[String] = diff --git a/repos/slick/slick/src/main/scala/slick/relational/RelationalProfile.scala b/repos/slick/slick/src/main/scala/slick/relational/RelationalProfile.scala index 84bef63614b..c9213a9235e 100644 --- a/repos/slick/slick/src/main/scala/slick/relational/RelationalProfile.scala +++ b/repos/slick/slick/src/main/scala/slick/relational/RelationalProfile.scala @@ -51,8 +51,9 @@ trait RelationalProfile ColumnOrdered[T](c, Ordering()) implicit def tableQueryToTableQueryExtensionMethods[ T <: RelationalProfile#Table[_], - U](q: Query[T, U, Seq] with TableQuery[T]) - : TableQueryExtensionMethods[T, U] = + U]( + q: Query[T, U, Seq] + with TableQuery[T]): TableQueryExtensionMethods[T, U] = new TableQueryExtensionMethods[T, U](q) implicit def streamableCompiledInsertActionExtensionMethods[EU]( diff --git a/repos/slick/slick/src/main/scala/slick/util/CloseableIterator.scala b/repos/slick/slick/src/main/scala/slick/util/CloseableIterator.scala index dc69bdfca63..0271c30c8e3 100644 --- a/repos/slick/slick/src/main/scala/slick/util/CloseableIterator.scala +++ b/repos/slick/slick/src/main/scala/slick/util/CloseableIterator.scala @@ -64,7 +64,10 @@ object CloseableIterator { class Single[+T](item: T) extends CloseableIterator[T] { private var more = true def hasNext = more - def next() = if (more) { more = false; item } else noNext + def next() = + if (more) { + more = false; item + } else noNext def close {} } diff --git a/repos/slick/slick/src/main/scala/slick/util/ManagedArrayBlockingQueue.scala b/repos/slick/slick/src/main/scala/slick/util/ManagedArrayBlockingQueue.scala index c6bd0e672cf..84b3e69a9a1 100644 --- a/repos/slick/slick/src/main/scala/slick/util/ManagedArrayBlockingQueue.scala +++ b/repos/slick/slick/src/main/scala/slick/util/ManagedArrayBlockingQueue.scala @@ -77,7 +77,9 @@ abstract class ManagedArrayBlockingQueue[E >: Null <: AnyRef]( checkNotNull(e) locked { if (count == items.length || !accept(e, count)) false - else { insert(e); true } + else { + insert(e); true + } } } diff --git a/repos/slick/slick/src/sphinx/code/CodeGenerator.scala b/repos/slick/slick/src/sphinx/code/CodeGenerator.scala index c16d991e76b..3d95f931a95 100644 --- a/repos/slick/slick/src/sphinx/code/CodeGenerator.scala +++ b/repos/slick/slick/src/sphinx/code/CodeGenerator.scala @@ -61,7 +61,7 @@ object CodeGenerator extends App { else super.rawType } } - }) + }) codegenFuture.onSuccess { case codegen => codegen.writeToFile( diff --git a/repos/spark/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala b/repos/spark/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala index c16f03f1a2e..01172008bee 100644 --- a/repos/spark/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala +++ b/repos/spark/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala @@ -75,7 +75,7 @@ class CountMinSketchSuite extends FunSuite { if (ratio > epsOfTotalCount) 1 else 0 }.sum - 1D - numErrors.toDouble / numAllItems + 1d - numErrors.toDouble / numAllItems } assert( diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/Client.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/Client.scala index db45638d6f3..210bb0982e9 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/Client.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/Client.scala @@ -62,7 +62,7 @@ private class ClientEndpoint( case e: Throwable => logError(e.getMessage, e) System.exit(SparkExitCode.UNCAUGHT_EXCEPTION) - } + } ) private val lostMasters = new HashSet[RpcAddress] diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/FaultToleranceTest.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/FaultToleranceTest.scala index f2ffb8338ab..becd5bb5084 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/FaultToleranceTest.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/FaultToleranceTest.scala @@ -218,7 +218,9 @@ private object FaultToleranceTest extends App with Logging { /** Creates a SparkContext, which constructs a Client to interact with our cluster. */ private def createClient() = { logInfo(">>>>> CREATE CLIENT <<<<<") - if (sc != null) { sc.stop() } + if (sc != null) { + sc.stop() + } // Counter-hack: Because of a hack in SparkEnv#create() that changes this // property, we need to reset it. System.setProperty("spark.driver.port", "0") @@ -469,7 +471,9 @@ private object Docker extends Logging { imageTag: String, args: String = "", mountDir: String = ""): ProcessBuilder = { - val mountCmd = if (mountDir != "") { " -v " + mountDir } else "" + val mountCmd = if (mountDir != "") { + " -v " + mountDir + } else "" val cmd = "docker run -privileged %s %s %s".format(mountCmd, imageTag, args) diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala index dcc8ee1a56a..de50d28467d 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala @@ -643,16 +643,24 @@ object SparkSubmit { if (isUserJar(args.primaryResource)) { childClasspath += args.primaryResource } - if (args.jars != null) { childClasspath ++= args.jars.split(",") } - if (args.childArgs != null) { childArgs ++= args.childArgs } + if (args.jars != null) { + childClasspath ++= args.jars.split(",") + } + if (args.childArgs != null) { + childArgs ++= args.childArgs + } } // Map all arguments to command-line options or system properties for our chosen mode for (opt <- options) { if (opt.value != null && (deployMode & opt.deployMode) != 0 && (clusterManager & opt.clusterManager) != 0) { - if (opt.clOption != null) { childArgs += (opt.clOption, opt.value) } - if (opt.sysProp != null) { sysProps.put(opt.sysProp, opt.value) } + if (opt.clOption != null) { + childArgs += (opt.clOption, opt.value) + } + if (opt.sysProp != null) { + sysProps.put(opt.sysProp, opt.value) + } } } @@ -679,7 +687,9 @@ object SparkSubmit { } else { // In legacy standalone cluster mode, use Client as a wrapper around the user class childMainClass = "org.apache.spark.deploy.Client" - if (args.supervise) { childArgs += "--supervise" } + if (args.supervise) { + childArgs += "--supervise" + } Option(args.driverMemory).foreach { m => childArgs += ("--memory", m) } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala index bafe9a1f4b1..c10e1c3505e 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/history/HistoryPage.scala @@ -39,34 +39,36 @@ private[history] class HistoryPage(parent: HistoryServer) val content =
      - {providerConfig.map { case (k, v) =>
    • {k}: {v}
    • }} + { + providerConfig.map { case (k, v) =>
    • {k}: {v}
    • } + }
    { - if (allAppsSize > 0) { - ++ - ++ - - } else if (requestedIncomplete) { -

    No incomplete applications found!

    - } else { -

    No completed applications found!

    ++ -

    Did you specify the correct logging directory? + if (allAppsSize > 0) { + ++ +

    ++ + + } else if (requestedIncomplete) { +

    No incomplete applications found!

    + } else { +

    No completed applications found!

    ++ +

    Did you specify the correct logging directory? Please verify your setting of spark.history.fs.logDirectory and whether you have the permissions to access it.
    It is also possible that your application did not run to completion or did not stop the SparkContext.

    - } - } + } + } { - if (requestedIncomplete) { - "Back to completed applications" - } else { - "Show incomplete applications" - } - } + if (requestedIncomplete) { + "Back to completed applications" + } else { + "Show incomplete applications" + } + }
    diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/DriverState.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/DriverState.scala index a291f64a624..7244375bd85 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/DriverState.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/DriverState.scala @@ -30,5 +30,5 @@ private[deploy] object DriverState extends Enumeration { // FAILED: The driver exited non-zero and was not supervised // ERROR: Unable to run or restart due to an unrecoverable error (e.g. missing jar file) val SUBMITTED, RUNNING, FINISHED, RELAUNCHING, UNKNOWN, KILLED, FAILED, - ERROR = Value + ERROR = Value } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/Master.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/Master.scala index 9f37590807f..d40a262fbf0 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/Master.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/Master.scala @@ -373,7 +373,9 @@ private[deploy] class Master( logWarning("Master change ack from unknown app: " + appId) } - if (canCompleteRecovery) { completeRecovery() } + if (canCompleteRecovery) { + completeRecovery() + } } case WorkerSchedulerStateResponse(workerId, executors, driverIds) => { @@ -403,7 +405,9 @@ private[deploy] class Master( logWarning("Scheduler state from unknown worker: " + workerId) } - if (canCompleteRecovery) { completeRecovery() } + if (canCompleteRecovery) { + completeRecovery() + } } case WorkerLatestState(workerId, executors, driverIds) => @@ -661,7 +665,9 @@ private[deploy] class Master( private def completeRecovery() { // Ensure "only-once" recovery semantics using a short synchronization period. - if (state != RecoveryState.RECOVERING) { return } + if (state != RecoveryState.RECOVERING) { + return + } state = RecoveryState.COMPLETING_RECOVERY // Kill off any workers and apps that didn't respond to us. diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala index 783e0a65f32..1b81d4ed572 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/ApplicationPage.scala @@ -73,13 +73,15 @@ private[ui] class ApplicationPage(parent: MasterWebUI)
  • User: {app.desc.user}
  • Cores: { - if (app.desc.maxCores.isEmpty) { - "Unlimited (%s granted)".format(app.coresGranted) - } else { - "%s (%s granted, %s left)".format( - app.desc.maxCores.get, app.coresGranted, app.coresLeft) - } - } + if (app.desc.maxCores.isEmpty) { + "Unlimited (%s granted)".format(app.coresGranted) + } else { + "%s (%s granted, %s left)".format( + app.desc.maxCores.get, + app.coresGranted, + app.coresLeft) + } + }
  • Executor Memory: @@ -97,11 +99,11 @@ private[ui] class ApplicationPage(parent: MasterWebUI)

    Executor Summary

    {executorsTable} { - if (removedExecutors.nonEmpty) { -

    Removed Executors

    ++ - removedExecutorsTable - } - } + if (removedExecutors.nonEmpty) { +

    Removed Executors

    ++ + removedExecutorsTable + } + }
  • ; UIUtils.basicSparkPage(content, "Application: " + app.desc.name) @@ -117,10 +119,20 @@ private[ui] class ApplicationPage(parent: MasterWebUI) {executor.memory} {executor.state} - stdout - stderr + stdout + stderr } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala index c7a78357495..cfd4155f913 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/master/ui/MasterPage.scala @@ -124,13 +124,15 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {
    • URL: {state.uri}
    • { - state.restUri.map { uri => -
    • + state.restUri + .map { uri => +
    • REST URL: {uri} (cluster mode)
    • - }.getOrElse { Seq.empty } - } + } + .getOrElse { Seq.empty } + }
    • Alive Workers: {aliveWorkers.length}
    • Cores in use: {aliveWorkers.map(_.cores).sum} Total, {aliveWorkers.map(_.coresUsed).sum} Used
    • @@ -163,15 +165,16 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {
      - {if (hasDrivers) { -
      + { + if (hasDrivers) { +

      Running Drivers

      {activeDriversTable}
      - } - } + } + }
      @@ -183,15 +186,15 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") {
      { - if (hasDrivers) { -
      + if (hasDrivers) { +

      Completed Drivers

      {completedDriversTable}
      - } - } + } + }
      ; UIUtils.basicSparkPage(content, "Spark Master at " + state.uri) @@ -265,7 +268,11 @@ private[ui] class MasterPage(parent: MasterWebUI) extends WebUIPage("") { {driver.id} {killLink} {driver.submitDate} - {driver.worker.map(w => {w.id.toString}).getOrElse("None")} + { + driver.worker + .map(w => {w.id.toString}) + .getOrElse("None") + } {driver.state} diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/DriverPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/DriverPage.scala index 81e7e07a932..7cac688c664 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/DriverPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/DriverPage.scala @@ -147,7 +147,9 @@ private[ui] class DriverPage(parent: MesosClusterUI) Java options{command.javaOpts.mkString((" "))} - Library path entries{command.libraryPathEntries.mkString((" "))} + Library path entries{ + command.libraryPathEntries.mkString((" ")) + } } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala index 77b2ca54cc0..dd4d19209ad 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/mesos/ui/MesosClusterPage.scala @@ -80,7 +80,9 @@ private[mesos] class MesosClusterPage(parent: MesosClusterUI) {id} {state.driverDescription.submissionDate} {state.driverDescription.command.mainClass} - cpus: {state.driverDescription.cores}, mem: {state.driverDescription.mem} + cpus: {state.driverDescription.cores}, mem: { + state.driverDescription.mem + } {state.startDate} {state.slaveId.getValue} {stateString(state.mesosTaskStatus)} diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala index c6d6932d484..2b92dcd3ea0 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/RestSubmissionClient.scala @@ -271,7 +271,9 @@ private[spark] class RestSubmissionClient(master: String) extends Logging { } } - try { Await.result(responseFuture, 10.seconds) } catch { + try { + Await.result(responseFuture, 10.seconds) + } catch { case unreachable @ (_: FileNotFoundException | _: SocketException) => throw new SubmitRestConnectionException( "Unable to connect to server", diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/SubmitRestProtocolMessage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/SubmitRestProtocolMessage.scala index a20e9413c3e..8dd99b12cca 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/SubmitRestProtocolMessage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/rest/SubmitRestProtocolMessage.scala @@ -100,7 +100,9 @@ private[rest] abstract class SubmitRestProtocolMessage { * If the assertion fails, throw a [[SubmitRestProtocolException]]. */ protected def assert(condition: Boolean, failMessage: String): Unit = { - if (!condition) { throw new SubmitRestProtocolException(failMessage) } + if (!condition) { + throw new SubmitRestProtocolException(failMessage) + } } } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala index 79ad65bf8a9..28d27f0a81c 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/DriverRunner.scala @@ -210,7 +210,9 @@ private[deploy] class DriverRunner( "Launch Command: " + command.command.mkString("\"", "\" \"", "\"")) synchronized { - if (killed) { return } + if (killed) { + return + } process = Some(command.start()) initialize(process.get) } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala index 72396bc0a88..ab344fe8d50 100755 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala @@ -442,7 +442,9 @@ private[deploy] class Worker( override def receive: PartialFunction[Any, Unit] = synchronized { case SendHeartbeat => - if (connected) { sendToMaster(Heartbeat(workerId, self)) } + if (connected) { + sendToMaster(Heartbeat(workerId, self)) + } case WorkDirCleanup => // Spin up a separate thread (in a future) to do the dir cleanup; don't tie up worker diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala index 5d7e8409c9b..0a6cc05ca2d 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/LogPage.scala @@ -93,8 +93,14 @@ private[ui] class LogPage(parent: WorkerWebUI) val backButton = if (startByte > 0) { - + @@ -107,10 +113,17 @@ private[ui] class LogPage(parent: WorkerWebUI) val nextButton = if (endByte < logLength) { - + } else { diff --git a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/WorkerPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/WorkerPage.scala index d9dc47c56a2..0ee1b461873 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/WorkerPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/deploy/worker/ui/WorkerPage.scala @@ -75,8 +75,12 @@ private[ui] class WorkerPage(parent: WorkerWebUI) extends WebUIPage("") {
    • Master URL: {workerState.masterUrl}
    • -
    • Cores: {workerState.cores} ({workerState.coresUsed} Used)
    • -
    • Memory: {Utils.megabytesToString(workerState.memory)} +
    • Cores: {workerState.cores} ({ + workerState.coresUsed + } Used)
    • +
    • Memory: { + Utils.megabytesToString(workerState.memory) + } ({Utils.megabytesToString(workerState.memoryUsed)} Used)

    Back to Master

    @@ -87,23 +91,23 @@ private[ui] class WorkerPage(parent: WorkerWebUI) extends WebUIPage("") {

    Running Executors ({runningExecutors.size})

    {runningExecutorTable} { - if (runningDrivers.nonEmpty) { -

    Running Drivers ({runningDrivers.size})

    ++ - runningDriverTable - } - } + if (runningDrivers.nonEmpty) { +

    Running Drivers ({runningDrivers.size})

    ++ + runningDriverTable + } + } { - if (finishedExecutors.nonEmpty) { -

    Finished Executors ({finishedExecutors.size})

    ++ - finishedExecutorTable - } - } + if (finishedExecutors.nonEmpty) { +

    Finished Executors ({finishedExecutors.size})

    ++ + finishedExecutorTable + } + } { - if (finishedDrivers.nonEmpty) { -

    Finished Drivers ({finishedDrivers.size})

    ++ - finishedDriverTable - } - } + if (finishedDrivers.nonEmpty) { +

    Finished Drivers ({finishedDrivers.size})

    ++ + finishedDriverTable + } + } ; UIUtils.basicSparkPage( @@ -127,10 +131,14 @@ private[ui] class WorkerPage(parent: WorkerWebUI) extends WebUIPage("") { - stdout - stderr + stdout + stderr } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala b/repos/spark/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala index 4d8abdf91c1..8398fa6cd22 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala @@ -385,7 +385,9 @@ class TaskMetrics private[spark] (initialAccums: Seq[Accumulator[_]]) if (hasShuffleWrite) { _shuffleWriteMetrics = Some(new ShuffleWriteMetrics(initialAccumsMap)) } - if (hasInput) { _inputMetrics = Some(new InputMetrics(initialAccumsMap)) } + if (hasInput) { + _inputMetrics = Some(new InputMetrics(initialAccumsMap)) + } if (hasOutput) { _outputMetrics = Some(new OutputMetrics(initialAccumsMap)) } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/metrics/MetricsSystem.scala b/repos/spark/core/src/main/scala/org/apache/spark/metrics/MetricsSystem.scala index 93c8757bf56..c5dc1c90625 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/metrics/MetricsSystem.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/metrics/MetricsSystem.scala @@ -140,13 +140,17 @@ private[spark] class MetricsSystem private ( // Other instance types, e.g. Master and Worker, are not related to a specific application. val warningMsg = s"Using default name $defaultName for source because %s is not set." - if (appId.isEmpty) { logWarning(warningMsg.format("spark.app.id")) } + if (appId.isEmpty) { + logWarning(warningMsg.format("spark.app.id")) + } if (executorId.isEmpty) { logWarning(warningMsg.format("spark.executor.id")) } defaultName } - } else { defaultName } + } else { + defaultName + } } def getSourcesByName(sourceName: String): Seq[Source] = diff --git a/repos/spark/core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala b/repos/spark/core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala index 78501d9b2c3..fa2885efcb6 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/rdd/CoalescedRDD.scala @@ -241,7 +241,9 @@ private class PartitionCoalescer( pgroup.arr += part // already assign this element initialHash += part // needed to avoid assigning partitions to multiple buckets true - } else { false } + } else { + false + } } /** diff --git a/repos/spark/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala b/repos/spark/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala index 8c9eb31bcd0..d0819286890 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala @@ -856,7 +856,7 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])( iter.flatMap { case (k, v) => cleanF(v).map(x => (k, x)) - }, + }, preservesPartitioning = true) } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala b/repos/spark/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala index 46318594e12..6dd404a68bc 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala @@ -352,7 +352,7 @@ private[mesos] trait MesosSchedulerUtils extends Logging { Set[String]() } else { v.split(',').toSet - }) + }) } catch { case NonFatal(e) => throw new IllegalArgumentException( diff --git a/repos/spark/core/src/main/scala/org/apache/spark/status/api/v1/OneStageResource.scala b/repos/spark/core/src/main/scala/org/apache/spark/status/api/v1/OneStageResource.scala index a47e4ec0562..0af05cbdc30 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/status/api/v1/OneStageResource.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/status/api/v1/OneStageResource.scala @@ -169,7 +169,7 @@ object OneStageResource { td.taskMetrics.map { _.executorRunTime }.getOrElse(-1L) case DECREASING_RUNTIME => -td.taskMetrics.map { _.executorRunTime }.getOrElse(-1L) - } + } Ordering.by(extractor) } } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/ui/PagedTable.scala b/repos/spark/core/src/main/scala/org/apache/spark/ui/PagedTable.scala index e3c1ad71ad7..179b476c1e7 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/ui/PagedTable.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/ui/PagedTable.scala @@ -228,41 +228,49 @@ private[ui] trait PagedTable[T] { diff --git a/repos/spark/core/src/main/scala/org/apache/spark/ui/UIUtils.scala b/repos/spark/core/src/main/scala/org/apache/spark/ui/UIUtils.scala index d0286af36a0..8aa26fa9fc7 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/ui/UIUtils.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/ui/UIUtils.scala @@ -188,7 +188,9 @@ private[spark] object UIUtils extends Logging { href={prependBaseUri("/static/jquery.dataTables.1.10.4.min.css")} type="text/css"/> - + @@ -211,7 +213,9 @@ private[spark] object UIUtils extends Logging { if (appName.length < 36) appName else appName.take(32) + "..." val header = activeTab.headerTabs.map { tab =>
  • - {tab.name} + { + tab.name + }
  • } val helpButton: Seq[Node] = @@ -272,7 +276,9 @@ private[spark] object UIUtils extends Logging { {org.apache.spark.SPARK_VERSION} + style="margin-right: 15px;">{ + org.apache.spark.SPARK_VERSION + } {title} @@ -319,7 +325,7 @@ private[spark] object UIUtils extends Logging { def getHeaderContent(header: String): Seq[Node] = { if (newlinesInHeader) {
      - { header.split("\n").map { case t =>
    • {t}
    • } } + {header.split("\n").map { case t =>
    • {t}
    • }}
    } else { Text(header) @@ -355,8 +361,8 @@ private[spark] object UIUtils extends Logging {
    {completed}/{total} - { if (failed > 0) s"($failed failed)" } - { if (skipped > 0) s"($skipped skipped)" } + {if (failed > 0) s"($failed failed)"} + {if (skipped > 0) s"($skipped skipped)"}
    @@ -391,7 +397,9 @@ private[spark] object UIUtils extends Logging { - DAG Visualization @@ -399,21 +407,30 @@ private[spark] object UIUtils extends Logging {
    } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala index 971ab442cfd..ac76f0dc680 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala @@ -66,15 +66,17 @@ private[ui] class ExecutorThreadDumpPage(parent: ExecutorsTab) {threadId} {thread.threadName} {thread.threadState} - {thread.stackTrace} + { + thread.stackTrace + } } } @@ -119,38 +131,54 @@ private[ui] class ExecutorTable( {k} {executorIdToAddress.getOrElse(k, "CANNOT FIND ADDRESS")} - {UIUtils.formatDuration(v.taskTime)} + { + UIUtils.formatDuration(v.taskTime) + } {v.failedTasks + v.succeededTasks} {v.failedTasks} {v.succeededTasks} - {if (stageData.hasInput) { - + { + if (stageData.hasInput) { + {s"${Utils.bytesToString(v.inputBytes)} / ${v.inputRecords}"} - }} - {if (stageData.hasOutput) { - + } + } + { + if (stageData.hasOutput) { + {s"${Utils.bytesToString(v.outputBytes)} / ${v.outputRecords}"} - }} - {if (stageData.hasShuffleRead) { - - {s"${Utils.bytesToString(v.shuffleRead)} / ${v.shuffleReadRecords}"} + } + } + { + if (stageData.hasShuffleRead) { + + { + s"${Utils.bytesToString(v.shuffleRead)} / ${v.shuffleReadRecords}" + } - }} - {if (stageData.hasShuffleWrite) { - - {s"${Utils.bytesToString(v.shuffleWrite)} / ${v.shuffleWriteRecords}"} + } + } + { + if (stageData.hasShuffleWrite) { + + { + s"${Utils.bytesToString(v.shuffleWrite)} / ${v.shuffleWriteRecords}" + } - }} - {if (stageData.hasBytesSpilled) { - + } + } + { + if (stageData.hasBytesSpilled) { + {Utils.bytesToString(v.memoryBytesSpilled)} {Utils.bytesToString(v.diskBytesSpilled)} - }} + } + } } case None => diff --git a/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala b/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala index 4f8be6668ab..889edd639ed 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala @@ -170,7 +170,10 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") { ++ } @@ -274,54 +277,54 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") { {jobData.status} { - if (jobData.jobGroup.isDefined) { -
  • + if (jobData.jobGroup.isDefined) { +
  • Job Group: {jobData.jobGroup.get}
  • - } - } + } + } { - if (shouldShowActiveStages) { -
  • + if (shouldShowActiveStages) { +
  • Active Stages: {activeStages.size}
  • - } - } + } + } { - if (shouldShowPendingStages) { -
  • + if (shouldShowPendingStages) { +
  • Pending Stages: {pendingOrSkippedStages.size}
  • - } - } + } + } { - if (shouldShowCompletedStages) { -
  • + if (shouldShowCompletedStages) { +
  • Completed Stages: {completedStages.size}
  • - } - } + } + } { - if (shouldShowSkippedStages) { -
  • + if (shouldShowSkippedStages) { +
  • Skipped Stages: {pendingOrSkippedStages.size}
  • - } - } + } + } { - if (shouldShowFailedStages) { -
  • + if (shouldShowFailedStages) { +
  • Failed Stages: {failedStages.size}
  • - } - } + } + } diff --git a/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala b/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala index 649c45c69b2..d9623508125 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala @@ -44,22 +44,26 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
    { - val legendPairs = List(("scheduler-delay-proportion", "Scheduler Delay"), - ("deserialization-time-proportion", "Task Deserialization Time"), - ("shuffle-read-time-proportion", "Shuffle Read Time"), - ("executor-runtime-proportion", "Executor Computing Time"), - ("shuffle-write-time-proportion", "Shuffle Write Time"), - ("serialization-time-proportion", "Result Serialization Time"), - ("getting-result-time-proportion", "Getting Result Time")) - - legendPairs.zipWithIndex.map { - case ((classAttr, name), index) => - + {name} - } - } + } + }
    } @@ -127,7 +131,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { val stageHeader = s"Details for Stage $stageId (Attempt $stageAttemptId)" if (stageDataOption.isEmpty) { val content =
    -

    No information to display for Stage {stageId} (Attempt {stageAttemptId})

    +

    No information to display for Stage {stageId} (Attempt { + stageAttemptId + })

    return UIUtils.headerSparkPage(stageHeader, content, parent) } @@ -160,34 +166,51 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { Locality Level Summary: {getLocalitySummaryString(stageData)} - {if (stageData.hasInput) { -
  • + { + if (stageData.hasInput) { +
  • Input Size / Records: - {s"${Utils.bytesToString(stageData.inputBytes)} / ${stageData.inputRecords}"} + { + s"${Utils.bytesToString(stageData.inputBytes)} / ${stageData.inputRecords}" + }
  • - }} - {if (stageData.hasOutput) { -
  • + } + } + { + if (stageData.hasOutput) { +
  • Output: - {s"${Utils.bytesToString(stageData.outputBytes)} / ${stageData.outputRecords}"} + { + s"${Utils.bytesToString(stageData.outputBytes)} / ${stageData.outputRecords}" + }
  • - }} - {if (stageData.hasShuffleRead) { -
  • + } + } + { + if (stageData.hasShuffleRead) { +
  • Shuffle Read: - {s"${Utils.bytesToString(stageData.shuffleReadTotalBytes)} / " + - s"${stageData.shuffleReadRecords}"} + { + s"${Utils.bytesToString(stageData.shuffleReadTotalBytes)} / " + + s"${stageData.shuffleReadRecords}" + }
  • - }} - {if (stageData.hasShuffleWrite) { -
  • + } + } + { + if (stageData.hasShuffleWrite) { +
  • Shuffle Write: - {s"${Utils.bytesToString(stageData.shuffleWriteBytes)} / " + - s"${stageData.shuffleWriteRecords}"} + { + s"${Utils.bytesToString(stageData.shuffleWriteBytes)} / " + + s"${stageData.shuffleWriteRecords}" + }
  • - }} - {if (stageData.hasBytesSpilled) { -
  • + } + } + { + if (stageData.hasBytesSpilled) { +
  • Shuffle Spill (Memory): {Utils.bytesToString(stageData.memoryBytesSpilled)}
  • @@ -195,7 +218,8 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { Shuffle Spill (Disk): {Utils.bytesToString(stageData.diskBytesSpilled)} - }} + } + } @@ -213,56 +237,74 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") {
  • - + Scheduler Delay
  • - + Task Deserialization Time
  • - {if (stageData.hasShuffleRead) { -
  • + { + if (stageData.hasShuffleRead) { +
  • - + Shuffle Read Blocked Time
  • - + Shuffle Remote Reads
  • - }} + } + }
  • - + Result Serialization Time
  • - + Getting Result Time
  • - {if (displayPeakExecutionMemory) { -
  • + { + if (displayPeakExecutionMemory) { +
  • - + Peak Execution Memory
  • - }} + } + } @@ -324,8 +366,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { } val jsForScrollingDownToTaskTable = val taskIdsInPage = @@ -366,7 +409,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { metrics.get.executorDeserializeTime.toDouble } val deserializationQuantiles = - Task Deserialization Time @@ -440,7 +485,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { records: Seq[Double]): Seq[Elem] = { val recordDist = getDistributionQuantiles(records).iterator getDistributionQuantiles(data).map(d => - {s"${Utils.bytesToString(d.toLong)} / ${recordDist.next().toLong}"}) + { + s"${Utils.bytesToString(d.toLong)} / ${recordDist.next().toLong}" + }) } val inputSizes = validTasks.map { @@ -573,7 +620,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { val listings: Seq[Seq[Node]] = Seq( {serviceQuantiles}, - {schedulerDelayQuantiles}, + { + schedulerDelayQuantiles + }, {deserializationQuantiles} @@ -581,7 +630,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { {serializationQuantiles} , - {gettingResultQuantiles}, + { + gettingResultQuantiles + }, if (displayPeakExecutionMemory) { {peakExecutionMemoryQuantiles} @@ -589,8 +640,14 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { } else { Nil }, - if (stageData.hasInput) {inputQuantiles} else Nil, - if (stageData.hasOutput) {outputQuantiles} else Nil, + if (stageData.hasInput) { + inputQuantiles + } + else Nil, + if (stageData.hasOutput) { + outputQuantiles + } + else Nil, if (stageData.hasShuffleRead) { {shuffleReadBlockedQuantiles} @@ -603,13 +660,19 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { Nil }, if (stageData.hasShuffleWrite) - {shuffleWriteQuantiles} + { + shuffleWriteQuantiles + } else Nil, if (stageData.hasBytesSpilled) - {memoryBytesSpilledQuantiles} + { + memoryBytesSpilledQuantiles + } else Nil, if (stageData.hasBytesSpilled) - {diskBytesSpilledQuantiles} + { + diskBytesSpilledQuantiles + } else Nil ) @@ -635,7 +698,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { val executorTable = new ExecutorTable(stageId, stageAttemptId, parent) val maybeAccumulableTable: Seq[Node] = - if (hasAccumulators) {

    Accumulators

    ++ accumulableTable } else + if (hasAccumulators) { +

    Accumulators

    ++ accumulableTable + } else Seq() val content = @@ -643,7 +708,9 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { // Only show the tasks in the table stageData.taskData.values.toSeq .filter(t => taskIdsInPage.contains(t.taskInfo.taskId)), - currentTime) ++

    Summary Metrics for {numCompleted} Completed Tasks

    ++
    {summaryTable.getOrElse("No tasks have reported metrics yet.")}
    ++

    Aggregated Metrics by Executor

    ++ executorTable.toNodeSeq ++ maybeAccumulableTable ++

    Tasks

    ++ taskTableHTML ++ jsForScrollingDownToTaskTable + currentTime) ++

    Summary Metrics for {numCompleted} Completed Tasks

    ++
    { + summaryTable.getOrElse("No tasks have reported metrics yet.") + }
    ++

    Aggregated Metrics by Executor

    ++ executorTable.toNodeSeq ++ maybeAccumulableTable ++

    Tasks

    ++ taskTableHTML ++ jsForScrollingDownToTaskTable UIUtils.headerSparkPage( stageHeader, content, @@ -817,16 +884,16 @@ private[ui] class StagePage(parent: StagesTab) extends WebUIPage("stage") { Event Timeline ++