Repository: spark Updated Branches: refs/heads/branch-1.3 921121d57 -> 779e28b6d
[SPARK-5640] Synchronize ScalaReflection where necessary Author: Tobias Schlatter <tob...@meisch.ch> Closes #4431 from gzm0/sync-scala-refl and squashes the following commits: c5da21e [Tobias Schlatter] [SPARK-5640] Synchronize ScalaReflection where necessary (cherry picked from commit 500dc2b4b3136029457e708859fe27da93b1f9e8) Signed-off-by: Michael Armbrust <mich...@databricks.com> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/779e28b6 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/779e28b6 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/779e28b6 Branch: refs/heads/branch-1.3 Commit: 779e28b6db9f62376a4f2020a6776084ba293b95 Parents: 921121d Author: Tobias Schlatter <tob...@meisch.ch> Authored: Fri Feb 6 12:15:02 2015 -0800 Committer: Michael Armbrust <mich...@databricks.com> Committed: Fri Feb 6 12:15:12 2015 -0800 ---------------------------------------------------------------------- .../scala/org/apache/spark/sql/catalyst/ScalaReflection.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/779e28b6/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 0445f3a..5d9c331 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 @@ -103,10 +103,11 @@ trait ScalaReflection { } /** Returns a catalyst DataType and its nullability for the given Scala Type using reflection. */ - def schemaFor[T: TypeTag]: Schema = schemaFor(typeOf[T]) + def schemaFor[T: TypeTag]: Schema = + ScalaReflectionLock.synchronized { schemaFor(typeOf[T]) } /** Returns a catalyst DataType and its nullability for the given Scala Type using reflection. */ - def schemaFor(tpe: `Type`): Schema = { + def schemaFor(tpe: `Type`): Schema = ScalaReflectionLock.synchronized { val className: String = tpe.erasure.typeSymbol.asClass.fullName tpe match { case t if Utils.classIsLoadable(className) && --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org