You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by dbtsai <gi...@git.apache.org> on 2018/08/27 20:37:48 UTC
[GitHub] spark pull request #22246: [WIP] [SPARK-25235] [SHELL] Merge the REPL code i...
Github user dbtsai commented on a diff in the pull request:
https://github.com/apache/spark/pull/22246#discussion_r213107072
--- Diff: repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala ---
@@ -148,9 +148,13 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
*/
private def runClosure(body: () => Boolean): Boolean = {
if (isScala2_11) {
+ val loader = Utils.classForName("scala.reflect.internal.util.ScalaClassLoader$")
+ .getDeclaredField("MODULE$")
+ .get(null)
+
Utils.classForName("scala.reflect.internal.util.ScalaClassLoader$")
.getDeclaredMethod("savingContextLoader", classOf[() => Boolean])
- .invoke(null, body)
+ .invoke(loader, body)
--- End diff --
@viirya Out of my curiosity, since it's a static method, in theory, in the `invoke`, the first arg should be `null`. Why do you put the loader in?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org