} else {
Frame caller = stack.peek();
LOGGER.log(Level.FINE, "finishing subroutine from {0} on {1}", new Object[] {caller, thread});
State s = getStateMap().get(caller.state);
assert s instanceof BlockState : "found " + s + " rather than a BlockState on the stack for " + caller.state;
FutureCallback callback = caller.callback;
assert callback != null : "no callback defined for " + caller.state;
caller.callback = null;
callback.onSuccess(null); // TODO should there be a way of passing a return value from the block?
heads.put(thread, caller.id);
try {
addingHead(new BlockEndNode<BlockStartNode>(this, newID(), /*TODO*/null, /* TODO is this right? or should it be from caller.id? */prior) {
@Override protected String getTypeDisplayName() {
return "Block end";