Skip to content

Commit 23bcd6c

Browse files
committed
[SPARK-26043][HOTFIX] Hotfix a change to SparkHadoopUtil that doesn't work in 2.11
## What changes were proposed in this pull request? Hotfix a change to SparkHadoopUtil that doesn't work in 2.11 ## How was this patch tested? Existing tests. Closes apache#23097 from srowen/SPARK-26043.2. Authored-by: Sean Owen <[email protected]> Signed-off-by: Sean Owen <[email protected]>
1 parent 42c4838 commit 23bcd6c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkHadoopUtil.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package org.apache.spark.deploy
2020
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, DataInputStream, DataOutputStream, File, IOException}
2121
import java.security.PrivilegedExceptionAction
2222
import java.text.DateFormat
23-
import java.util.{Arrays, Date, Locale}
23+
import java.util.{Arrays, Comparator, Date, Locale}
2424

2525
import scala.collection.JavaConverters._
2626
import scala.collection.immutable.Map
@@ -269,10 +269,11 @@ private[spark] class SparkHadoopUtil extends Logging {
269269
name.startsWith(prefix) && !name.endsWith(exclusionSuffix)
270270
}
271271
})
272-
Arrays.sort(fileStatuses,
273-
(o1: FileStatus, o2: FileStatus) => {
272+
Arrays.sort(fileStatuses, new Comparator[FileStatus] {
273+
override def compare(o1: FileStatus, o2: FileStatus): Int = {
274274
Longs.compare(o1.getModificationTime, o2.getModificationTime)
275-
})
275+
}
276+
})
276277
fileStatuses
277278
} catch {
278279
case NonFatal(e) =>

0 commit comments

Comments
 (0)