Skip to content

Commit 56d7c92

Browse files
committed
Consolidate import of Random
1 parent f6014c0 commit 56d7c92

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.apache.spark.util
1919

2020
import java.io.NotSerializableException
21+
import java.util.Random
2122

2223
import org.scalatest.FunSuite
2324

@@ -266,19 +267,15 @@ private object TestUserClosuresActuallyCleaned {
266267
rdd.mapPartitionsWithIndex { (_, it) => return; it }.count()
267268
}
268269
def testFlatMapWith(rdd: RDD[Int]): Unit = {
269-
import java.util.Random
270270
rdd.flatMapWith ((index: Int) => new Random(index + 42)){ (_, it) => return; Seq() }.count()
271271
}
272272
def testMapWith(rdd: RDD[Int]): Unit = {
273-
import java.util.Random
274273
rdd.mapWith ((index: Int) => new Random(index + 42)){ (_, it) => return; 0 }.count()
275274
}
276275
def testFilterWith(rdd: RDD[Int]): Unit = {
277-
import java.util.Random
278276
rdd.filterWith ((index: Int) => new Random(index + 42)){ (_, it) => return; true }.count()
279277
}
280278
def testForEachWith(rdd: RDD[Int]): Unit = {
281-
import java.util.Random
282279
rdd.foreachWith ((index: Int) => new Random(index + 42)){ (_, it) => return }
283280
}
284281
def testMapPartitionsWithContext(rdd: RDD[Int]): Unit = {

0 commit comments

Comments
 (0)