You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/06/25 04:39:27 UTC

git commit: Fix possible null pointer in acumulator toString

Repository: spark
Updated Branches:
  refs/heads/master 54055fb2b -> 2714968e1


Fix possible null pointer in acumulator toString

Author: Michael Armbrust <mi...@databricks.com>

Closes #1204 from marmbrus/nullPointerToString and squashes the following commits:

35b5fce [Michael Armbrust] Fix possible null pointer in acumulator toString


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

Branch: refs/heads/master
Commit: 2714968e1b40221739c5dfba7ca4c0c06953dbe2
Parents: 54055fb
Author: Michael Armbrust <mi...@databricks.com>
Authored: Tue Jun 24 19:39:19 2014 -0700
Committer: Reynold Xin <rx...@apache.org>
Committed: Tue Jun 24 19:39:19 2014 -0700

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/Accumulators.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2714968e/core/src/main/scala/org/apache/spark/Accumulators.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/Accumulators.scala b/core/src/main/scala/org/apache/spark/Accumulators.scala
index cdfd338..9c55bfb 100644
--- a/core/src/main/scala/org/apache/spark/Accumulators.scala
+++ b/core/src/main/scala/org/apache/spark/Accumulators.scala
@@ -127,7 +127,7 @@ class Accumulable[R, T] (
     Accumulators.register(this, false)
   }
 
-  override def toString = value_.toString
+  override def toString = if (value_ == null) "null" else value_.toString
 }
 
 /**