Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] [DSF] Making Sequence more robust

Hi,

presently, if any step of a Sequence fails to call 'done' or 'cancel',
the whole Sequence just hangs, and it's rather painful to debug.
Can we do something to improve this long-standing problem? For example:

    abstract public static class Step {

        ....

        public final void execute(RequestMonitor rm) { // note: final.
			xexecute(rm);
			if (!rm.isDone()) // isDone would have to be added
			{
				rm.setStatus(new Status(IStatus.ERROR, ..., "Misbehaving step", ....));
	            rm.done();
			}
        }

		abstract protected void xececute(RequestMonitor rm);
    }

Or, we can take take this even further:

    abstract public static class Step {

        ....

        public final void execute(RequestMonitor rm) { // note: final.
			rm.setStatis(xexecute(rm))
			rm.done();
        }

		abstract protected IStatus xececute(RequestMonitor rm);
    }

In this case, the compiler will object if a step fails to return a value,
although there's a risk that a step might fail to handle failure of any
operation it does and still return IStatus.OK anyway.

Comments?

-- 
Vladimir Prus
CodeSourcery / Mentor Graphics
+7 (812) 677-68-40


Back to the top