Skip to content

Commit

Permalink
[SPARK-26137][CORE] Use Java system property "file.separator" instead…
Browse files Browse the repository at this point in the history
… of hard coded "/" in DependencyUtils
  • Loading branch information
Mark Pavey committed Nov 22, 2018
1 parent ab61ddb commit 49ce5a8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package org.apache.spark.deploy

import java.io.File
import java.net.URI
import java.util.regex.Pattern

import org.apache.commons.lang3.StringUtils
import org.apache.hadoop.conf.Configuration
Expand Down Expand Up @@ -61,11 +62,12 @@ private[deploy] object DependencyUtils extends Logging {
hadoopConf: Configuration,
secMgr: SecurityManager): String = {
val targetDir = Utils.createTempDir()
val fileSeparator = Pattern.quote(System.getProperty("file.separator"))
Option(jars)
.map {
resolveGlobPaths(_, hadoopConf)
.split(",")
.filterNot(_.contains(userJar.split("/").last))
.filterNot(_.contains(userJar.split(fileSeparator).last))
.mkString(",")
}
.filterNot(_ == "")
Expand Down

0 comments on commit 49ce5a8

Please sign in to comment.