Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331795

Summary: Error reporting/handling should be protected from runtime exceptions to prevent workbench shutdown
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: blocker    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
PartRenderingEngine patch v1
none
Patch that also safes up setting focus as well as widget disposal none

Description Remy Suen CLA 2010-12-03 13:15:38 EST
At the moment, we ask the StatusReporter to notify the user of exceptions or the logger to log them when the rendering engine is up.

However, if an exception occurs during said action (notification/logging), then the entire event loop is killed. We need to protect the code block in order to prevent problematic code from bringing down the workbench (see bug 331784).
Comment 1 Remy Suen CLA 2010-12-03 13:18:54 EST
Created attachment 184493 [details]
PartRenderingEngine patch v1

Eric, please take a look.
Comment 2 Remy Suen CLA 2010-12-03 14:04:59 EST
Patch released to CVS HEAD.
Comment 3 Eric Moffatt CLA 2010-12-03 15:25:38 EST
Created attachment 184507 [details]
Patch that also safes up setting focus as well as widget disposal


We have to trap exceptions that occur on the widget disposal in SWTPartRenderer#disposeWidget. Without this we don't proceed with the 'uninject' of the contribution or the disposal of its context.

While not as serious this also traps and reports and error if an attempt to set the focus to a CompatibilityPart throws an exception.
Comment 4 Remy Suen CLA 2010-12-06 08:20:16 EST
I added a test to PartRenderingEngineTests to check that a bad DisposeListener won't prevent the @PreDestroy from being called.