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

Bug 333398

Summary: Cache for lists by EClass (MetaclassInstancesAdapter) : wrong computing
Product: [Modeling] MoDisco Reporter: Fabien Giquel <fabien.giquel>
Component: InfrastructureAssignee: Project Inbox <modisco.web-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P5 CC: gdupe
Version: 0.9.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Fabien Giquel CLA 2011-01-03 03:09:25 EST
Reusing MetaclassInstancesAdapter class in another context than MoDisco reveals some misc bug in computing list by Elass.
Such a bug should also occur in MoDisco (eg : with Model Browser which uses this cache).

The problem occurs when some Resource update events are taken in account in MetaclassInstancesAdapter.handleChanged(...).

The scenario is :
- having a Resource with many top level objects (in Resource.contents)
- moving one top level object to some EObject container
-> EMF sends two events = one "REMOVE" from notifier Resource + one "ADD" from notifier EObject container. The problem is that "REMOVE" comes after "ADD" and so MetaclassInstancesAdapter consider the top level object as lost.