Skip to content

Commit 4505bc2

Browse files
srowenpwendell
authored andcommitted
SPARK-1629. Addendum: Depend on commons lang3 (already used by tachyon) as it's used in ReplSuite, and return to use lang3 utility in Utils.scala
For consideration. This was proposed in related discussion: #569 Author: Sean Owen <[email protected]> Closes #635 from srowen/SPARK-1629.2 and squashes the following commits: a442b98 [Sean Owen] Depend on commons lang3 (already used by tachyon) as it's used in ReplSuite, and return to use lang3 utility in Utils.scala (cherry picked from commit f504157) Signed-off-by: Patrick Wendell <[email protected]>
1 parent 2f091d5 commit 4505bc2

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

core/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
<groupId>com.google.guava</groupId>
7070
<artifactId>guava</artifactId>
7171
</dependency>
72+
<dependency>
73+
<groupId>org.apache.commons</groupId>
74+
<artifactId>commons-lang3</artifactId>
75+
</dependency>
7276
<dependency>
7377
<groupId>com.google.code.findbugs</groupId>
7478
<artifactId>jsr305</artifactId>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import scala.util.Try
3232

3333
import com.google.common.io.Files
3434
import com.google.common.util.concurrent.ThreadFactoryBuilder
35+
import org.apache.commons.lang3.SystemUtils
3536
import org.apache.hadoop.fs.{FileSystem, FileUtil, Path}
3637
import org.json4s._
3738
import tachyon.client.{TachyonFile,TachyonFS}
@@ -1073,9 +1074,7 @@ private[spark] object Utils extends Logging {
10731074
/**
10741075
* Return true if this is Windows.
10751076
*/
1076-
def isWindows = {
1077-
Option(System.getProperty("os.name")).exists(_.startsWith("Windows"))
1078-
}
1077+
def isWindows = SystemUtils.IS_OS_WINDOWS
10791078

10801079
/**
10811080
* Indicates whether Spark is currently running unit tests.

pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@
221221
<artifactId>guava</artifactId>
222222
<version>14.0.1</version>
223223
</dependency>
224+
<dependency>
225+
<groupId>org.apache.commons</groupId>
226+
<artifactId>commons-lang3</artifactId>
227+
<version>3.3.2</version>
228+
</dependency>
224229
<dependency>
225230
<groupId>com.google.code.findbugs</groupId>
226231
<artifactId>jsr305</artifactId>

project/SparkBuild.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ object SparkBuild extends Build {
326326
name := "spark-core",
327327
libraryDependencies ++= Seq(
328328
"com.google.guava" % "guava" % "14.0.1",
329+
"org.apache.commons" % "commons-lang3" % "3.3.2",
329330
"com.google.code.findbugs" % "jsr305" % "1.3.9",
330331
"log4j" % "log4j" % "1.2.17",
331332
"org.slf4j" % "slf4j-api" % slf4jVersion,

0 commit comments

Comments
 (0)