[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[cdt-dev] [DSF] Making Sequence more robust
|
- From: Vladimir Prus <vladimir@xxxxxxxxxxxxxxxx>
- Date: Sun, 16 Oct 2011 14:07:16 +0400
- Delivered-to: cdt-dev@eclipse.org
- Organization: CodeSourcery
- User-agent: KMail/1.13.6 (Linux/2.6.38-11-generic-pae; KDE/4.6.5; i686; ; )
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