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

Bug 354196

Summary: org.eclipse.cdt.dsf.ui.viewmodel.VMDelta does not override public setIndex(int)
Product: [Tools] CDT Reporter: Eugene Ostroukhov <eostroukhov>
Component: cdt-debug-dsfAssignee: Project Inbox <cdt-debug-dsf-inbox>
Status: CLOSED DUPLICATE QA Contact: Pawel Piech <pawel.1.piech>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed fix tested locally none

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 ***