Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354196 - org.eclipse.cdt.dsf.ui.viewmodel.VMDelta does not override public setIndex(int)
Summary: org.eclipse.cdt.dsf.ui.viewmodel.VMDelta does not override public setIndex(int)
Status: CLOSED DUPLICATE of bug 309908
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Pawel Piech CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 18:53 EDT by Eugene Ostroukhov CLA
Modified: 2011-08-11 02:46 EDT (History)
2 users (show)

See Also:


Attachments
Proposed fix tested locally (542 bytes, text/plain)
2011-08-08 18:53 EDT, Eugene Ostroukhov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Ostroukhov CLA 2011-08-08 18:53:19 EDT
Created attachment 201114 [details]
Proposed fix tested locally

org.eclipse.cdt.dsf.ui.viewmodel.VMDelta overrides base class getIndex() method to return its member variable. It does not override setIndex(int) and that call sets member variable from a base class.
As a result code as follows:
delta.addNode(original, replacement, IModelDelta.REPLACED).setIndex(5) will not insert new node as expected as the index returned by getIndex will still be 0.
Comment 1 Anton Leherbauer CLA 2011-08-11 02:46:11 EDT
Thanks for the patch.  Could you attach it again to bug 309908?

*** This bug has been marked as a duplicate of bug 309908 ***