From: adam Date: Mon, 26 Mar 2007 05:43:10 +0000 (-0400) Subject: throw error when Forest created with head() X-Git-Tag: tag_for_25-Mar~17 X-Git-Url: http://git.megacz.com/?p=sbp.git;a=commitdiff_plain;h=0ddfec9ac2783f59115205dc0f3806137265c59c throw error when Forest created with head() darcs-hash:20070326054310-5007d-9ce12658982503cec80723b8b849f38103526abd.gz --- 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