From 0ddfec9ac2783f59115205dc0f3806137265c59c Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 26 Mar 2007 01:43:10 -0400 Subject: [PATCH] throw error when Forest created with head() darcs-hash:20070326054310-5007d-9ce12658982503cec80723b8b849f38103526abd.gz --- src/edu/berkeley/sbp/Forest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/edu/berkeley/sbp/Forest.java b/src/edu/berkeley/sbp/Forest.java index b2f4a22..1730f60 100644 --- a/src/edu/berkeley/sbp/Forest.java +++ b/src/edu/berkeley/sbp/Forest.java @@ -23,7 +23,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { public void expand(HashSet> ht) { expand(ht, new HashSet>(), null); } static Forest create(Input.Region loc, NodeType head, Forest[] children, boolean lift) { - if (loc == null) throw new Error(); + if (loc == null) throw new RuntimeException("invoked Forest.create(null,,,,) -- this should never happen"); return new One(loc, head, children, lift); } @@ -57,6 +57,7 @@ public abstract class Forest implements GraphViz.ToGraphViz { private One(Input.Region loc, NodeType head, Forest[] children, boolean lift) { this.location = loc; this.head = head; + if (head==null) throw new RuntimeException("invoked Forest.create(,null,,,) -- this should never happen"); this.children = children==null ? emptyForestArray : new Forest[children.length]; if (children != null) System.arraycopy(children, 0, this.children, 0, children.length); if (children != null) for(int i=0; i