You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by ch...@apache.org on 2016/10/07 17:19:29 UTC
[1/2] incubator-toree git commit: use iMain.eval instead of
iMain.valueOfTerm
Repository: incubator-toree
Updated Branches:
refs/heads/master a0f75a1c0 -> e8ecd0623
use iMain.eval instead of iMain.valueOfTerm
Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/52d2ea2d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/52d2ea2d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/52d2ea2d
Branch: refs/heads/master
Commit: 52d2ea2d69881327bd5c85b05d7a482b324f3769
Parents: a0f75a1
Author: Brian Burns <br...@gmail.com>
Authored: Thu Oct 6 09:06:20 2016 -0400
Committer: Brian Burns <br...@gmail.com>
Committed: Thu Oct 6 09:06:20 2016 -0400
----------------------------------------------------------------------
.../interpreter/scala/ScalaInterpreterSpecific.scala | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/52d2ea2d/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
----------------------------------------------------------------------
diff --git a/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala b/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
index 62f70a1..bd654e8 100644
--- a/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
+++ b/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
@@ -258,12 +258,11 @@ trait ScalaInterpreterSpecific extends SettingsProducerLike { this: ScalaInterpr
*/
override def read(variableName: String): Option[AnyRef] = {
require(iMain != null)
- val variable = iMain.valueOfTerm(variableName)
- if (variable == null || variable.isEmpty) None
- else variable match {
- case Some(v: AnyRef) => Some(v)
- case Some(_) => None // Don't support AnyVal yet
- case None => None
+
+ iMain.eval(variableName) match {
+ case null => None
+ case str: String if str.isEmpty => None
+ case res => Some(res)
}
}
[2/2] incubator-toree git commit: fix ScalaInterpterSpecific test
Posted by ch...@apache.org.
fix ScalaInterpterSpecific test
Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/e8ecd062
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/e8ecd062
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/e8ecd062
Branch: refs/heads/master
Commit: e8ecd0623c65ad104045b1797fb27f69b8dfc23f
Parents: 52d2ea2
Author: Brian Burns <br...@gmail.com>
Authored: Thu Oct 6 13:44:57 2016 -0400
Committer: Brian Burns <br...@gmail.com>
Committed: Thu Oct 6 13:44:57 2016 -0400
----------------------------------------------------------------------
.../src/test/scala-2.11/scala/ScalaInterpreterSpec.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/e8ecd062/scala-interpreter/src/test/scala-2.11/scala/ScalaInterpreterSpec.scala
----------------------------------------------------------------------
diff --git a/scala-interpreter/src/test/scala-2.11/scala/ScalaInterpreterSpec.scala b/scala-interpreter/src/test/scala-2.11/scala/ScalaInterpreterSpec.scala
index f2b8271..93e7874 100644
--- a/scala-interpreter/src/test/scala-2.11/scala/ScalaInterpreterSpec.scala
+++ b/scala-interpreter/src/test/scala-2.11/scala/ScalaInterpreterSpec.scala
@@ -341,11 +341,11 @@ class ScalaInterpreterSpec extends FunSpec
}
}
- it("should execute the underlying valueOfTerm method") {
+ it("should execute the underlying eval method") {
interpreter.start()
interpreter.read("someVariable")
- verify(mockSparkIMain).valueOfTerm(anyString())
+ verify(mockSparkIMain).eval(anyString())
}
}