Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

better error message for null setting values

  • Loading branch information...
commit 607824cc22b9d1d780cc9e2639e3bbf2d9f4e00f 1 parent 37661c9
Mark Harrah authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 util/collection/INode.scala
6 util/collection/INode.scala
View
@@ -88,7 +88,10 @@ abstract class EvaluateSettings[Scope]
private[this] val calledBy = new collection.mutable.ListBuffer[BindNode[_, T]]
override def toString = getClass.getName + " (state=" + state + ",blockedOn=" + blockedOn + ",calledBy=" + calledBy.size + ",blocking=" + blocking.size + "): " +
- ( (static.toSeq.flatMap { case (key, value) => if(value eq this) key.toString :: Nil else Nil }).headOption getOrElse "non-static")
+ keyString
+
+ private[this] def keyString =
+ (static.toSeq.flatMap { case (key, value) => if(value eq this) init.showFullKey(key) :: Nil else Nil }).headOption getOrElse "non-static"
final def get: T = synchronized {
assert(value != null, toString + " not evaluated")
@@ -134,6 +137,7 @@ abstract class EvaluateSettings[Scope]
}
protected final def setValue(v: T) {
assert(state != Evaluated, "Already evaluated (trying to set value to " + v + "): " + toString)
+ if(v == null) error("Setting value cannot be null: " + keyString)
value = v
state = Evaluated
blocking foreach { _.unblocked() }
Please sign in to comment.
Something went wrong with that request. Please try again.