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

Bug 213993

Summary: Request for IdentityHashMap in AbstractEditPart.refreshChildren
Product: [Tools] GEF Reporter: Mark Ford <mark.ford>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: hudsonr, nyssen
Version: 3.3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Mark Ford CLA 2007-12-28 15:39:31 EST
The code in AbstractEditPart.refreshChildren() uses a HashMap to map an edit part's model to the actual edit part instance. This is done to determine if the edit part is new or if it needs to be reordered. My problem is that the objects I'm using for models have a hashcode()/equals which reports that the two objects are equal if their member data is the same. In order for this map to work in my case, I need to use an IdentityHashMap instead of a regular HashMap. My other option is to wrap my models in another model but I'd prefer to not have to introduce another model simply for editing.
Comment 1 Randy Hudson CLA 2008-01-02 12:02:21 EST
This has no bearing on this bug's validity, but you should try to avoid calling refreshChildren(), and call add/remove directly in reponse to changes in your model. refreshChildren() has N^2 performance, it's a bit like a bubble-sort.
Comment 2 Alexander Nyßen CLA 2014-08-09 07:18:26 EDT
I think this would have additional impact, e.g. on the edit part registry of the viewer. As GEF (MVC) 3.x is only maintained, we should not change this stable (but limited) mechanism. Resolving as WONTFIX.