Bug 115700

Summary: DemuxingMListener notifies clients that resource is loaded even when the load actually failed
Product: [Modeling] GMF-Runtime Reporter: Dusko <dmisic>
Component: GeneralAssignee: Chris McGee <cbmcgee>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 Keywords: contributed
Version: 1.0   
Target Milestone: 1.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for the gmf.runtime.emf.core plugin.
none
Patch for the tests.gmf.runtime.emf.core plugin.
none
Final Patch none

Description Dusko CLA 2005-11-09 16:01:42 EST
The actual culprits are ResourceUtil.load(...) and 
MSLEditingDomain.loadResource(...) methods. They attempt to load resource and 
if the load method throws an exception, they unload it. On the other hand, the 
algorithm that determined if the resource is loaded has changed from checking 
if a root object has been added to checking a flag, changing the timing.

Methods ResourceUtil.load(...) and MSLEditingDomain.loadResource(...) are 
atomic operations: when they return the resource is not loaded so there should 
not be notification that it is loaded (even though it is followed by the 
unload notification).

This is marked as critical because of the following:
1) This is regression that puts existing code in a bad shape.
2) Most event listeners handling those events are running in either asyncExec, 
syncExec or UIJob. Depending on which methods they chose they run in different 
troubles, ranging from wasted processing and memory to bad things in the UI 
(like multiple dialog boxes in one case).
Comment 1 Chris McGee CLA 2005-11-25 16:55:27 EST
Created attachment 30650 [details]
Patch for the gmf.runtime.emf.core plugin.
Comment 2 Chris McGee CLA 2005-11-25 16:55:48 EST
Created attachment 30651 [details]
Patch for the tests.gmf.runtime.emf.core plugin.
Comment 3 Chris McGee CLA 2005-11-25 17:41:08 EST
Delivered the M4 fix that will revert the MSL to the old behaviour. The M5 fix will remove the automatic unloading of resources and all listeners will receive both load and unload events for resources that loaded with errors.
Comment 4 Chris McGee CLA 2006-02-23 15:01:29 EST
Created attachment 35257 [details]
Final Patch

The final patch is attached to remove all of the auto-unloading and squelching events on resources that failed to load with errors.
Comment 5 Chris McGee CLA 2006-02-24 09:56:38 EST
The patch has been committed.
Comment 6 Richard Gronback CLA 2008-08-13 13:06:53 EDT
[target cleanup] 1.0 M5 was the original target milestone for this bug
Comment 7 Eclipse Webmaster CLA 2010-07-19 12:24:16 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug