From 8af81e7cf4451b3743b9491585944c6593f1c798 Mon Sep 17 00:00:00 2001 From: CodingCat Date: Wed, 26 Feb 2014 20:06:20 -0500 Subject: [PATCH] impose non-null settings --- .../scala/org/apache/spark/repl/SparkILoop.scala | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala b/repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala index 0addecb3d970f..f52ebe4a159f1 100644 --- a/repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala +++ b/repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala @@ -182,16 +182,15 @@ class SparkILoop(in0: Option[BufferedReader], protected val out: JPrintWriter, /** Create a new interpreter. */ def createInterpreter() { - if (settings != null) { - if (addedClasspath != "") settings.classpath.append(addedClasspath) + require(settings != null) - // work around for Scala bug - val totalClassPath = SparkILoop.getAddedJars.foldLeft( - settings.classpath.value)((l, r) => ClassPath.join(l, r)) - this.settings.classpath.value = totalClassPath + if (addedClasspath != "") settings.classpath.append(addedClasspath) + // work around for Scala bug + val totalClassPath = SparkILoop.getAddedJars.foldLeft( + settings.classpath.value)((l, r) => ClassPath.join(l, r)) + this.settings.classpath.value = totalClassPath - intp = new SparkILoopInterpreter - } + intp = new SparkILoopInterpreter } /** print a friendly help message */