From d96b6af8149ac5be2cbf57a0a9e41176221f0e03 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 3 Nov 2008 11:08:00 +0100 Subject: [PATCH] add error check to Context.makeNext() --- src/edu/berkeley/fleet/ir/Context.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/edu/berkeley/fleet/ir/Context.java b/src/edu/berkeley/fleet/ir/Context.java index 844851c..436b49a 100644 --- a/src/edu/berkeley/fleet/ir/Context.java +++ b/src/edu/berkeley/fleet/ir/Context.java @@ -97,6 +97,11 @@ public class Context { } } + public LoopFactory makeNext(int new_count) { return makeNext(new_count, null); } + public LoopFactory makeNext(int new_count, String newFriendlyName) { + if (next != null) throw new RuntimeException("loop already has a successor"); + return new LoopFactory(dock, new_count, newFriendlyName, this); + } public LoopFactory getNext() { return next; } private void setNext(LoopFactory next) { if (this.next != null) throw new RuntimeException("attempt to setNext() twice"); -- 1.7.10.4