From 27209252f09ff73c58e60c6df8aaba73b308088c Mon Sep 17 00:00:00 2001 From: Xin Ren Date: Tue, 30 Aug 2016 11:24:55 +0100 Subject: [MINOR][MLLIB][SQL] Clean up unused variables and unused import ## What changes were proposed in this pull request? Clean up unused variables and unused import statements, unnecessary `return` and `toArray`, and some more style improvement, when I walk through the code examples. ## How was this patch tested? Testet manually on local laptop. Author: Xin Ren Closes #14836 from keypointt/codeWalkThroughML. --- core/src/test/scala/org/apache/spark/AccumulatorSuite.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala b/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala index 6cbd5ae5d4..6d03ee091e 100644 --- a/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala +++ b/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala @@ -100,7 +100,9 @@ class AccumulatorSuite extends SparkFunSuite with Matchers with LocalSparkContex val acc: Accumulator[Int] = sc.accumulator(0) val d = sc.parallelize(1 to 20) - an [Exception] should be thrownBy {d.foreach{x => acc.value = x}} + intercept[SparkException] { + d.foreach(x => acc.value = x) + } } test ("add value to collection accumulators") { @@ -171,7 +173,7 @@ class AccumulatorSuite extends SparkFunSuite with Matchers with LocalSparkContex d.foreach { x => acc.localValue ++= x } - acc.value should be ( (0 to maxI).toSet) + acc.value should be ((0 to maxI).toSet) resetSparkContext() } } -- cgit v1.2.3