Repository: spark
Updated Branches:
  refs/heads/master 4e880cf59 -> 4b497a724


[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.


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

Branch: refs/heads/master
Commit: 4b497a724a87ef24702c2df9ec6863ee57a87c1c
Parents: 4e880cf
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:05 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/4b497a72/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 90698cd..21b1de1 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
@@ -28,7 +28,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)
 }
 
 /**
@@ -39,7 +43,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