X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fsbp%2FForest.java;h=1730f607eba82daeb513f88053b53d08137a33e2;hb=b910ad546f02d07664d32a70ce9acf6f049a64b1;hp=b2f4a2239f3b641e52ec7031ec466deed810e267;hpb=e84029a8b861075d6d0ed5040f919b2e4da4c98f;p=sbp.git 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