Skip to content

Commit 559b16b

Browse files
committed
Stylistic cleanups from review
1 parent de13b79 commit 559b16b

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import scala.collection.mutable.Set
2525
import com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.{ClassReader, ClassVisitor, MethodVisitor, Type}
2626
import com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.Opcodes._
2727

28-
import org.apache.spark.Logging
29-
import org.apache.spark.SparkException
28+
import org.apache.spark.{Logging, SparkException}
3029

3130
private[spark] object ClosureCleaner extends Logging {
3231
// Get an ASM class reader for a given class from the JAR that loaded it

core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ package org.apache.spark.util
2020
import org.scalatest.FunSuite
2121

2222
import org.apache.spark.LocalSparkContext._
23-
import org.apache.spark.SparkContext
24-
import org.apache.spark.SparkException
23+
import org.apache.spark.{SparkContext, SparkException}
2524

2625
class ClosureCleanerSuite extends FunSuite {
2726
test("closures inside an object") {
@@ -118,15 +117,11 @@ class TestClassWithoutFieldAccess {
118117
}
119118

120119
object TestObjectWithBogusReturns {
121-
def badClosureWithReturn(v: org.apache.spark.rdd.RDD[Int]): Int = {
122-
v.map {x => return 1 ; x * 2}
123-
1
124-
}
125-
126120
def run(): Int = {
127121
withSpark(new SparkContext("local", "test")) { sc =>
128122
val nums = sc.parallelize(Array(1, 2, 3, 4))
129-
badClosureWithReturn(nums)
123+
nums.map {x => return 1 ; x * 2}
124+
1
130125
}
131126
}
132127
}

0 commit comments

Comments
 (0)