Bug 233043 - Command handling doesn't recover from RuntimeExceptions
Summary: Command handling doesn't recover from RuntimeExceptions
Status: NEW
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 major
Target Milestone: ---   Edit
Assignee: Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-20 15:18 EDT by Min Idzelis CLA
Modified: 2010-07-19 21:55 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Min Idzelis CLA 2008-05-20 15:18:31 EDT
Build ID: GMF 2.1

Steps To Reproduce:
When a GMF Command (or EMF Operation) has a fault, it can through ExecutionException OR return a Status with Severity ERROR. In both cases, the active command (or composite command) will halt processing and any active transaction will be rolled back. This leaves all the EMF models and everything in a nice and consistent. 

However, anybody can through a RuntimeException or subclass (Like NullPointerException/SWTException/etc) which is not CAUGHT by any of the exception processing code in the GMF Commands (or EMF Operations.) 

This will cause sever consistency problems. Commands that were thought to be completed will not be and commands later in the command-chain may not find what they were expecting causing secondary exceptions. 

Please handle RuntimeException the same way that you handle the ExecutionException everywhere a command is executed. 

The ICommandProxy's should also propagate the exeptions... wrap the caught ExecutionException with a RuntimeException and throw it. 

More information:
Comment 1 Anthony Hunter CLA 2008-05-20 16:30:20 EDT
Do you have a particular exception that is blocking you?

Something like "If you throw SWTException in line XX of XXX, you see the issue".
Comment 2 Min Idzelis CLA 2008-05-21 09:02:05 EDT
The issue is that my Diagram Editor's command stack can run Commands on a non-UI thread. One of those commands modifies a EMF model (faces config's EMF model). If their editor is open, they are listening to EMF changes to that model and try to update some SWT controls. This produces a SWT Exception that corrupts the GMF commands from that point on. A bug has also been logged against the WTP faces config editor. Regardless, other runtime exceptions can also cause similar corruption. 
Comment 3 Gary Johnston CLA 2008-06-04 09:38:37 EDT
Any new news on this one?
Comment 4 Anthony Hunter CLA 2008-06-04 10:17:37 EDT
Well I tried throwing SWTException and RuntimeExceptions in our example code and I would still create elements after the the first exception. So the stack was not broken for our examples.

Is there a way you can give us a simple use case with your WTP code?

I.e. load WTP plugin X into your workspace, thrown an SWTException in line XX of XXX, run and create a XX diagram and create an XX. The diagram is now broken.

Otherwise there is not much to go on with this defect right now.
Comment 5 Eclipse Webmaster CLA 2010-07-19 21:55:08 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Common was the original product and component for this bug