diff options
author | Yin Huai <yhuai@databricks.com> | 2015-06-29 16:26:05 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-06-29 16:26:05 -0700 |
commit | 4b497a724a87ef24702c2df9ec6863ee57a87c1c (patch) | |
tree | 0297f9d6c49b8440d25f0b79d309cd519e57924a /sql/catalyst | |
parent | 4e880cf5967c0933e1d098a1d1f7db34b23ca8f8 (diff) | |
download | spark-4b497a724a87ef24702c2df9ec6863ee57a87c1c.tar.gz spark-4b497a724a87ef24702c2df9ec6863ee57a87c1c.tar.bz2 spark-4b497a724a87ef24702c2df9ec6863ee57a87c1c.zip |
[SPARK-8710] [SQL] Change ScalaReflection.mirror from a val to a def.
jira: https://issues.apache.org/jira/browse/SPARK-8710
Author: Yin Huai <yhuai@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.
Diffstat (limited to 'sql/catalyst')
-rw-r--r-- | sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala | 8 |
1 files changed, 6 insertions, 2 deletions
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 90698cd572..21b1de1ab9 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._ |