Repository: spark
Updated Branches:
  refs/heads/branch-1.4 0c3f7fc88 -> 6a45d86db


[SPARK-8710] [SQL] Change ScalaReflection.mirror from a val to a def.

jira: https://issues.apache.org/jira/browse/SPARK-8710

Author: Yin Huai <yh...@databricks.com>

Closes #7094 from yhuai/SPARK-8710 and squashes the following commits:

c854baa [Yin Huai] Change ScalaReflection.mirror from a val to a def.

(cherry picked from commit 4b497a724a87ef24702c2df9ec6863ee57a87c1c)
Signed-off-by: Reynold Xin <r...@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6a45d86d
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6a45d86d
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6a45d86d

Branch: refs/heads/branch-1.4
Commit: 6a45d86dbdefe8d8c50342953f30a28502cb2c3f
Parents: 0c3f7fc
Author: Yin Huai <yh...@databricks.com>
Authored: Mon Jun 29 16:26:05 2015 -0700
Committer: Reynold Xin <r...@databricks.com>
Committed: Mon Jun 29 16:26:13 2015 -0700

----------------------------------------------------------------------
 .../org/apache/spark/sql/catalyst/ScalaReflection.scala      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6a45d86d/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
index 6998cc8..dca5ffb 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
@@ -27,7 +27,11 @@ import org.apache.spark.sql.types._
  */
 object ScalaReflection extends ScalaReflection {
   val universe: scala.reflect.runtime.universe.type = 
scala.reflect.runtime.universe
-  val mirror: universe.Mirror = 
universe.runtimeMirror(Thread.currentThread().getContextClassLoader)
+  // Since we are creating a runtime mirror usign the class loader of current 
thread,
+  // we need to use def at here. So, every time we call mirror, it is using the
+  // class loader of the current thread.
+  override def mirror: universe.Mirror =
+    universe.runtimeMirror(Thread.currentThread().getContextClassLoader)
 }
 
 /**
@@ -38,7 +42,7 @@ trait ScalaReflection {
   val universe: scala.reflect.api.Universe
 
   /** The mirror used to access types in the universe */
-  val mirror: universe.Mirror
+  def mirror: universe.Mirror
 
   import universe._
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to