Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/22246#discussion_r213164929 --- Diff: repl/src/main/scala/org/apache/spark/repl/SparkILoop.scala --- @@ -124,6 +141,26 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter) super.replay() } + /** + * TODO: Remove `runClosure` when the support of Scala 2.11 is ended + * In Scala 2.12, we don't need to use `savingContextLoader` to execute the `body`. + * See `SI-8521 No blind save of context class loader` for detail. + */ + private def runClosure(body: () => Boolean): Boolean = { + if (isScala2_11) { + val loader = Utils.classForName("scala.reflect.internal.util.ScalaClassLoader$") + .getDeclaredField("MODULE$") + .get(null) --- End diff -- Although it is a static method in Scala, it will be compiled to a non-static method in Java class. This class has a static member of the same type. The access of all static methods are through the static member.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org