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 0e217a0ce01..11144b122bd 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 @@ -101,7 +101,8 @@ class EngineManifestSerializer case _ => enginemanifest } } - }, { + }, + { case enginemanifest: EngineManifest => JObject(JField("id", JString(enginemanifest.id)) :: JField("version", JString(enginemanifest.version)) :: diff --git a/repos/PredictionIO/examples/experimental/scala-local-regression/Run.scala b/repos/PredictionIO/examples/experimental/scala-local-regression/Run.scala index 60a27c43609..aa2fc8b4345 100644 --- a/repos/PredictionIO/examples/experimental/scala-local-regression/Run.scala +++ b/repos/PredictionIO/examples/experimental/scala-local-regression/Run.scala @@ -107,7 +107,8 @@ class VectorSerializer case JDouble(x) => x case _ => 0 }.toVector - }, { + }, + { case x: Vector[Double] => JArray(x.toList.map(y => JDouble(y))) } diff --git a/repos/PredictionIO/examples/experimental/scala-parallel-regression/Run.scala b/repos/PredictionIO/examples/experimental/scala-parallel-regression/Run.scala index c6634f8bbe9..84cabbbdca4 100644 --- a/repos/PredictionIO/examples/experimental/scala-parallel-regression/Run.scala +++ b/repos/PredictionIO/examples/experimental/scala-parallel-regression/Run.scala @@ -128,7 +128,8 @@ class VectorSerializer } } new DenseVector(v) - }, { + }, + { case x: Vector => JArray(x.toArray.toList.map(d => JDouble(d))) } diff --git a/repos/PredictionIO/examples/experimental/scala-recommendations/src/main/scala/Run.scala b/repos/PredictionIO/examples/experimental/scala-recommendations/src/main/scala/Run.scala index da7c5b4b02b..0917182e7c8 100644 --- a/repos/PredictionIO/examples/experimental/scala-recommendations/src/main/scala/Run.scala +++ b/repos/PredictionIO/examples/experimental/scala-recommendations/src/main/scala/Run.scala @@ -156,7 +156,8 @@ class Tuple2IntSerializer ( { case JArray(List(JInt(x), JInt(y))) => (x.intValue, y.intValue) - }, { + }, + { case x: (Int, Int) => JArray(List(JInt(x._1), JInt(x._2))) } )) diff --git a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/ws/Handshake.scala b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/ws/Handshake.scala index 585c8ac104d..20621f5ac31 100644 --- a/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/ws/Handshake.scala +++ b/repos/akka/akka-http-core/src/main/scala/akka/http/impl/engine/ws/Handshake.scala @@ -272,7 +272,8 @@ private[http] object Handshake { showExactOther: Boolean = true, caseInsensitive: Boolean = false): Expectation = check(_.headers.find(_.name == candidate.name))( - compare(candidate, caseInsensitive), { + compare(candidate, caseInsensitive), + { case Some(other) if showExactOther ⇒ s"response that was missing required `$candidate` header. Found `$other` with the wrong value." case Some(_) ⇒ s"response with invalid `${candidate.name}` header." diff --git a/repos/akka/akka-http/src/main/scala/akka/http/impl/server/RouteImplementation.scala b/repos/akka/akka-http/src/main/scala/akka/http/impl/server/RouteImplementation.scala index c2e8c70b68d..f223f214837 100644 --- a/repos/akka/akka-http/src/main/scala/akka/http/impl/server/RouteImplementation.scala +++ b/repos/akka/akka-http/src/main/scala/akka/http/impl/server/RouteImplementation.scala @@ -106,7 +106,8 @@ private[http] object RouteImplementation case BasicAuthentication(authenticator) ⇒ authenticateBasicAsync( - authenticator.realm, { creds ⇒ + authenticator.realm, + { creds ⇒ val javaCreds = creds match { case Credentials.Missing ⇒ @@ -137,7 +138,8 @@ private[http] object RouteImplementation case OAuth2Authentication(authenticator) ⇒ authenticateOAuth2Async( - authenticator.realm, { creds ⇒ + authenticator.realm, + { creds ⇒ val javaCreds = creds match { case Credentials.Missing ⇒ diff --git a/repos/akka/project/Protobuf.scala b/repos/akka/project/Protobuf.scala index 5a98295fe0b..4845aaea343 100644 --- a/repos/akka/project/Protobuf.scala +++ b/repos/akka/project/Protobuf.scala @@ -127,7 +127,8 @@ object Protobuf { "-I" + srcDir.absolutePath, "--java_out=%s" format targetDir.absolutePath) ++ protoFiles.map(_.absolutePath), - log, { (p, l) => p ! l }) + log, + { (p, l) => p ! l }) if (exitCode != 0) sys.error("protoc returned exit code: %d" format exitCode) } diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/DenseMatrix.scala b/repos/breeze/math/src/main/scala/breeze/linalg/DenseMatrix.scala index 145fb5ac774..b07a9ab4a7c 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/DenseMatrix.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/DenseMatrix.scala @@ -75,7 +75,8 @@ final class DenseMatrix[@spec(Double, Int, Float, Long) V]( /** Creates a matrix with the specified data array and rows. columns inferred automatically */ def this(rows: Int, data: Array[V], offset: Int) = this( - rows, { assert(data.length % rows == 0); data.length / rows }, + rows, + { assert(data.length % rows == 0); data.length / rows }, data, offset) 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 67951ae7d78..bd0c62bd03d 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/Vector.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/Vector.scala @@ -455,9 +455,15 @@ trait VectorOps { this: Vector.type => OpMod, OpPow) Op <: OpType]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { + { _ + _ }, + { _ - _ }, + { _ * _ }, + { _ * _ }, { _ / _ - }, { (a, b) => b }, { _ % _ }, { _ pow _ }) + }, + { (a, b) => b }, + { _ % _ }, + { _ pow _ }) op: Op.Impl2[T, T, T], @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T): BinaryRegistry[Vector[T], T, Op.type, Vector[T]] = @@ -488,9 +494,15 @@ trait VectorOps { this: Vector.type => OpMod, OpPow) Op <: OpType]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { + { _ + _ }, + { _ - _ }, + { _ * _ }, + { _ * _ }, { _ / _ - }, { (a, b) => b }, { _ % _ }, { _ pow _ }) + }, + { (a, b) => b }, + { _ % _ }, + { _ pow _ }) op: Op.Impl2[T, T, T], @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T): BinaryRegistry[T, Vector[T], Op.type, Vector[T]] = @@ -613,11 +625,23 @@ trait VectorOps { this: Vector.type => OpDiv, OpSet, OpMod, - OpPow) Op <: OpType](implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { (a, b) => b }, { - _ % _ - }, { _ pow _ }) - op: Op.Impl2[T, T, T]): BinaryUpdateRegistry[Vector[T], T, Op.type] = + OpPow) Op <: OpType]( + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) + op: Op.Impl2[T, T, T]): BinaryUpdateRegistry[Vector[T], T, Op.type] = new BinaryUpdateRegistry[Vector[T], T, Op.type] { override def bindingMissing(a: Vector[T], b: T): Unit = { var i = 0 diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseMatrixOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseMatrixOps.scala index 67b9b47a3d0..3e29876e5b1 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseMatrixOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/DenseMatrixOps.scala @@ -674,9 +674,14 @@ trait DenseMatrixOps { this: DenseMatrix.type => implicit def dm_dm_UpdateOp[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T], + implicit @expand.sequence[Op]( + { _ + _ }, + { _ - _ }, + { _ * _ }, + { _ / _ }, + { (a, b) => b }, + { _ % _ }, + { _ pow _ }) op: Op.Impl2[T, T, T], @expand.sequence[Op]({ _ += _ }, { _ -= _ }, { _ :*= _ }, { _ :/= _ }, { _ := _ }, { _ %= _ }, { _ :^= _ }) vecOp: Op.Impl2[T, T, T]) @@ -781,10 +786,22 @@ trait DenseMatrixOps { this: DenseMatrix.type => OpDiv, OpSet, OpMod, - OpPow) Op <: OpType](implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { (a, b) => b }, { - _ % _ - }, { _ pow _ }) op: Op.Impl2[T, T, T]): Op.InPlaceImpl2[DenseMatrix[T], T] = + OpPow) Op <: OpType]( + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]): Op.InPlaceImpl2[DenseMatrix[T], T] = new Op.InPlaceImpl2[DenseMatrix[T], T] { def apply(a: DenseMatrix[T], b: T): Unit = { @@ -896,7 +913,17 @@ trait DenseMatrixOps { this: DenseMatrix.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpMulMatrix, OpDiv, OpMod, OpPow) Op <: OpType]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { _ % _ }, { + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, { + _ % _ + }, { _ pow _ }) op: Op.Impl2[T, T, T]): Op.Impl2[T, DenseMatrix[T], DenseMatrix[T]] = new Op.Impl2[T, DenseMatrix[T], DenseMatrix[T]] { @@ -1475,7 +1502,17 @@ trait DenseMatrix_OrderingOps extends DenseMatrixOps { this: DenseMatrix.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpGT, OpGTE, OpLTE, OpLT, OpEq, OpNe) Op <: OpType]( implicit @expand.sequence[Op]( - { _ > _ }, { _ >= _ }, { _ <= _ }, { _ < _ }, { _ == _ }, { _ != _ }) + { _ > _ }, { + _ >= _ + }, { + _ <= _ + }, { + _ < _ + }, { + _ == _ + }, { + _ != _ + }) op: Op.Impl2[T, T, T]) : Op.Impl2[DenseMatrix[T], DenseMatrix[T], DenseMatrix[Boolean]] = new Op.Impl2[DenseMatrix[T], DenseMatrix[T], DenseMatrix[Boolean]] { @@ -1505,7 +1542,17 @@ trait DenseMatrix_OrderingOps extends DenseMatrixOps { this: DenseMatrix.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpGT, OpGTE, OpLTE, OpLT, OpEq, OpNe) Op <: OpType]( implicit @expand.sequence[Op]( - { _ > _ }, { _ >= _ }, { _ <= _ }, { _ < _ }, { _ == _ }, { _ != _ }) + { _ > _ }, { + _ >= _ + }, { + _ <= _ + }, { + _ < _ + }, { + _ == _ + }, { + _ != _ + }) op: Op.Impl2[T, T, Boolean]) : Op.Impl2[DenseMatrix[T], Matrix[T], DenseMatrix[Boolean]] = new Op.Impl2[DenseMatrix[T], Matrix[T], DenseMatrix[Boolean]] { @@ -1530,7 +1577,17 @@ trait DenseMatrix_OrderingOps extends DenseMatrixOps { this: DenseMatrix.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpGT, OpGTE, OpLTE, OpLT, OpEq, OpNe) Op <: OpType]( implicit @expand.sequence[Op]( - { _ > _ }, { _ >= _ }, { _ <= _ }, { _ < _ }, { _ == _ }, { _ != _ }) + { _ > _ }, { + _ >= _ + }, { + _ <= _ + }, { + _ < _ + }, { + _ == _ + }, { + _ != _ + }) op: Op.Impl2[T, T, Boolean]) : Op.Impl2[DenseMatrix[T], T, DenseMatrix[Boolean]] = new Op.Impl2[DenseMatrix[T], T, DenseMatrix[Boolean]] { 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 2a73e3a3154..542f6ca6060 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 @@ -21,9 +21,19 @@ trait DenseVectorOps extends DenseVector_GenericOps { this: DenseVector.type => implicit def dv_v_Op[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]) : BinaryRegistry[DenseVector[T], Vector[T], Op.type, DenseVector[T]] = new BinaryRegistry[DenseVector[T], Vector[T], Op.type, DenseVector[T]] { @@ -113,11 +123,23 @@ trait DenseVectorOps extends DenseVector_GenericOps { this: DenseVector.type => OpDiv, OpSet, OpMod, - OpPow) Op <: OpType](implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { (a, b) => b }, { - _ % _ - }, { _ pow _ }) - op: Op.Impl2[T, T, T]): Op.Impl2[DenseVector[T], T, DenseVector[T]] = + OpPow) Op <: OpType]( + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) + op: Op.Impl2[T, T, T]): Op.Impl2[DenseVector[T], T, DenseVector[T]] = new Op.Impl2[DenseVector[T], T, DenseVector[T]] { def apply(a: DenseVector[T], b: T): DenseVector[T] = { val ad = a.data @@ -161,11 +183,23 @@ trait DenseVectorOps extends DenseVector_GenericOps { this: DenseVector.type => OpDiv, OpSet, OpMod, - OpPow) Op <: OpType](implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { (a, b) => b }, { - _ % _ - }, { _ pow _ }) - op: Op.Impl2[T, T, T]): Op.Impl2[T, DenseVector[T], DenseVector[T]] = + OpPow) Op <: OpType]( + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) + op: Op.Impl2[T, T, T]): Op.Impl2[T, DenseVector[T], DenseVector[T]] = new Op.Impl2[T, DenseVector[T], DenseVector[T]] { def apply(a: T, b: DenseVector[T]): DenseVector[T] = { val bd = b.data @@ -190,9 +224,19 @@ trait DenseVectorOps extends DenseVector_GenericOps { this: DenseVector.type => implicit def dv_dv_Op[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]) : Op.Impl2[DenseVector[T], DenseVector[T], DenseVector[T]] = { new Op.Impl2[DenseVector[T], DenseVector[T], DenseVector[T]] { @@ -231,9 +275,19 @@ trait DenseVectorOps extends DenseVector_GenericOps { this: DenseVector.type => implicit def dv_dv_UpdateOp[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]): Op.InPlaceImpl2[DenseVector[T], DenseVector[T]] = new Op.InPlaceImpl2[DenseVector[T], DenseVector[T]] { def apply(a: DenseVector[T], b: DenseVector[T]): Unit = { @@ -269,9 +323,18 @@ trait DenseVectorOps extends DenseVector_GenericOps { this: DenseVector.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpMulMatrix, OpDiv, OpSet, OpMod) Op <: OpType]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { _ / _ - }, { (a, b) => b }, { _ % _ }) + }, + { (a, b) => b }, { + _ % _ + }) op: Op.Impl2[T, T, T]): Op.InPlaceImpl2[DenseVector[T], T] = new Op.InPlaceImpl2[DenseVector[T], T] { def apply(a: DenseVector[T], b: T): Unit = { @@ -767,7 +830,17 @@ trait DenseVector_OrderingOps extends DenseVectorOps { this: DenseVector.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpGT, OpGTE, OpLTE, OpLT, OpEq, OpNe) Op <: OpType]( implicit @expand.sequence[Op]( - { _ > _ }, { _ >= _ }, { _ <= _ }, { _ < _ }, { _ == _ }, { _ != _ }) + { _ > _ }, { + _ >= _ + }, { + _ <= _ + }, { + _ < _ + }, { + _ == _ + }, { + _ != _ + }) op: Op.Impl2[T, T, T]) : Op.Impl2[DenseVector[T], DenseVector[T], BitVector] = new Op.Impl2[DenseVector[T], DenseVector[T], BitVector] { @@ -797,7 +870,17 @@ trait DenseVector_OrderingOps extends DenseVectorOps { this: DenseVector.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpGT, OpGTE, OpLTE, OpLT, OpEq, OpNe) Op <: OpType]( implicit @expand.sequence[Op]( - { _ > _ }, { _ >= _ }, { _ <= _ }, { _ < _ }, { _ == _ }, { _ != _ }) + { _ > _ }, { + _ >= _ + }, { + _ <= _ + }, { + _ < _ + }, { + _ == _ + }, { + _ != _ + }) op: Op.Impl2[T, T, Boolean]) : Op.Impl2[DenseVector[T], Vector[T], BitVector] = new Op.Impl2[DenseVector[T], Vector[T], BitVector] { @@ -821,7 +904,17 @@ trait DenseVector_OrderingOps extends DenseVectorOps { this: DenseVector.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpGT, OpGTE, OpLTE, OpLT, OpEq, OpNe) Op <: OpType]( implicit @expand.sequence[Op]( - { _ > _ }, { _ >= _ }, { _ <= _ }, { _ < _ }, { _ == _ }, { _ != _ }) + { _ > _ }, { + _ >= _ + }, { + _ <= _ + }, { + _ < _ + }, { + _ == _ + }, { + _ != _ + }) op: Op.Impl2[T, T, Boolean]): Op.Impl2[DenseVector[T], T, BitVector] = new Op.Impl2[DenseVector[T], T, BitVector] { def apply(a: DenseVector[T], b: T): BitVector = { 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 013f549dee8..0a7c84fd600 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 @@ -78,9 +78,19 @@ trait HashVector_DenseVector_Ops extends DenseVector_HashVector_Ops { implicit def hv_dv_UpdateOp[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]): Op.InPlaceImpl2[HashVector[T], DenseVector[T]] = new Op.InPlaceImpl2[HashVector[T], DenseVector[T]] { def apply(a: HashVector[T], b: DenseVector[T]): Unit = { @@ -97,9 +107,19 @@ trait HashVector_DenseVector_Ops extends DenseVector_HashVector_Ops { implicit def hv_dv_op[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]) : Op.Impl2[HashVector[T], DenseVector[T], DenseVector[T]] = { new Op.Impl2[HashVector[T], DenseVector[T], DenseVector[T]] { @@ -199,9 +219,19 @@ trait HashVectorOps extends HashVector_GenericOps { this: HashVector.type => implicit def hv_v_Op[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]) : Op.Impl2[HashVector[T], Vector[T], HashVector[T]] = new Op.Impl2[HashVector[T], Vector[T], HashVector[T]] { @@ -232,9 +262,15 @@ trait HashVectorOps extends HashVector_GenericOps { this: HashVector.type => OpMod, OpPow) Op <: OpType]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { + { _ + _ }, + { _ - _ }, + { _ * _ }, + { _ * _ }, { _ / _ - }, { (a, b) => b }, { _ % _ }, { _ pow _ }) + }, + { (a, b) => b }, + { _ % _ }, + { _ pow _ }) op: Op.Impl2[T, T, T], @expand.sequence[T](0, 0.0, 0.0f, 0L) zero: T): Op.Impl2[HashVector[T], T, HashVector[T]] = @@ -289,7 +325,16 @@ trait HashVectorOps extends HashVector_GenericOps { this: HashVector.type => @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod) Op <: OpType]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { (a, b) => b }, { _ % _ }) + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }) op: Op.Impl2[T, T, T]): Op.InPlaceImpl2[HashVector[T], T] = new Op.InPlaceImpl2[HashVector[T], T] { def apply(a: HashVector[T], b: T): Unit = { diff --git a/repos/breeze/math/src/main/scala/breeze/linalg/operators/MatrixOps.scala b/repos/breeze/math/src/main/scala/breeze/linalg/operators/MatrixOps.scala index 0210c07cabe..eb580613c63 100644 --- a/repos/breeze/math/src/main/scala/breeze/linalg/operators/MatrixOps.scala +++ b/repos/breeze/math/src/main/scala/breeze/linalg/operators/MatrixOps.scala @@ -145,9 +145,19 @@ trait MatrixOps extends MatrixGenericOps { this: Matrix.type => implicit def m_m_UpdateOp[ @expand.args(Int, Double, Float, Long, BigInt, Complex) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]) : BinaryUpdateRegistry[Matrix[T], Matrix[T], Op.type] = new BinaryUpdateRegistry[Matrix[T], Matrix[T], Op.type] { @@ -206,11 +216,23 @@ trait MatrixOps extends MatrixGenericOps { this: Matrix.type => OpDiv, OpSet, OpMod, - OpPow) Op <: OpType](implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { (a, b) => b }, { - _ % _ - }, { _ pow _ }) - op: Op.Impl2[T, T, T]): BinaryUpdateRegistry[Matrix[T], T, Op.type] = + OpPow) Op <: OpType]( + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) + op: Op.Impl2[T, T, T]): BinaryUpdateRegistry[Matrix[T], T, Op.type] = new BinaryUpdateRegistry[Matrix[T], T, Op.type] { override def bindingMissing(a: Matrix[T], b: T): Unit = { var c = 0 @@ -296,7 +318,17 @@ trait MatrixOps extends MatrixGenericOps { this: Matrix.type => @expand.args(Int, Long, Float, Double, BigInt, Complex) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpMulMatrix, OpDiv, OpMod, OpPow) Op]( implicit @expand.sequence[Op]( - { _ + _ }, { _ - _ }, { _ * _ }, { _ * _ }, { _ / _ }, { _ % _ }, { + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ * _ + }, { + _ / _ + }, { + _ % _ + }, { _ pow _ }) op: Op.Impl2[T, T, T]) : BinaryRegistry[T, Matrix[T], Op.type, Matrix[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 e547fa09cfe..0f2488c7c88 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 @@ -22,9 +22,19 @@ trait SparseVector_DenseVector_Ops { this: SparseVector.type => implicit def implOps_SVT_DVT_InPlace[ @expand.args(Int, Double, Float, Long) T, @expand.args(OpAdd, OpSub, OpMulScalar, OpDiv, OpSet, OpMod, OpPow) Op <: OpType]( - implicit @expand.sequence[Op]({ _ + _ }, { _ - _ }, { _ * _ }, { _ / _ }, { - (a, b) => b - }, { _ % _ }, { _ pow _ }) op: Op.Impl2[T, T, T]) + implicit @expand.sequence[Op]( + { _ + _ }, { + _ - _ + }, { + _ * _ + }, { + _ / _ + }, + { (a, b) => b }, { + _ % _ + }, { + _ pow _ + }) op: Op.Impl2[T, T, T]) : Op.InPlaceImpl2[SparseVector[T], DenseVector[T]] = new Op.InPlaceImpl2[SparseVector[T], DenseVector[T]] { 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 50728e717f9..1cbde28b912 100644 --- a/repos/breeze/math/src/main/scala/breeze/optimize/OWLQN.scala +++ b/repos/breeze/math/src/main/scala/breeze/optimize/OWLQN.scala @@ -118,7 +118,8 @@ class OWLQN[K, T](maxIter: Int, m: Int, l1reg: K => Double, tolerance: Double)( var adjValue = newVal val res = space.zipMapKeyValues.mapActive( newX, - newGrad, { + newGrad, + { case (i, xv, v) => val l1regValue = l1reg(i) require(l1regValue >= 0.0) diff --git a/repos/ensime-server/core/src/test/scala/org/ensime/config/EnsimeConfigSpec.scala b/repos/ensime-server/core/src/test/scala/org/ensime/config/EnsimeConfigSpec.scala index 8698067bd33..84139c55cb8 100644 --- a/repos/ensime-server/core/src/test/scala/org/ensime/config/EnsimeConfigSpec.scala +++ b/repos/ensime-server/core/src/test/scala/org/ensime/config/EnsimeConfigSpec.scala @@ -47,7 +47,8 @@ class EnsimeConfigSpec extends EnsimeSpec { :reference-source-roots () :compiler-args () :runtime-deps () - :test-deps ())))""", { implicit config => + :test-deps ())))""", + { implicit config => config.name shouldBe "project" config.scalaVersion shouldBe "2.10.4" val module1 = config.modules("module1") @@ -78,7 +79,8 @@ class EnsimeConfigSpec extends EnsimeSpec { :cache-dir "$cache" :subprojects ((:name "module1" :scala-version "2.10.4" - :targets ("$abc"))))""", { implicit config => + :targets ("$abc"))))""", + { implicit config => config.name shouldBe "project" config.scalaVersion shouldBe "2.10.4" val module1 = config.modules("module1") @@ -110,7 +112,8 @@ class EnsimeConfigSpec extends EnsimeSpec { :source-mode ${if (sourceMode) "t" else "nil"} :subprojects ((:name "module1" :scala-version "2.10.4" - :targets ("$abc"))))""", { implicit config => + :targets ("$abc"))))""", + { implicit config => config.sourceMode shouldBe sourceMode config.runtimeClasspath shouldBe Set(abc) config.compileClasspath shouldBe ( diff --git a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/ClientRegistry.scala b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/ClientRegistry.scala index ef14d998405..ae0c0df57a4 100644 --- a/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/ClientRegistry.scala +++ b/repos/finagle/finagle-core/src/main/scala/com/twitter/finagle/client/ClientRegistry.scala @@ -92,7 +92,8 @@ private[finagle] object RegistryEntryLifecycle { CanStackFrom .fromFun[ServiceFactory[Req, Rep]] .toStackable( - role, { factory: ServiceFactory[Req, Rep] => + role, + { factory: ServiceFactory[Req, Rep] => new ServiceFactoryProxy[Req, Rep](factory) { override def close(deadline: Time): Future[Unit] = { ClientRegistry.unregister(shown, next, params) 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 99857e7452b..4145b899479 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 @@ -236,7 +236,8 @@ class StackClientTest // don't pool or else we don't see underlying close until service is ejected from pool .remove(DefaultPool.Role) .replace( - StackClient.Role.prepFactory, { next: ServiceFactory[Unit, Unit] => + StackClient.Role.prepFactory, + { next: ServiceFactory[Unit, Unit] => next map { service: Service[Unit, Unit] => new ServiceProxy[Unit, Unit](service) { override def close(deadline: Time) = Future.never 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 3527fd525a4..9d47c0dd4cc 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 @@ -42,28 +42,29 @@ class ClientSessionTest extends FunSuite with MockitoSugar { } testSessionStatus[mux.transport.Message, mux.transport.Message]( - "mux-transport", { - tr: Transport[mux.transport.Message, mux.transport.Message] => - val session: mux.ClientSession = - new mux.ClientSession( - tr, - mux.FailureDetector.NullConfig, - "test", - NullStatsReceiver) - () => session.status + "mux-transport", + { tr: Transport[mux.transport.Message, mux.transport.Message] => + val session: mux.ClientSession = + new mux.ClientSession( + tr, + mux.FailureDetector.NullConfig, + "test", + NullStatsReceiver) + () => session.status } ) testSessionStatus[mux.transport.Message, mux.transport.Message]( - "mux-dispatcher", { - tr: Transport[mux.transport.Message, mux.transport.Message] => - val dispatcher = mux.ClientDispatcher.newRequestResponse(tr) - () => dispatcher.status + "mux-dispatcher", + { tr: Transport[mux.transport.Message, mux.transport.Message] => + val dispatcher = mux.ClientDispatcher.newRequestResponse(tr) + () => dispatcher.status } ) testSessionStatus( - "http-transport", { tr: Transport[Any, Any] => + "http-transport", + { tr: Transport[Any, Any] => val manager = mock[http.codec.ConnectionManager] when(manager.shouldClose).thenReturn(false) val wrappedT = new http.HttpTransport(tr, manager) @@ -72,7 +73,8 @@ class ClientSessionTest extends FunSuite with MockitoSugar { ) testSessionStatus( - "http-dispatcher", { tr: Transport[Any, Any] => + "http-dispatcher", + { tr: Transport[Any, Any] => val dispatcher = new HttpClientDispatcher(tr) () => dispatcher.status } @@ -84,20 +86,20 @@ class ClientSessionTest extends FunSuite with MockitoSugar { } testSessionStatus( - "memcached-dispatcher", { - tr: Transport[memcached.protocol.Command, memcached.protocol.Response] => - val cl: MyClient = new MyClient - val svc = cl.newDisp(tr) - () => svc.status + "memcached-dispatcher", + { tr: Transport[memcached.protocol.Command, memcached.protocol.Response] => + val cl: MyClient = new MyClient + val svc = cl.newDisp(tr) + () => svc.status } ) testSessionStatus( - "mysql-dispatcher", { - 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 + "mysql-dispatcher", + { 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 } ) } 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 072c89d87b6..d59acfd6e26 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 @@ -156,7 +156,8 @@ private[finagle] class ClockedDrainer( upkeep("open", init) coord.sleepUntilDiscountRemaining( - space, { () => + space, + { () => if (verbose) { log.info( "AWAIT-DISCOUNT: discount=" + space.discount() + 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 d90b0e6a068..aafdf40087e 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 @@ -77,7 +77,8 @@ private[lease] class Coordinator( new DurationAlarm((maxWait - elapsed()) / 2) min new GenerationAlarm(counter) min new PredicateAlarm(() => npending() == 0) - }, { () => + }, + { () => // TODO MN: reenable if (verbose) { log.info( diff --git a/repos/finagle/finagle-validate/src/test/scala/com/twitter/finagle/validate/ValidateNaiveTimeoutFilter.scala b/repos/finagle/finagle-validate/src/test/scala/com/twitter/finagle/validate/ValidateNaiveTimeoutFilter.scala index 5bcd6069910..4f75791287c 100644 --- a/repos/finagle/finagle-validate/src/test/scala/com/twitter/finagle/validate/ValidateNaiveTimeoutFilter.scala +++ b/repos/finagle/finagle-validate/src/test/scala/com/twitter/finagle/validate/ValidateNaiveTimeoutFilter.scala @@ -51,7 +51,8 @@ class ValidateNaiveTimeoutFilter extends FunSuite { new Event(now, latency.milliseconds, true, { b: Boolean => Try(true) }) - }, { + }, + { case (duration: Duration, f: Future[Boolean]) => f onSuccess { _ => assert(duration <= timeout) diff --git a/repos/framework/core/json-ext/src/main/scala/net/liftweb/json/ext/JodaTimeSerializer.scala b/repos/framework/core/json-ext/src/main/scala/net/liftweb/json/ext/JodaTimeSerializer.scala index d04ea376f0a..d6716eba1ea 100644 --- a/repos/framework/core/json-ext/src/main/scala/net/liftweb/json/ext/JodaTimeSerializer.scala +++ b/repos/framework/core/json-ext/src/main/scala/net/liftweb/json/ext/JodaTimeSerializer.scala @@ -41,7 +41,8 @@ case object PeriodSerializer { case JString(p) => new Period(p) case JNull => null - }, { + }, + { case p: Period => JString(p.toString) } )) @@ -52,7 +53,8 @@ case object DurationSerializer { case JInt(d) => new Duration(d.longValue) case JNull => null - }, { + }, + { case d: Duration => JInt(d.getMillis) } )) @@ -63,7 +65,8 @@ case object InstantSerializer { case JInt(i) => new Instant(i.longValue) case JNull => null - }, { + }, + { case i: Instant => JInt(i.getMillis) } )) @@ -82,7 +85,8 @@ case object DateTimeSerializer { case JString(s) => new DateTime(DateParser.parse(s, format)) case JNull => null - }, { + }, + { case d: DateTime => JString(format.dateFormat.format(d.toDate)) } )) @@ -93,7 +97,8 @@ case object DateMidnightSerializer { case JString(s) => new DateMidnight(DateParser.parse(s, format)) case JNull => null - }, { + }, + { case d: DateMidnight => JString(format.dateFormat.format(d.toDate)) } )) diff --git a/repos/framework/core/json/src/main/scala/net/liftweb/json/Meta.scala b/repos/framework/core/json/src/main/scala/net/liftweb/json/Meta.scala index cdf50bac7bf..5cf6c2525bf 100644 --- a/repos/framework/core/json/src/main/scala/net/liftweb/json/Meta.scala +++ b/repos/framework/core/json/src/main/scala/net/liftweb/json/Meta.scala @@ -226,7 +226,8 @@ private[json] object Meta { Value(rawClassOf(clazz)) } else { mappings.memoize( - (clazz, typeArgs), { + (clazz, typeArgs), + { case (t, _) => val c = rawClassOf(t) val (pt, typeInfo) = diff --git a/repos/framework/core/json/src/test/scala/net/liftweb/json/SerializationExamples.scala b/repos/framework/core/json/src/test/scala/net/liftweb/json/SerializationExamples.scala index e29f6025d7a..dd69ee3a459 100644 --- a/repos/framework/core/json/src/test/scala/net/liftweb/json/SerializationExamples.scala +++ b/repos/framework/core/json/src/test/scala/net/liftweb/json/SerializationExamples.scala @@ -312,7 +312,8 @@ object CustomSerializerExamples extends Specification { case JObject( JField("start", JInt(s)) :: JField("end", JInt(e)) :: Nil) => new Interval(s.longValue, e.longValue) - }, { + }, + { case x: Interval => JObject( JField("start", JInt(BigInt(x.startTime))) :: @@ -326,7 +327,8 @@ object CustomSerializerExamples extends Specification { { case JObject(JField("$pattern", JString(s)) :: Nil) => Pattern.compile(s) - }, { + }, + { case x: Pattern => JObject(JField("$pattern", JString(x.pattern)) :: Nil) } @@ -341,7 +343,8 @@ object CustomSerializerExamples extends Specification { .parse(s) .getOrElse( throw new MappingException("Can't parse " + s + " to Date")) - }, { + }, + { case x: Date => JObject( JField("$dt", JString(format.dateFormat.format(x))) :: Nil) 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 30df69227df..fb58ee9b918 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 @@ -138,7 +138,8 @@ abstract class MappedBinary[T <: Mapper[T]](val fieldOwner: T) (inst, v) => doField( inst, - accessor, { + accessor, + { case f: MappedBinary[T] => val toSet = v match { case null => null @@ -287,7 +288,8 @@ abstract class MappedText[T <: Mapper[T]](val fieldOwner: T) (inst, v) => doField( inst, - accessor, { + accessor, + { case f: MappedText[T] => val toSet = v match { case null => null @@ -449,7 +451,8 @@ abstract class MappedFakeClob[T <: Mapper[T]](val fieldOwner: T) (inst, v) => doField( inst, - accessor, { + accessor, + { case f: MappedFakeClob[T] => val toSet = v match { case null => null 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 16af6bdb673..fcf53f4963a 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 @@ -335,7 +335,8 @@ trait ItemsListEditor[T <: Mapper[T]] { "^ >*" #> optScript andThen ".fields *" #> { eachField[T]( - items.metaMapper, { f: MappedField[_, T] => + items.metaMapper, + { f: MappedField[_, T] => ".name" #> SHtml.link(S.uri, sortFn(f), Text(capify(f.displayName))) }, fieldFilter diff --git a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/RestHelper.scala b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/RestHelper.scala index 544741b6117..687ee0b20b5 100644 --- a/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/RestHelper.scala +++ b/repos/framework/web/webkit/src/main/scala/net/liftweb/http/rest/RestHelper.scala @@ -584,7 +584,8 @@ trait RestHelper extends LiftRules.DispatchPF { ): () => Box[LiftResponse] = () => { RestContinuation.async(reply => { asyncResolveProvider.resolveAsync( - asyncBoxContainer, { resolvedBox => + asyncBoxContainer, + { resolvedBox => boxToResp(resolvedBox).apply() openOr NotFoundResponse() } ) diff --git a/repos/gitbucket/src/main/scala/gitbucket/core/api/ApiBranchProtection.scala b/repos/gitbucket/src/main/scala/gitbucket/core/api/ApiBranchProtection.scala index 745d3c08116..c042ccb0c43 100644 --- a/repos/gitbucket/src/main/scala/gitbucket/core/api/ApiBranchProtection.scala +++ b/repos/gitbucket/src/main/scala/gitbucket/core/api/ApiBranchProtection.scala @@ -52,7 +52,8 @@ object ApiBranchProtection { case JString("off") => Off case JString("non_admins") => NonAdmins case JString("everyone") => Everyone - }, { + }, + { case x: EnforcementLevel => JString(x.name) } )) diff --git a/repos/gitbucket/src/main/scala/gitbucket/core/api/JsonFormat.scala b/repos/gitbucket/src/main/scala/gitbucket/core/api/JsonFormat.scala index 2c9c616dccb..02da112767e 100644 --- a/repos/gitbucket/src/main/scala/gitbucket/core/api/JsonFormat.scala +++ b/repos/gitbucket/src/main/scala/gitbucket/core/api/JsonFormat.scala @@ -23,7 +23,8 @@ object JsonFormat { .map(_.toDate) .getOrElse( throw new MappingException("Can't convert " + s + " to Date")) - }, { + }, + { case x: Date => JString(parserISO.print(new DateTime(x).withZone(DateTimeZone.UTC))) } @@ -50,7 +51,8 @@ object JsonFormat { ApiPath(s.substring(c.baseUrl.length)) case JString(s) => throw new MappingException("Can't convert " + s + " to ApiPath") - }, { + }, + { case ApiPath(path) => JString(c.baseUrl + path) } )) diff --git a/repos/intellij-scala/src/org/jetbrains/plugins/scala/debugger/evaluation/ScalaEvaluatorBuilderUtil.scala b/repos/intellij-scala/src/org/jetbrains/plugins/scala/debugger/evaluation/ScalaEvaluatorBuilderUtil.scala index 29e725a14cc..b51e5a82d1e 100644 --- a/repos/intellij-scala/src/org/jetbrains/plugins/scala/debugger/evaluation/ScalaEvaluatorBuilderUtil.scala +++ b/repos/intellij-scala/src/org/jetbrains/plugins/scala/debugger/evaluation/ScalaEvaluatorBuilderUtil.scala @@ -2095,7 +2095,8 @@ object ScalaEvaluatorBuilderUtil { def localFunctionIndex(named: PsiNamedElement): Int = { elementsWithSameNameIndex( - named, { + named, + { case f: ScFunction if f.isLocal && f.name == named.name => true case Both(ScalaPsiUtil.inNameContext(LazyVal(_)), lzy: ScBindingPattern) if lzy.name == named.name => diff --git a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/base/ScStableCodeReferenceElementImpl.scala b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/base/ScStableCodeReferenceElementImpl.scala index 42b035efca3..2953dc69627 100644 --- a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/base/ScStableCodeReferenceElementImpl.scala +++ b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/base/ScStableCodeReferenceElementImpl.scala @@ -223,7 +223,8 @@ class ScStableCodeReferenceElementImpl(node: ASTNode) //todo: so what to return? probable PIEAE after such code invocation case _ => return safeBindToElement( - qname, { + qname, + { case (qual, true) => ScalaPsiElementFactory .createReferenceFromText(qual, getContext, this) diff --git a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScReferenceExpressionImpl.scala b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScReferenceExpressionImpl.scala index ecab972bba1..e98586ff8dd 100644 --- a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScReferenceExpressionImpl.scala +++ b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/impl/expr/ScReferenceExpressionImpl.scala @@ -86,7 +86,8 @@ class ScReferenceExpressionImpl(node: ASTNode) containingClass: Option[PsiClass]): PsiElement = { def tail(qualName: String)(simpleImport: => PsiElement): PsiElement = { safeBindToElement( - qualName, { + qualName, + { case (qual, true) => ScalaPsiElementFactory .createExpressionWithContextFromText(qual, getContext, this) diff --git a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/types/ScTypePresentation.scala b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/types/ScTypePresentation.scala index 65ad7871d84..83bfe99ccf9 100644 --- a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/types/ScTypePresentation.scala +++ b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/psi/types/ScTypePresentation.scala @@ -44,10 +44,12 @@ import scala.collection.mutable.ArrayBuffer trait ScTypePresentation { def presentableText(t: ScType) = typeText( - t, { + t, + { case c: PsiClass => ScalaPsiUtil.nameWithPrefixIfNeeded(c) case e => e.name - }, { + }, + { case obj: ScObject if Set("scala.Predef", "scala").contains(obj.qualifiedName) => "" diff --git a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/refactoring/extractMethod/ScalaExtractMethodHandler.scala b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/refactoring/extractMethod/ScalaExtractMethodHandler.scala index a9774f77eff..b9d005b6805 100644 --- a/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/refactoring/extractMethod/ScalaExtractMethodHandler.scala +++ b/repos/intellij-scala/src/org/jetbrains/plugins/scala/lang/refactoring/extractMethod/ScalaExtractMethodHandler.scala @@ -172,7 +172,8 @@ class ScalaExtractMethodHandler extends RefactoringActionHandler { } else if (siblings.length > 1) { ScalaRefactoringUtil.showChooser( editor, - siblings, { (selectedValue: PsiElement) => + siblings, + { (selectedValue: PsiElement) => invokeDialog( project, editor, diff --git a/repos/lila/app/controllers/Main.scala b/repos/lila/app/controllers/Main.scala index f5938709acd..0c0bb68ea48 100644 --- a/repos/lila/app/controllers/Main.scala +++ b/repos/lila/app/controllers/Main.scala @@ -25,7 +25,8 @@ object Main extends LilaController { implicit val req = ctx.body fuccess { blindForm.bindFromRequest.fold( - err => BadRequest, { + err => BadRequest, + { case (enable, redirect) => Redirect(redirect) withCookies lila.common.LilaCookie.cookie( Env.api.Accessibility.blindCookieName, diff --git a/repos/lila/app/controllers/QaAnswer.scala b/repos/lila/app/controllers/QaAnswer.scala index 38a6fdc50a1..d0ac8dd117e 100644 --- a/repos/lila/app/controllers/QaAnswer.scala +++ b/repos/lila/app/controllers/QaAnswer.scala @@ -83,7 +83,8 @@ object QaAnswer extends QaController { WithOwnAnswer(questionId, answerId) { q => a => implicit val req = ctx.body forms.moveAnswer.bindFromRequest.fold( - err => renderQuestion(q), { + err => renderQuestion(q), + { case "question" => api.answer.moveToQuestionComment(a, q) inject Redirect(routes.QaQuestion.show(q.id, q.slug)) diff --git a/repos/lila/app/controllers/Setup.scala b/repos/lila/app/controllers/Setup.scala index 08f523497cb..6a11a5bda81 100644 --- a/repos/lila/app/controllers/Setup.scala +++ b/repos/lila/app/controllers/Setup.scala @@ -69,7 +69,8 @@ object Setup extends LilaController with TheftPrevention { negotiate( html = Lobby.renderHome(Results.BadRequest), api = _ => fuccess(BadRequest(errorsAsJson(f))) - ), { + ), + { case config => userId ?? UserRepo.byId flatMap { destUser => diff --git a/repos/lila/app/controllers/Team.scala b/repos/lila/app/controllers/Team.scala index 981bb4356fc..2d8cce9bc7a 100644 --- a/repos/lila/app/controllers/Team.scala +++ b/repos/lila/app/controllers/Team.scala @@ -195,7 +195,8 @@ object Team extends LilaController { case (team, request) => { implicit val req = ctx.body forms.processRequest.bindFromRequest.fold( - _ => fuccess(routes.Team.show(team.id).toString), { + _ => fuccess(routes.Team.show(team.id).toString), + { case (decision, url) => api.processRequest(team, request, (decision === "accept")) inject url } diff --git a/repos/lila/modules/message/src/main/DataForm.scala b/repos/lila/modules/message/src/main/DataForm.scala index 2a6d1b13b4e..f2d8c8adbb7 100644 --- a/repos/lila/modules/message/src/main/DataForm.scala +++ b/repos/lila/modules/message/src/main/DataForm.scala @@ -16,7 +16,8 @@ private[message] final class DataForm(security: MessageSecurity) { "username" -> nonEmptyText(maxLength = 20) .verifying("Unknown username", { fetchUser(_).isDefined }) .verifying( - "Sorry, this player doesn't accept new messages", { name => + "Sorry, this player doesn't accept new messages", + { name => Granter(_.MessageAnyone)(me) || { security.canMessage(me.id, User normalize name) awaitSeconds 2 // damn you blocking API } diff --git a/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/AsyncQueryResultServiceHandler.scala b/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/AsyncQueryResultServiceHandler.scala index c8b0311a2f1..c00d310aaa2 100644 --- a/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/AsyncQueryResultServiceHandler.scala +++ b/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/AsyncQueryResultServiceHandler.scala @@ -68,7 +68,8 @@ class AsyncQueryResultServiceHandler(jobManager: JobManager[Future])( .listMessages(jobId, channels.Error, None) } yield { result.fold( - { _ => HttpResponse[ByteChunk](NotFound) }, { + { _ => HttpResponse[ByteChunk](NotFound) }, + { case (mimeType0, data0) => val mimeType = mimeType0 getOrElse (MimeTypes.application / MimeTypes.json) diff --git a/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/BrowseServiceHandler.scala b/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/BrowseServiceHandler.scala index 9c3a86eed55..40dfab78ca9 100644 --- a/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/BrowseServiceHandler.scala +++ b/repos/platform/bifrost/src/main/scala/com/precog/bifrost/service/BrowseServiceHandler.scala @@ -114,7 +114,8 @@ class BrowseSupport[M[+_]: Bind](vfs: VFSMetadata[M]) { { case ResourceError.NotFound(_) => \/.right(JUndefined) case otherError => \/.left(otherError) - }, { + }, + { case PathStructure(types, children) => \/.right( JObject( @@ -178,7 +179,8 @@ class BrowseServiceHandler[A]( InternalServerError, content = Some(JObject( "errors" -> JArray("sorry, we're looking into it!".serialize)))) - }, { + }, + { case ResourceError.NotFound(message) => HttpResponse[JValue]( HttpStatusCodes.NotFound, diff --git a/repos/platform/mimir/src/main/scala/com/precog/mimir/StringLib.scala b/repos/platform/mimir/src/main/scala/com/precog/mimir/StringLib.scala index 3e7717febc9..c2f10471dae 100644 --- a/repos/platform/mimir/src/main/scala/com/precog/mimir/StringLib.scala +++ b/repos/platform/mimir/src/main/scala/com/precog/mimir/StringLib.scala @@ -323,12 +323,14 @@ trait StringLibModule[M[+_]] extends ColumnarTableLibModule[M] { new StrFrom.SD( dateToStrCol(c1), c2, - (s, n) => n >= 0 && (n % 1 == 0), { (s, n) => f(s, n.toInt) }) + (s, n) => n >= 0 && (n % 1 == 0), + { (s, n) => f(s, n.toInt) }) case (c1: DateColumn, c2: NumColumn) => new StrFrom.SN( dateToStrCol(c1), c2, - (s, n) => n >= 0 && (n % 1 == 0), { (s, n) => f(s, n.toInt) }) + (s, n) => n >= 0 && (n % 1 == 0), + { (s, n) => f(s, n.toInt) }) } } diff --git a/repos/platform/niflheim/src/main/scala/com/precog/niflheim/CookedBlockFormat.scala b/repos/platform/niflheim/src/main/scala/com/precog/niflheim/CookedBlockFormat.scala index d09df5bacc9..400ff49a1d5 100644 --- a/repos/platform/niflheim/src/main/scala/com/precog/niflheim/CookedBlockFormat.scala +++ b/repos/platform/niflheim/src/main/scala/com/precog/niflheim/CookedBlockFormat.scala @@ -65,7 +65,8 @@ object V1CookedBlockFormat extends CookedBlockFormat with Chunker { val ColumnRefCodec = Codec.CompositeCodec[CPath, CType, (CPath, CType)]( CPathCodec, CTypeCodec, - identity, { (a: CPath, b: CType) => (a, b) }) + identity, + { (a: CPath, b: CType) => (a, b) }) val SegmentIdCodec = Codec.CompositeCodec[Long, (CPath, CType), SegmentId]( Codec.LongCodec, diff --git a/repos/platform/quirrel/src/main/scala/com/precog/quirrel/Solver.scala b/repos/platform/quirrel/src/main/scala/com/precog/quirrel/Solver.scala index bc9a5266727..ff13bca4346 100644 --- a/repos/platform/quirrel/src/main/scala/com/precog/quirrel/Solver.scala +++ b/repos/platform/quirrel/src/main/scala/com/precog/quirrel/Solver.scala @@ -1,19 +1,19 @@ /* - * ____ ____ _____ ____ ___ ____ + * ____ ____ _____ ____ ___ ____ * | _ \ | _ \ | ____| / ___| / _/ / ___| Precog (R) * | |_) | | |_) | | _| | | | | /| | | _ Advanced Analytics Engine for NoSQL Data * | __/ | _ < | |___ | |___ |/ _| | | |_| | Copyright (C) 2010 - 2013 SlamData, Inc. * |_| |_| \_\ |_____| \____| /__/ \____| All Rights Reserved. * - * This program is free software: you can redistribute it and/or modify it under the terms of the - * GNU Affero General Public License as published by the Free Software Foundation, either version + * This program is free software: you can redistribute it and/or modify it under the terms of the + * GNU Affero General Public License as published by the Free Software Foundation, either version * 3 of the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See + * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU Affero General Public License for more details. * - * You should have received a copy of the GNU Affero General Public License along with this + * You should have received a copy of the GNU Affero General Public License along with this * program. If not, see . * */ @@ -29,109 +29,191 @@ import scala.collection.parallel.ParSet trait Solver extends parser.AST with typer.Binder { import Function._ import ast._ - + private[this] val enableTrace = false - - def solve(tree: Expr, sigma: Sigma)(partialPred: PartialFunction[Node, Boolean]): Expr => Option[Expr] = { + + def solve(tree: Expr, sigma: Sigma)( + partialPred: PartialFunction[Node, Boolean]): Expr => Option[Expr] = { val predicate = partialPred.lift andThen { _ getOrElse false } - + def sigmaFormal(d: Dispatch): Option[Expr] = d.binding match { case FormalBinding(let) => sigma get ((d.name, let)) - case _ => None + case _ => None } - + // VERY IMPORTANT!!! each rule must represent a monotonic reduction in tree complexity lazy val Rules: Set[PartialFunction[Expr, Set[Expr]]] = Set( - { case Add(loc, left, right) if left equalsIgnoreLoc right => Set(Mul(loc, NumLit(loc, "2"), left)) }, - { case Sub(loc, left, right) if left equalsIgnoreLoc right => Set(NumLit(loc, "0")) }, - { case Div(loc, left, right) if left equalsIgnoreLoc right => Set(NumLit(loc, "1")) }, - - { case Add(loc, left, right) => Set(Add(loc, right, left)) }, - { case Sub(loc, left, right) => Set(Add(loc, Neg(loc, right), left)) }, + { + case Add(loc, left, right) if left equalsIgnoreLoc right => + Set(Mul(loc, NumLit(loc, "2"), left)) + }, + { + case Sub(loc, left, right) if left equalsIgnoreLoc right => + Set(NumLit(loc, "0")) + }, + { + case Div(loc, left, right) if left equalsIgnoreLoc right => + Set(NumLit(loc, "1")) + }, + { case Add(loc, left, right) => Set(Add(loc, right, left)) }, + { case Sub(loc, left, right) => Set(Add(loc, Neg(loc, right), left)) }, { case Add(loc, Neg(_, left), right) => Set(Sub(loc, right, left)) }, - { case Mul(loc, left, right) => Set(Mul(loc, right, left)) }, - - { case Add(loc, Add(loc2, x, y), z) => Set(Add(loc, x, Add(loc2, y, z))) }, - { case Mul(loc, Mul(loc2, x, y), z) => Set(Mul(loc, x, Mul(loc2, y, z))) }, - - { case Add(loc, Mul(loc2, x, y), z) if y equalsIgnoreLoc z => Set(Mul(loc2, Add(loc, x, NumLit(loc, "1")), y)) }, - { case Add(loc, Mul(loc2, w, x), Mul(loc3, y, z)) if x equalsIgnoreLoc z => Set(Mul(loc2, Add(loc, w, y), x)) }, - - { case Sub(loc, Mul(loc2, x, y), z) if y equalsIgnoreLoc z => Set(Mul(loc2, Sub(loc, x, NumLit(loc, "1")), y)) }, - { case Sub(loc, Mul(loc2, w, x), Mul(loc3, y, z)) if x equalsIgnoreLoc z => Set(Mul(loc2, Sub(loc, w, y), x)) }, - - { case Add(loc, Div(loc2, x, y), z) => Set(Div(loc2, Add(loc, x, Mul(loc, z, y)), y)) }, - { case Add(loc, Div(loc2, w, x), Div(loc3, y, z)) => Set(Div(loc2, Add(loc, Mul(loc2, w, z), Mul(loc3, y, x)), Mul(loc2, x, z))) }, - + { case Mul(loc, left, right) => Set(Mul(loc, right, left)) }, + { case Add(loc, Add(loc2, x, y), z) => Set(Add(loc, x, Add(loc2, y, z))) }, + { case Mul(loc, Mul(loc2, x, y), z) => Set(Mul(loc, x, Mul(loc2, y, z))) }, + { + case Add(loc, Mul(loc2, x, y), z) if y equalsIgnoreLoc z => + Set(Mul(loc2, Add(loc, x, NumLit(loc, "1")), y)) + }, + { + case Add(loc, Mul(loc2, w, x), Mul(loc3, y, z)) + if x equalsIgnoreLoc z => + Set(Mul(loc2, Add(loc, w, y), x)) + }, + { + case Sub(loc, Mul(loc2, x, y), z) if y equalsIgnoreLoc z => + Set(Mul(loc2, Sub(loc, x, NumLit(loc, "1")), y)) + }, + { + case Sub(loc, Mul(loc2, w, x), Mul(loc3, y, z)) + if x equalsIgnoreLoc z => + Set(Mul(loc2, Sub(loc, w, y), x)) + }, + { + case Add(loc, Div(loc2, x, y), z) => + Set(Div(loc2, Add(loc, x, Mul(loc, z, y)), y)) + }, + { + case Add(loc, Div(loc2, w, x), Div(loc3, y, z)) => + Set( + Div( + loc2, + Add(loc, Mul(loc2, w, z), Mul(loc3, y, x)), + Mul(loc2, x, z))) + }, { case Mul(loc, Div(loc2, x, y), z) => Set(Div(loc2, Mul(loc, x, z), y)) }, - { case Mul(loc, Div(loc2, w, x), Div(loc3, y, z)) => Set(Div(loc2, Mul(loc, w, y), Mul(loc, x, z))) }, - + { + case Mul(loc, Div(loc2, w, x), Div(loc3, y, z)) => + Set(Div(loc2, Mul(loc, w, y), Mul(loc, x, z))) + }, { case Div(_, Mul(_, x, y), z) if x equalsIgnoreLoc z => Set(y) }, - { case Div(loc, Mul(_, w, x), Mul(_, y, z)) if w equalsIgnoreLoc y => Set(Div(loc, x, z)) }, - - { case Div(loc, Div(loc2, w, x), Div(loc3, y, z)) => Set(Div(loc, Mul(loc2, w, z), Mul(loc3, x, y))) }, - - { case Sub(loc, Div(loc2, x, y), z) => Set(Div(loc2, Sub(loc, x, Mul(loc, z, y)), y)) }, - { case Sub(loc, Div(loc2, w, x), Div(loc3, y, z)) => Set(Div(loc2, Sub(loc, Mul(loc2, w, z), Mul(loc3, y, x)), Mul(loc2, x, z))) }, - - { case Neg(loc, Add(loc2, x, y)) => Set(Add(loc2, Neg(loc, x), Neg(loc, y))) }, - { case Neg(loc, Sub(loc2, x, y)) => Set(Sub(loc2, Neg(loc, x), Neg(loc, y))) }, - { case Neg(loc, Mul(loc2, x, y)) => Set(Mul(loc2, Neg(loc, x), y), Mul(loc2, x, Neg(loc, y))) }, - { case Neg(loc, Div(loc2, x, y)) => Set(Div(loc2, Neg(loc, x), y), Div(loc2, x, Neg(loc, y))) }, + { + case Div(loc, Mul(_, w, x), Mul(_, y, z)) if w equalsIgnoreLoc y => + Set(Div(loc, x, z)) + }, + { + case Div(loc, Div(loc2, w, x), Div(loc3, y, z)) => + Set(Div(loc, Mul(loc2, w, z), Mul(loc3, x, y))) + }, + { + case Sub(loc, Div(loc2, x, y), z) => + Set(Div(loc2, Sub(loc, x, Mul(loc, z, y)), y)) + }, + { + case Sub(loc, Div(loc2, w, x), Div(loc3, y, z)) => + Set( + Div( + loc2, + Sub(loc, Mul(loc2, w, z), Mul(loc3, y, x)), + Mul(loc2, x, z))) + }, + { + case Neg(loc, Add(loc2, x, y)) => + Set(Add(loc2, Neg(loc, x), Neg(loc, y))) + }, + { + case Neg(loc, Sub(loc2, x, y)) => + Set(Sub(loc2, Neg(loc, x), Neg(loc, y))) + }, + { + case Neg(loc, Mul(loc2, x, y)) => + Set(Mul(loc2, Neg(loc, x), y), Mul(loc2, x, Neg(loc, y))) + }, + { + case Neg(loc, Div(loc2, x, y)) => + Set(Div(loc2, Neg(loc, x), y), Div(loc2, x, Neg(loc, y))) + }, { case Neg(_, Neg(_, x)) => Set(x) }, - - { case Add(loc, left, right) => for (left2 <- possibilities(left) + left; right2 <- possibilities(right) + right) yield Add(loc, left2, right2) }, - { case Sub(loc, left, right) => for (left2 <- possibilities(left) + left; right2 <- possibilities(right) + right) yield Sub(loc, left2, right2) }, - { case Mul(loc, left, right) => for (left2 <- possibilities(left) + left; right2 <- possibilities(right) + right) yield Mul(loc, left2, right2) }, - { case Div(loc, left, right) => for (left2 <- possibilities(left) + left; right2 <- possibilities(right) + right) yield Div(loc, left2, right2) }, - + { + case Add(loc, left, right) => + for (left2 <- possibilities(left) + left; + right2 <- possibilities(right) + right) + yield Add(loc, left2, right2) + }, + { + case Sub(loc, left, right) => + for (left2 <- possibilities(left) + left; + right2 <- possibilities(right) + right) + yield Sub(loc, left2, right2) + }, + { + case Mul(loc, left, right) => + for (left2 <- possibilities(left) + left; + right2 <- possibilities(right) + right) + yield Mul(loc, left2, right2) + }, + { + case Div(loc, left, right) => + for (left2 <- possibilities(left) + left; + right2 <- possibilities(right) + right) + yield Div(loc, left2, right2) + }, { case Neg(loc, child) => possibilities(child) map neg(loc) }, { case Paren(_, child) => Set(child) }, - - { case d @ Dispatch(_, id, _) if sigmaFormal(d).isDefined => sigmaFormal(d).toSet }) - + { + case d @ Dispatch(_, id, _) if sigmaFormal(d).isDefined => + sigmaFormal(d).toSet + } + ) + def inner(tree: Expr): Expr => Option[Expr] = tree match { case n if predicate(n) => Some apply _ - + case tree @ Dispatch(_, id, actuals) => { tree.binding match { case LetBinding(let) => { val ids = let.params map { Identifier(Vector(), _) } val sigma2 = sigma ++ (ids zip Stream.continually(let) zip actuals) - solve(let.left, sigma2)(partialPred) // not inner! + solve(let.left, sigma2)(partialPred) // not inner! } - + case FormalBinding(let) => { val actualM = sigma get ((id, let)) val resultM = actualM map { solve(_, sigma)(partialPred) } resultM getOrElse sys.error("er...?") } - + case _ => const(None) _ } } - - case Add(loc, left, right) => solveBinary(tree, left, right)(sub(loc), sub(loc)) - case Sub(loc, left, right) => solveBinary(tree, left, right)(add(loc), sub(loc) andThen { _ andThen neg(loc) }) - case Mul(loc, left, right) => solveBinary(tree, left, right)(div(loc), div(loc)) - case Div(loc, left, right) => solveBinary(tree, left, right)(mul(loc), flip(div(loc))) + + case Add(loc, left, right) => + solveBinary(tree, left, right)(sub(loc), sub(loc)) + case Sub(loc, left, right) => + solveBinary(tree, left, right)(add(loc), sub(loc) andThen { + _ andThen neg(loc) + }) + case Mul(loc, left, right) => + solveBinary(tree, left, right)(div(loc), div(loc)) + case Div(loc, left, right) => + solveBinary(tree, left, right)(mul(loc), flip(div(loc))) case Neg(loc, child) => inner(child) andThen { _ map neg(loc) } case Paren(_, child) => inner(child) - case _ => const(None) _ + case _ => const(None) _ } - - def solveBinary(tree: Expr, left: Expr, right: Expr)(invertLeft: Expr => Expr => Expr, invertRight: Expr => Expr => Expr): Expr => Option[Expr] = { + + def solveBinary(tree: Expr, left: Expr, right: Expr)( + invertLeft: Expr => Expr => Expr, + invertRight: Expr => Expr => Expr): Expr => Option[Expr] = { val inLeft = isSubtree(left) val inRight = isSubtree(right) - + if (inLeft && inRight) { - val results = simplify(tree) map { xs => - (inner(xs.head), xs) - } - - results.foldLeft(const[Option[Expr], Expr](None) _) { - case (acc, (f, trace)) => e => - acc(e) orElse (f(e) map { e2 => printTrace(trace); e2 }) + val results = simplify(tree) map { xs => (inner(xs.head), xs) } + + results.foldLeft(const[Option[Expr], Expr](None) _) { + case (acc, (f, trace)) => + e => acc(e) orElse (f(e) map { e2 => printTrace(trace); e2 }) } } else if (inLeft && !inRight) { inner(left) compose flip(invertLeft)(right) @@ -141,136 +223,153 @@ trait Solver extends parser.AST with typer.Binder { const(None) } } - + def simplify(tree: Expr) = search(Set(tree :: Nil), Set(), Set()) - + @tailrec - def search(work: Set[List[Expr]], seen: Set[Expr], results: Set[List[Expr]]): Set[List[Expr]] = { + def search( + work: Set[List[Expr]], + seen: Set[Expr], + results: Set[List[Expr]]): Set[List[Expr]] = { val filteredWork = work filterNot { xs => seen(xs.head) } // println("Examining: " + (filteredWork map { _.head } map printInfix)) if (filteredWork.isEmpty) { results } else { - val (results2, newWork) = filteredWork partition { xs => isSimplified(xs.head) } + val (results2, newWork) = filteredWork partition { xs => + isSimplified(xs.head) + } val newWorkLists = newWork flatMap { xs => possibilities(xs.head) map { _ :: xs } } - + // return just the first set of results we find if (results2.isEmpty) - search(newWorkLists, seen ++ (filteredWork map { _.head }), results ++ results2) + search( + newWorkLists, + seen ++ (filteredWork map { _.head }), + results ++ results2) else results2 } } - + def isSimplified(tree: Expr) = tree match { case Add(_, left, right) => !isSubtree(left) || !isSubtree(right) case Sub(_, left, right) => !isSubtree(left) || !isSubtree(right) case Mul(_, left, right) => !isSubtree(left) || !isSubtree(right) case Div(_, left, right) => !isSubtree(left) || !isSubtree(right) - case _ => !isSubtree(tree) + case _ => !isSubtree(tree) } - + def possibilities(expr: Expr): Set[Expr] = Rules filter { _ isDefinedAt expr } flatMap { _(expr) } - + def isSubtree(tree: Node): Boolean = { def inner(tree: Node, sigma: Sigma): Boolean = tree match { case tree if predicate(tree) => true - + case tree @ Dispatch(_, id, actuals) => { tree.binding match { case LetBinding(let) => { val ids = let.params map { Identifier(Vector(), _) } - val sigma2 = sigma ++ (ids zip Stream.continually(let) zip actuals) + val sigma2 = + sigma ++ (ids zip Stream.continually(let) zip actuals) inner(let.left, sigma2) } - + case FormalBinding(let) => { val actualM = sigma get ((id, let)) val resultM = actualM map { inner(_, sigma) } resultM getOrElse sys.error("er...?") } - + case _ => false } } - + case _ => tree.children map { inner(_, sigma) } exists identity } - + inner(tree, sigma) } - + inner(tree) } /** - * Note that this really only works for `Eq` at present. Will improve things - * further in future. - */ - def solveRelation(re: ComparisonOp, sigma: Sigma)(predicate: PartialFunction[Node, Boolean]): Option[Expr] = { + * Note that this really only works for `Eq` at present. Will improve things + * further in future. + */ + def solveRelation(re: ComparisonOp, sigma: Sigma)( + predicate: PartialFunction[Node, Boolean]): Option[Expr] = { val leftRight: Option[(LineStream, Expr, Expr)] = re match { - case Lt(_, _, _) => None + case Lt(_, _, _) => None case LtEq(_, _, _) => None - case Gt(_, _, _) => None + case Gt(_, _, _) => None case GtEq(_, _, _) => None - + case Eq(loc, left, right) => Some((loc, left, right)) - case NotEq(_, _, _) => None + case NotEq(_, _, _) => None } - + val result = leftRight flatMap { - case (loc, left, right) if predicate.isDefinedAt(left) && predicate(left) => + case (loc, left, right) + if predicate.isDefinedAt(left) && predicate(left) => Some(right) - - case (loc, left, right) if predicate.isDefinedAt(right) && predicate(right) => + + case (loc, left, right) + if predicate.isDefinedAt(right) && predicate(right) => Some(left) - + case (loc, left, right) => { // try both addition and multiplication groups lazy val sub = Sub(loc, left, right) lazy val div = Div(loc, left, right) - + lazy val first = solve(sub, sigma)(predicate)(NumLit(loc, "0")) lazy val second = solve(div, sigma)(predicate)(NumLit(loc, "1")) - + first orElse second } } - + // big assumption here!!!! we're assuming that these phases only require locally-synthetic attributes result foreach { e => bindRoot(e, e) } - + result } - - def solveComplement(c: Comp, sigma: Sigma): PartialFunction[Node, Boolean] => Option[Expr] = c.child match { - case Lt(loc, left, right) => solveRelation(GtEq(loc, left, right), sigma) - case LtEq(loc, left, right) => solveRelation(Gt(loc, left, right), sigma) - case Gt(loc, left, right) => solveRelation(LtEq(loc, left, right), sigma) - case GtEq(loc, left, right) => solveRelation(Lt(loc, left, right), sigma) - - case Eq(loc, left, right) => solveRelation(NotEq(loc, left, right), sigma) - case NotEq(loc, left, right) => solveRelation(Eq(loc, left, right), sigma) - - case _ => const(None) - } - + + def solveComplement( + c: Comp, + sigma: Sigma): PartialFunction[Node, Boolean] => Option[Expr] = + c.child match { + case Lt(loc, left, right) => solveRelation(GtEq(loc, left, right), sigma) + case LtEq(loc, left, right) => solveRelation(Gt(loc, left, right), sigma) + case Gt(loc, left, right) => solveRelation(LtEq(loc, left, right), sigma) + case GtEq(loc, left, right) => solveRelation(Lt(loc, left, right), sigma) + + case Eq(loc, left, right) => solveRelation(NotEq(loc, left, right), sigma) + case NotEq(loc, left, right) => solveRelation(Eq(loc, left, right), sigma) + + case _ => const(None) + } + private def printTrace(trace: List[Expr]) { if (enableTrace) { println("*** Solution Point!") - println(trace.reverse map { e => printSExp(e) } mkString "\n\n") + println(trace.reverse map { e => + printSExp(e) + } mkString "\n\n") } } - + private val add = Add.curried private val sub = Sub.curried private val mul = Mul.curried private val div = Div.curried private val neg = Neg.curried - + private def flip[A, B, C](f: A => B => C)(b: B)(a: A) = f(a)(b) } diff --git a/repos/platform/ratatoskr/src/main/scala/com/precog/ratatoskr/Ratatoskr.scala b/repos/platform/ratatoskr/src/main/scala/com/precog/ratatoskr/Ratatoskr.scala index fd270c84713..9c8110993e3 100644 --- a/repos/platform/ratatoskr/src/main/scala/com/precog/ratatoskr/Ratatoskr.scala +++ b/repos/platform/ratatoskr/src/main/scala/com/precog/ratatoskr/Ratatoskr.scala @@ -167,7 +167,8 @@ object KafkaTools extends Command { "r", "range", "", - "show message range, e.g.: 5:10 :100 10:", { s: String => + "show message range, e.g.: 5:10 :100 10:", + { s: String => val range = MessageRange.parse(s) config.range = range.getOrElse(sys.error("Invalid range specification: " + s)) @@ -176,9 +177,8 @@ object KafkaTools extends Command { intOpt( "i", "trackInterval", - "When running a usage report, stats will be emitted every messages. Default = 50000", { - (i: Int) => config.trackInterval = i - }) + "When running a usage report, stats will be emitted every messages. Default = 50000", + { (i: Int) => config.trackInterval = i }) opt("l", "local", "dump local kafka file(s)", { config.operation = Some(DumpLocal) }) @@ -201,9 +201,8 @@ object KafkaTools extends Command { "k", "lookupDatabase", "accounts database name", - "Use this database for email lookups in usage reports", { (s: String) => - config.lookupDatabase = Some(s) - }) + "Use this database for email lookups in usage reports", + { (s: String) => config.lookupDatabase = Some(s) }) opt( "v2", "centralToLocal", @@ -214,12 +213,12 @@ object KafkaTools extends Command { opt( "f", "reportFormat", - "The format to use for usage reports. Either csv or json (default)", { - (s: String) => - s.toLowerCase match { - case format @ ("csv" | "json") => config.reportFormat = format - case other => sys.error("Invalid report format: " + other) - } + "The format to use for usage reports. Either csv or json (default)", + { (s: String) => + s.toLowerCase match { + case format @ ("csv" | "json") => config.reportFormat = format + case other => sys.error("Invalid report format: " + other) + } } ) arglist("", "The files to process", { (s: String) => @@ -686,9 +685,8 @@ object ZookeeperTools extends Command { opt( "uc", "update_checkpoints", - "Update agent state. Format = path:json", { s: String => - config.updateCheckpoint = Some(s) - }) + "Update agent state. Format = path:json", + { s: String => config.updateCheckpoint = Some(s) }) opt("ua", "update_agents", "Update agent state. Format = path:json", { s: String => config.updateAgent = Some(s) }) @@ -826,16 +824,14 @@ object IngestTools extends Command { "s", "limit", "", - "if sync is greater than the specified limit an error will occur", { - s: Int => config.limit = s - }) + "if sync is greater than the specified limit an error will occur", + { s: Int => config.limit = s }) intOpt( "l", "lag", "", - "if update lag is greater than the specified value an error will occur", { - l: Int => config.lag = l - }) + "if update lag is greater than the specified value an error will occur", + { l: Int => config.lag = l }) opt("z", "zookeeper", "The zookeeper host:port", { s: String => config.zkConn = s }) @@ -964,9 +960,8 @@ object ImportTools extends Command with Logging { "o", "owner", "", - "Owner account ID to insert data under", { s: String => - config.accountId = s - }) + "Owner account ID to insert data under", + { s: String => config.accountId = s }) opt("s", "storage", "", "directory containing data files", { s: String => config.storageRoot = new File(s) }) @@ -974,9 +969,8 @@ object ImportTools extends Command with Logging { "a", "archive", "", - "directory containing archived data files", { s: String => - config.archiveRoot = new File(s) - }) + "directory containing archived data files", + { s: String => config.archiveRoot = new File(s) }) arglist(" ...", "json input file mappings {db}={input}", { s: String => val parts = s.split("=") diff --git a/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/table/SliceTransform.scala b/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/table/SliceTransform.scala index 4976ef02c19..3f7dabfc7b7 100644 --- a/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/table/SliceTransform.scala +++ b/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/table/SliceTransform.scala @@ -617,7 +617,8 @@ trait SliceTransforms[M[+_]] case Scan(source, scanner) => composeSliceTransform2(source) andThen { SliceTransform1.liftM[scanner.A]( - scanner.init, { (state: scanner.A, slice: Slice) => + scanner.init, + { (state: scanner.A, slice: Slice) => val (newState, newCols) = scanner.scan(state, slice.columns, 0 until slice.size) @@ -639,7 +640,8 @@ trait SliceTransforms[M[+_]] val cols = mapper.map(slice.columns, 0 until slice.size) ((), Slice(cols, slice.size)) }) - }, { mapper => + }, + { mapper => SliceTransform1[Unit]((), { (_: Unit, slice: Slice) => mapper.map(slice.columns, 0 until slice.size) map { cols => ((), Slice(cols, slice.size)) @@ -828,7 +830,8 @@ trait SliceTransforms[M[+_]] case (sta, stb) => SliceTransform1[(A, B)]( - (sta.initial, stb.initial), { + (sta.initial, stb.initial), + { case ((a0, b0), s0) => for (ares <- sta.f(a0, s0); bres <- stb.f(b0, s0)) yield { val (a, sa) = ares @@ -853,7 +856,8 @@ trait SliceTransforms[M[+_]] stb: SliceTransform1S[_], stc: SliceTransform1S[_]) => SliceTransform1S( - (sta.initial, stb.initial, stc.initial), { + (sta.initial, stb.initial, stc.initial), + { case ((a0, b0, c0), s0) => val (a, sa) = sta.f0(a0, s0) val (b, sb) = stb.f0(b0, s0) @@ -864,7 +868,8 @@ trait SliceTransforms[M[+_]] case (sta, stb, stc) => SliceTransform1M( - (sta.initial, stb.initial, stc.initial), { + (sta.initial, stb.initial, stc.initial), + { case ((a0, b0, c0), s0) => for { resa <- sta.f(a0, s0) @@ -1095,7 +1100,8 @@ trait SliceTransforms[M[+_]] (this, that) match { case (sta: SliceTransform2S[_], stb: SliceTransform2S[_]) => SliceTransform2S[(A, B)]( - (sta.initial, stb.initial), { + (sta.initial, stb.initial), + { case ((a0, b0), sl0, sr0) => val (a, sa) = sta.f0(a0, sl0, sr0) val (b, sb) = stb.f0(b0, sl0, sr0) @@ -1106,7 +1112,8 @@ trait SliceTransforms[M[+_]] case (sta: SliceTransform2S[_], stb) => SliceTransform2M[(A, B)]( - (sta.initial, stb.initial), { + (sta.initial, stb.initial), + { case ((a0, b0), sl0, sr0) => val (a, sa) = sta.f0(a0, sl0, sr0) stb.f(b0, sl0, sr0) map { @@ -1119,7 +1126,8 @@ trait SliceTransforms[M[+_]] case (sta, stb: SliceTransform2S[_]) => SliceTransform2M[(A, B)]( - (sta.initial, stb.initial), { + (sta.initial, stb.initial), + { case ((a0, b0), sl0, sr0) => sta.f(a0, sl0, sr0) map { case (a, sa) => @@ -1132,7 +1140,8 @@ trait SliceTransforms[M[+_]] case (sta, stb) => SliceTransform2[(A, B)]( - (sta.initial, stb.initial), { + (sta.initial, stb.initial), + { case ((a0, b0), sl0, sr0) => for (ares <- sta.f(a0, sl0, sr0); bres <- stb.f(b0, sl0, sr0)) yield { @@ -1158,7 +1167,8 @@ trait SliceTransforms[M[+_]] stb: SliceTransform2S[_], stc: SliceTransform2S[_]) => SliceTransform2S( - (sta.initial, stb.initial, stc.initial), { + (sta.initial, stb.initial, stc.initial), + { case ((a0, b0, c0), sl0, sr0) => val (a, sa) = sta.f0(a0, sl0, sr0) val (b, sb) = stb.f0(b0, sl0, sr0) @@ -1169,7 +1179,8 @@ trait SliceTransforms[M[+_]] case (sta, stb, stc) => SliceTransform2M( - (sta.initial, stb.initial, stc.initial), { + (sta.initial, stb.initial, stc.initial), + { case ((a0, b0, c0), sl0, sr0) => for { resa <- sta.f(a0, sl0, sr0) diff --git a/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/vfs/VFSPathUtils.scala b/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/vfs/VFSPathUtils.scala index 38b42b87293..447527f651f 100644 --- a/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/vfs/VFSPathUtils.scala +++ b/repos/platform/yggdrasil/src/main/scala/com/precog/yggdrasil/vfs/VFSPathUtils.scala @@ -157,7 +157,8 @@ object VFSPathUtils extends Logging { case otherError => IO(\/.left(otherError)) - }, { + }, + { case VersionEntry(uuid, dataType, timestamp) => containsNonemptyChild(Option( pathDir0.listFiles(pathFileFilter)).toList.flatten) map { diff --git a/repos/playframework/documentation/manual/working/scalaGuide/main/ws/code/ScalaOpenIdSpec.scala b/repos/playframework/documentation/manual/working/scalaGuide/main/ws/code/ScalaOpenIdSpec.scala index 06d1004c468..6cad2cbc826 100644 --- a/repos/playframework/documentation/manual/working/scalaGuide/main/ws/code/ScalaOpenIdSpec.scala +++ b/repos/playframework/documentation/manual/working/scalaGuide/main/ws/code/ScalaOpenIdSpec.scala @@ -44,7 +44,8 @@ object ScalaOpenIdSpec extends PlaySpecification { { error => Logger.info(s"bad request ${error.toString}") Future.successful(BadRequest(error.toString)) - }, { openId => + }, + { openId => openIdClient .redirectURL(openId, routes.Application.openIdCallback.absoluteURL()) .map(url => Redirect(url)) diff --git a/repos/playframework/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/CharEncoding.scala b/repos/playframework/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/CharEncoding.scala index be167bbabb1..a31d48c5e5a 100644 --- a/repos/playframework/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/CharEncoding.scala +++ b/repos/playframework/framework/src/iteratees/src/main/scala/play/api/libs/iteratee/CharEncoding.scala @@ -49,7 +49,8 @@ object CharEncoding { Cont(step(initial)(newIt)) case in @ Input.EOF => code(initial, true).fold( - { result => Error(s"coding error: $result", in) }, { + { result => Error(s"coding error: $result", in) }, + { case (string, remaining) => val newIt = Iteratee.flatten( it.feed(Input.El(string)) diff --git a/repos/playframework/framework/src/play-netty-server/src/main/scala/play/core/server/netty/NettyModelConversion.scala b/repos/playframework/framework/src/play-netty-server/src/main/scala/play/core/server/netty/NettyModelConversion.scala index 8453211a16d..b5b8e953a80 100644 --- a/repos/playframework/framework/src/play-netty-server/src/main/scala/play/core/server/netty/NettyModelConversion.scala +++ b/repos/playframework/framework/src/play-netty-server/src/main/scala/play/core/server/netty/NettyModelConversion.scala @@ -314,7 +314,8 @@ private[server] class NettyModelConversion( val httpContentPublisher = SynchronousMappedStreams.map[HttpChunk, HttpContent]( - publisher, { + publisher, + { case HttpChunk.Chunk(bytes) => new DefaultHttpContent(byteStringToByteBuf(bytes)) case HttpChunk.LastChunk(trailers) => diff --git a/repos/playframework/framework/src/play/src/main/scala/play/core/routing/GeneratedRouter.scala b/repos/playframework/framework/src/play/src/main/scala/play/core/routing/GeneratedRouter.scala index ad6dca3604e..a3fb3964ec5 100644 --- a/repos/playframework/framework/src/play/src/main/scala/play/core/routing/GeneratedRouter.scala +++ b/repos/playframework/framework/src/play/src/main/scala/play/core/routing/GeneratedRouter.scala @@ -815,7 +815,8 @@ abstract class GeneratedRouter extends Router { a17, a18)) .fold( - badRequest, { + badRequest, + { case ( a1, a2, @@ -947,7 +948,8 @@ abstract class GeneratedRouter extends Router { a18, a19)) .fold( - badRequest, { + badRequest, + { case ( a1, a2, @@ -1086,7 +1088,8 @@ abstract class GeneratedRouter extends Router { a19, a20)) .fold( - badRequest, { + badRequest, + { case ( a1, a2, @@ -1231,7 +1234,8 @@ abstract class GeneratedRouter extends Router { a20, a21)) .fold( - badRequest, { + badRequest, + { case ( a1, a2, diff --git a/repos/playframework/framework/src/play/src/test/scala/play/api/data/format/FormatSpec.scala b/repos/playframework/framework/src/play/src/test/scala/play/api/data/format/FormatSpec.scala index 5b87a105796..c002881333c 100644 --- a/repos/playframework/framework/src/play/src/test/scala/play/api/data/format/FormatSpec.scala +++ b/repos/playframework/framework/src/play/src/test/scala/play/api/data/format/FormatSpec.scala @@ -33,7 +33,8 @@ object FormatSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(BigDecimal("10.23")) } + }, + { number => number must equalTo(BigDecimal("10.23")) } ) } } @@ -45,7 +46,8 @@ object FormatSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(BigDecimal("10.23")) } + }, + { number => number must equalTo(BigDecimal("10.23")) } ) } @@ -56,7 +58,8 @@ object FormatSpec extends Specification { formWithErrors => { formWithErrors.errors.head.message must equalTo( "error.real.precision") - }, { number => "The mapping should fail." must equalTo("Error") } + }, + { number => "The mapping should fail." must equalTo("Error") } ) } @@ -67,7 +70,8 @@ object FormatSpec extends Specification { formWithErrors => { formWithErrors.errors.head.message must equalTo( "error.real.precision") - }, { number => "The mapping should fail." must equalTo("Error") } + }, + { number => "The mapping should fail." must equalTo("Error") } ) } } @@ -83,7 +87,8 @@ object FormatSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { uuid => uuid must equalTo(testUUID) } + }, + { uuid => uuid must equalTo(testUUID) } ) } @@ -94,7 +99,8 @@ object FormatSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.uuid") - }, { uuid => uuid must equalTo(UUID.randomUUID()) } + }, + { uuid => uuid must equalTo(UUID.randomUUID()) } ) } } @@ -110,7 +116,8 @@ object FormatSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { char => char must equalTo(testChar) } + }, + { char => char must equalTo(testChar) } ) } @@ -121,7 +128,8 @@ object FormatSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.required") - }, { char => char must equalTo('X') } + }, + { char => char must equalTo('X') } ) } } diff --git a/repos/playframework/framework/src/play/src/test/scala/play/api/data/validation/ValidationSpec.scala b/repos/playframework/framework/src/play/src/test/scala/play/api/data/validation/ValidationSpec.scala index d217a95a17c..98bf6cb1ab1 100644 --- a/repos/playframework/framework/src/play/src/test/scala/play/api/data/validation/ValidationSpec.scala +++ b/repos/playframework/framework/src/play/src/test/scala/play/api/data/validation/ValidationSpec.scala @@ -27,7 +27,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.maxLength") - }, { textData => "The mapping should fail." must equalTo("Error") } + }, + { textData => "The mapping should fail." must equalTo("Error") } ) } @@ -45,7 +46,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.minLength") - }, { textData => "The mapping should fail." must equalTo("Error") } + }, + { textData => "The mapping should fail." must equalTo("Error") } ) } } @@ -57,7 +59,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.required") - }, { textData => "The mapping should fail." must equalTo("Error") } + }, + { textData => "The mapping should fail." must equalTo("Error") } ) } } @@ -106,7 +109,8 @@ object ValidationSpec extends Specification { Form("value" -> email) .bind(Map("value" -> addr)) .fold( - formWithErrors => false, { _ => true } + formWithErrors => false, + { _ => true } ) } .exists(_.unary_!) must beFalse @@ -126,7 +130,8 @@ object ValidationSpec extends Specification { Form("value" -> email) .bind(Map("value" -> addr)) .fold( - formWithErrors => true, { _ => false } + formWithErrors => true, + { _ => false } ) } .exists(_.unary_!) must beFalse @@ -140,7 +145,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(5) } + }, + { number => number must equalTo(5) } ) } @@ -150,7 +156,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.max") - }, { number => "The mapping should fail." must equalTo("Error") } + }, + { number => "The mapping should fail." must equalTo("Error") } ) } } @@ -162,7 +169,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(12345678902L) } + }, + { number => number must equalTo(12345678902L) } ) } @@ -172,7 +180,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.min") - }, { number => "The mapping should fail." must equalTo("Error") } + }, + { number => "The mapping should fail." must equalTo("Error") } ) } } @@ -184,7 +193,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { str => str must equalTo("Toto") } + }, + { str => str must equalTo("Toto") } ) } @@ -194,7 +204,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.min") - }, { str => "The mapping should fail." must equalTo("Error") } + }, + { str => "The mapping should fail." must equalTo("Error") } ) } } @@ -206,7 +217,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(10.2) } + }, + { number => number must equalTo(10.2) } ) } @@ -216,7 +228,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.max") - }, { number => "The mapping should fail." must equalTo("Error") } + }, + { number => "The mapping should fail." must equalTo("Error") } ) } } @@ -228,7 +241,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(5) } + }, + { number => number must equalTo(5) } ) } @@ -238,7 +252,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { "The mapping should not fail." must equalTo("Error") - }, { number => number must equalTo(5) } + }, + { number => number must equalTo(5) } ) } @@ -248,7 +263,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.min.strict") - }, { number => "The mapping should fail." must equalTo("Error") } + }, + { number => "The mapping should fail." must equalTo("Error") } ) } @@ -258,7 +274,8 @@ object ValidationSpec extends Specification { .fold( formWithErrors => { formWithErrors.errors.head.message must equalTo("error.required") - }, { text => "The mapping should fail." must equalTo("Error") } + }, + { text => "The mapping should fail." must equalTo("Error") } ) } } diff --git a/repos/playframework/framework/src/sbt-fork-run-plugin/src/main/scala/play/sbt/forkrun/PlayForkRun.scala b/repos/playframework/framework/src/sbt-fork-run-plugin/src/main/scala/play/sbt/forkrun/PlayForkRun.scala index 0c92bc8b552..8161e41d263 100644 --- a/repos/playframework/framework/src/sbt-fork-run-plugin/src/main/scala/play/sbt/forkrun/PlayForkRun.scala +++ b/repos/playframework/framework/src/sbt-fork-run-plugin/src/main/scala/play/sbt/forkrun/PlayForkRun.scala @@ -106,7 +106,8 @@ object PlayForkRun extends AutoPlugin { val args = Def.spaceDelimited().parsed val jobService = BackgroundJobServiceKeys.jobService.value val handle = jobService.runInBackgroundThread( - resolvedScoped.value, { (_, uiContext) => + resolvedScoped.value, + { (_, uiContext) => // use normal task streams log rather than the background run logger PlayForkProcess(playForkOptions.value, args, streams.value.log) } diff --git a/repos/sbt/main/actions/src/main/scala/sbt/CacheIvy.scala b/repos/sbt/main/actions/src/main/scala/sbt/CacheIvy.scala index 393def6df74..e931719aa33 100644 --- a/repos/sbt/main/actions/src/main/scala/sbt/CacheIvy.scala +++ b/repos/sbt/main/actions/src/main/scala/sbt/CacheIvy.scala @@ -89,14 +89,15 @@ object CacheIvy { wrap[ UpdateReport, (File, Seq[ConfigurationReport], UpdateStats, Map[File, Long])]( - rep => - (rep.cachedDescriptor, rep.configurations, rep.stats, rep.stamps), { + rep => (rep.cachedDescriptor, rep.configurations, rep.stats, rep.stamps), + { case (cd, cs, stats, stamps) => new UpdateReport(cd, cs, stats, stamps) }) } implicit def updateStatsFormat: Format[UpdateStats] = wrap[UpdateStats, (Long, Long, Long)]( - us => (us.resolveTime, us.downloadTime, us.downloadSize), { + us => (us.resolveTime, us.downloadTime, us.downloadSize), + { case (rt, dt, ds) => new UpdateStats(rt, dt, ds, true) }) implicit def confReportFormat( @@ -107,7 +108,8 @@ object CacheIvy { wrap[ ConfigurationReport, (String, Seq[ModuleReport], Seq[OrganizationArtifactReport])]( - r => (r.configuration, r.modules, r.details), { + r => (r.configuration, r.modules, r.details), + { case (c, m, d) => new ConfigurationReport(c, m, d) }) implicit def moduleReportFormat( @@ -153,7 +155,8 @@ object CacheIvy { m.branch, m.configurations, m.licenses, - m.callers), { + m.callers), + { case (m, as, ms, s, pd, r, a, e, ed, er, p, h, ea, d, b, cs, ls, ks) => new ModuleReport( m, @@ -207,7 +210,8 @@ object CacheIvy { bf: Format[Boolean], df: Format[Seq[ModuleReport]]): Format[OrganizationArtifactReport] = wrap[OrganizationArtifactReport, (String, String, Seq[ModuleReport])]( - m => (m.organization, m.name, m.modules), { + m => (m.organization, m.name, m.modules), + { case (o, n, r) => OrganizationArtifactReport(o, n, r) }) implicit def callerFormat: Format[Caller] = @@ -229,7 +233,8 @@ object CacheIvy { c.isForceDependency, c.isChangingDependency, c.isTransitiveDependency, - c.isDirectlyForceDependency), { + c.isDirectlyForceDependency), + { case (c, cc, ea, fd, cd, td, df) => new Caller(c, cc, ea, fd, cd, td, df) } @@ -237,7 +242,8 @@ object CacheIvy { implicit def exclusionRuleFormat( implicit sf: Format[String]): Format[InclExclRule] = wrap[InclExclRule, (String, String, String, Seq[String])]( - e => (e.organization, e.name, e.artifact, e.configurations), { + e => (e.organization, e.name, e.artifact, e.configurations), + { case (o, n, a, cs) => InclExclRule(o, n, a, cs) }) implicit def crossVersionFormat: Format[CrossVersion] = @@ -248,7 +254,8 @@ object CacheIvy { case NoPosition => (0, "", 0, 0) case LinePosition(p, s) => (1, p, s, 0) case RangePosition(p, LineRange(s, e)) => (2, p, s, e) - }, { + }, + { case (0, _, _, _) => NoPosition case (1, p, s, _) => LinePosition(p, s) case (2, p, s, e) => RangePosition(p, LineRange(s, e)) @@ -297,7 +304,8 @@ object CacheIvy { m.inclusions, m.exclusions, m.extraAttributes, - m.crossVersion)), { + m.crossVersion)), + { case ((o, n, r, cs, br), (ch, t, f, as, incl, excl, x, cv)) => ModuleID(o, n, r, cs, ch, t, f, as, incl, excl, x, cv, br) } diff --git a/repos/scala-js/project/Build.scala b/repos/scala-js/project/Build.scala index c6b0e109a1e..88ba47dfdbb 100644 --- a/repos/scala-js/project/Build.scala +++ b/repos/scala-js/project/Build.scala @@ -1247,7 +1247,8 @@ object Build extends sbt.Build { var i = 0 val pat = "/\\*{2,3}/".r val replaced = pat.replaceAllIn( - template, { mat => + template, + { mat => val lNo = lineNo(mat.before) val res = if (mat.end - mat.start == 5) diff --git a/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/checker/IRChecker.scala b/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/checker/IRChecker.scala index 4d5c25d4a97..ef2f4d04228 100644 --- a/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/checker/IRChecker.scala +++ b/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/checker/IRChecker.scala @@ -1009,7 +1009,8 @@ private final class IRChecker(unit: LinkingUnit, logger: Logger) { { info => val parents = info.superClass ++: info.interfaces parents.exists(_ == rhs) || parents.exists(isSubclass(_, rhs)) - }, { lhsClass => lhsClass.ancestors.contains(rhs) } + }, + { lhsClass => lhsClass.ancestors.contains(rhs) } ) } diff --git a/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/frontend/optimizer/OptimizerCore.scala b/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/frontend/optimizer/OptimizerCore.scala index 7302dd165f1..13e10bbc5e1 100644 --- a/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/frontend/optimizer/OptimizerCore.scala +++ b/repos/scala-js/tools/shared/src/main/scala/org/scalajs/core/tools/linker/frontend/optimizer/OptimizerCore.scala @@ -3661,7 +3661,8 @@ private[optimizer] abstract class OptimizerCore( def doBuildInner(localDef: LocalDef)(varDef: => VarDef)( cont: PreTransCont): TailRec[Tree] = { buildInner( - localDef, { tinner => + localDef, + { tinner => if (used.value) { cont(PreTransBlock(varDef :: Nil, tinner)) } else { diff --git a/repos/scala/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/repos/scala/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 421bbe6d005..fe0c365db91 100644 --- a/repos/scala/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/repos/scala/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -1954,7 +1954,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { "completing specialized " + symbol.fullName + " calling " + original) debuglog("special overload " + original + " -> " + env) val t = DefDef( - symbol, { vparamss: List[List[Symbol]] => + symbol, + { vparamss: List[List[Symbol]] => val fun = Apply( Select(This(symbol.owner), original), makeArguments(original, vparamss.head)) diff --git a/repos/scala/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala b/repos/scala/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala index 8bda36c1e7b..64e238ec6c0 100644 --- a/repos/scala/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala +++ b/repos/scala/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala @@ -605,7 +605,8 @@ trait MatchAnalysis extends MatchApproximation { cases, approx.onUnknown { tm => approx.fullRewrite.applyOrElse[TreeMaker, Prop]( - tm, { + tm, + { case BodyTreeMaker(_, _) => True // irrelevant -- will be discarded by symbolCase later case _ => // debug.patmat("backing off due to "+ tm) diff --git a/repos/scala/test/files/pos/t6367.scala b/repos/scala/test/files/pos/t6367.scala index 71136c9ec28..2de6aaeadff 100644 --- a/repos/scala/test/files/pos/t6367.scala +++ b/repos/scala/test/files/pos/t6367.scala @@ -66,7 +66,8 @@ class FunctionalBuilder[M[_]](canBuild: FunctionalCanBuild[M]) { fu.fmap[ A1 ~ A2 ~ A3 ~ A4 ~ A5 ~ A6 ~ A7 ~ A8 ~ A9 ~ A10 ~ A11 ~ A12 ~ A13 ~ A14 ~ A15 ~ A16 ~ A17 ~ A18 ~ A19 ~ A20, B]( - canBuild(m1, m2), { + canBuild(m1, m2), + { case a1 ~ a2 ~ a3 ~ a4 ~ a5 ~ a6 ~ a7 ~ a8 ~ a9 ~ a10 ~ a11 ~ a12 ~ a13 ~ a14 ~ a15 ~ a16 ~ a17 ~ a18 ~ a19 ~ a20 => f( a1, diff --git a/repos/scalaz/core/src/main/scala/scalaz/BijectionT.scala b/repos/scalaz/core/src/main/scala/scalaz/BijectionT.scala index e0e3ea36291..f2ca9c38c44 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/BijectionT.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/BijectionT.scala @@ -151,7 +151,8 @@ object BijectionT extends BijectionTInstances { def tuple7B[A, B, C, D, E, H, I] : Bijection[(A, B, C, D, E, H, I), (A, (B, (C, (D, (E, (H, I))))))] = bijection( - { case (a, b, c, d, e, h, i) => (a, (b, (c, (d, (e, (h, i)))))) }, { + { case (a, b, c, d, e, h, i) => (a, (b, (c, (d, (e, (h, i)))))) }, + { case (a, (b, (c, (d, (e, (h, i)))))) => (a, b, c, d, e, h, i) }) diff --git a/repos/scalaz/core/src/main/scala/scalaz/LazyEither.scala b/repos/scalaz/core/src/main/scala/scalaz/LazyEither.scala index 3c48e3bb85a..73d4276b5c1 100644 --- a/repos/scalaz/core/src/main/scala/scalaz/LazyEither.scala +++ b/repos/scalaz/core/src/main/scala/scalaz/LazyEither.scala @@ -197,7 +197,8 @@ sealed abstract class LazyEitherInstances { def cozip[A, B](a: LazyEither[E, A \/ B]) = a.fold( - e => -\/(LazyEither.lazyLeft(e)), { + e => -\/(LazyEither.lazyLeft(e)), + { case -\/(a) => -\/(LazyEither.lazyRight(a)) case \/-(b) => \/-(LazyEither.lazyRight(b)) } diff --git a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Serialization.scala b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Serialization.scala index 1099d1a80c3..14a226348b2 100644 --- a/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Serialization.scala +++ b/repos/scalding/scalding-serialization/src/main/scala/com/twitter/scalding/serialization/Serialization.scala @@ -157,15 +157,15 @@ object Serialization { */ def sizeLaw[T: Serialization]: Law1[T] = Law1( - "staticSize.orElse(dynamicSize(t)).map { _ == toBytes(t).length }", { - (t: T) => - val ser = implicitly[Serialization[T]] - (ser.staticSize, ser.dynamicSize(t)) match { - case (Some(s), Some(d)) if d == s => toBytes(t).length == s - case (Some(s), _) => false // if static exists it must match dynamic - case (None, Some(d)) => toBytes(t).length == d - case (None, None) => true // can't tell - } + "staticSize.orElse(dynamicSize(t)).map { _ == toBytes(t).length }", + { (t: T) => + val ser = implicitly[Serialization[T]] + (ser.staticSize, ser.dynamicSize(t)) match { + case (Some(s), Some(d)) if d == s => toBytes(t).length == s + case (Some(s), _) => false // if static exists it must match dynamic + case (None, Some(d)) => toBytes(t).length == d + case (None, None) => true // can't tell + } } ) diff --git a/repos/scalding/scalding-serialization/src/test/scala/com/twitter/scalding/serialization/JavaStreamEnrichmentsProperties.scala b/repos/scalding/scalding-serialization/src/test/scala/com/twitter/scalding/serialization/JavaStreamEnrichmentsProperties.scala index 47df98441e6..f981989441d 100644 --- a/repos/scalding/scalding-serialization/src/test/scala/com/twitter/scalding/serialization/JavaStreamEnrichmentsProperties.scala +++ b/repos/scalding/scalding-serialization/src/test/scala/com/twitter/scalding/serialization/JavaStreamEnrichmentsProperties.scala @@ -80,7 +80,8 @@ object JavaStreamEnrichmentsProperties // Use list because Array has a shitty toString { (b: List[Byte], os) => os.writePosVarInt(b.size); os.writeBytes(b.toArray) - }, { is => + }, + { is => val bytes = new Array[Byte](is.readPosVarInt) is.readFully(bytes) bytes.toList diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcTypeTest.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcTypeTest.scala index 8d92777c475..eea7145d4b2 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcTypeTest.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/JdbcTypeTest.scala @@ -82,7 +82,8 @@ class JdbcTypeTest extends AsyncTest[JdbcTestDB] { materialize(p1).map(_.toSet shouldBe Set((1, "123"), (2, "45"))) flatMap { _ => val f = materializeAsync[(Int, Blob), (Int, String)]( - db.stream(ts.result.transactionally, bufferNext = false), { + db.stream(ts.result.transactionally, bufferNext = false), + { case (id, data) => db.io((id, data.getBytes(1, data.length.toInt).mkString)) }) @@ -101,7 +102,8 @@ class JdbcTypeTest extends AsyncTest[JdbcTestDB] { out.writeObject(s.value) out.flush new SerialBlob(b.toByteArray) - }, { b => + }, + { b => val in = new ObjectInputStream(b.getBinaryStream) Serialized[T](in.readObject().asInstanceOf[T]) } diff --git a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalMapperTest.scala b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalMapperTest.scala index 3de6dc0304a..0920cf2fa79 100644 --- a/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalMapperTest.scala +++ b/repos/slick/slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/RelationalMapperTest.scala @@ -16,7 +16,8 @@ class RelationalMapperTest extends AsyncTest[RelationalTestDB] { { b => b shouldNotBe null if (b == True) 1 else 0 - }, { i => + }, + { i => i shouldNotBe null if (i == 1) True else False } @@ -61,7 +62,8 @@ class RelationalMapperTest extends AsyncTest[RelationalTestDB] { case EnumValue2 => 'B' case _ => 'C' } - }, { c => + }, + { c => c shouldNotBe null c match { case 'A' => EnumValue1 @@ -116,7 +118,8 @@ class RelationalMapperTest extends AsyncTest[RelationalTestDB] { { b => b shouldNotBe null if (b == True) "y" else "n" - }, { i => + }, + { i => i shouldNotBe null if (i == "y") True else False } diff --git a/repos/slick/slick/src/main/scala/slick/ast/Type.scala b/repos/slick/slick/src/main/scala/slick/ast/Type.scala index afc64b18b77..ffdf01600cb 100644 --- a/repos/slick/slick/src/main/scala/slick/ast/Type.scala +++ b/repos/slick/slick/src/main/scala/slick/ast/Type.scala @@ -351,7 +351,8 @@ class TypeUtil(val tpe: Type) extends AnyVal { def replace(f: PartialFunction[Type, Type]): Type = f.applyOrElse( - tpe, { case t: Type => t.mapChildren(_.replace(f)) }: PartialFunction[ + tpe, + { case t: Type => t.mapChildren(_.replace(f)) }: PartialFunction[ Type, Type]) diff --git a/repos/slick/slick/src/main/scala/slick/compiler/RemoveFieldNames.scala b/repos/slick/slick/src/main/scala/slick/compiler/RemoveFieldNames.scala index 97b0e536dad..1a562aa51e7 100644 --- a/repos/slick/slick/src/main/scala/slick/compiler/RemoveFieldNames.scala +++ b/repos/slick/slick/src/main/scala/slick/compiler/RemoveFieldNames.scala @@ -25,7 +25,8 @@ class RemoveFieldNames(val alwaysKeepSubqueryNames: Boolean = false) .toMap logger.debug("Required symbols: " + requiredSyms.mkString(", ")) val rsm2 = rsm.nodeMapServerSide( - false, { n => + false, + { n => val refTSyms = n .collect[TypeSymbol] { case Select(_ :@ NominalType(s, _), _) => s diff --git a/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala b/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala index ab2c57f281f..f9592277eb1 100644 --- a/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala +++ b/repos/spark/core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala @@ -373,8 +373,8 @@ class JobProgressListener(conf: SparkConf) extends SparkListener with Logging { // completion event is for. Let's just drop it here. This means we might have some speculation // tasks on the web ui that's never marked as complete. if (info != null && taskEnd.stageAttemptId != -1) { - val stageData = stageIdToData.getOrElseUpdate( - (taskEnd.stageId, taskEnd.stageAttemptId), { + val stageData = stageIdToData + .getOrElseUpdate((taskEnd.stageId, taskEnd.stageAttemptId), { logWarning("Task end for unknown stage " + taskEnd.stageId) new StageUIData }) diff --git a/repos/spark/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala b/repos/spark/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala index b0fbad485f3..81f5c0057ad 100644 --- a/repos/spark/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala +++ b/repos/spark/sql/core/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala @@ -103,7 +103,8 @@ object SQLConf { isPublic: Boolean = true): SQLConfEntry[Int] = SQLConfEntry( key, - defaultValue, { v => + defaultValue, + { v => try { v.toInt } catch { @@ -124,7 +125,8 @@ object SQLConf { isPublic: Boolean = true): SQLConfEntry[Long] = SQLConfEntry( key, - defaultValue, { v => + defaultValue, + { v => try { v.toLong } catch { @@ -145,7 +147,8 @@ object SQLConf { isPublic: Boolean = true): SQLConfEntry[Long] = SQLConfEntry( key, - defaultValue, { v => + defaultValue, + { v => try { v.toLong } catch { @@ -171,7 +174,8 @@ object SQLConf { isPublic: Boolean = true): SQLConfEntry[Double] = SQLConfEntry( key, - defaultValue, { v => + defaultValue, + { v => try { v.toDouble } catch { @@ -192,7 +196,8 @@ object SQLConf { isPublic: Boolean = true): SQLConfEntry[Boolean] = SQLConfEntry( key, - defaultValue, { v => + defaultValue, + { v => try { v.toBoolean } catch { diff --git a/repos/spark/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetThriftCompatibilitySuite.scala b/repos/spark/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetThriftCompatibilitySuite.scala index 4783892a126..cbfb7f05a4b 100644 --- a/repos/spark/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetThriftCompatibilitySuite.scala +++ b/repos/spark/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetThriftCompatibilitySuite.scala @@ -104,7 +104,8 @@ class ParquetThriftCompatibilitySuite writeDirect( path, - schema, { rc => + schema, + { rc => rc.message { rc.field("f", 0) { rc.group { @@ -126,7 +127,8 @@ class ParquetThriftCompatibilitySuite } } } - }, { rc => + }, + { rc => rc.message { rc.field("f", 0) { rc.group { diff --git a/repos/spark/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala b/repos/spark/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala index 14bf6db6a88..dca73a38ed5 100644 --- a/repos/spark/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala +++ b/repos/spark/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala @@ -430,7 +430,8 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { .mkString(File.separator) statement.executeQuery(s"ADD JAR $jarFile") - }, { statement => + }, + { statement => val queries = Seq( "DROP TABLE IF EXISTS smallKV", "CREATE TABLE smallKV(key INT, val STRING)", @@ -572,7 +573,8 @@ class SingleSessionSuite extends HiveThriftJdbcTest { |AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2' """.stripMargin ).foreach(statement.execute) - }, { statement => + }, + { statement => val rs1 = statement.executeQuery("SET foo") assert(rs1.next())