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

Bug 327753

Summary: ICElementDelta[] getChangedChildren()
Product: [Tools] CDT Reporter: Christophe Le Camus <christophe.le-camus>
Component: cdt-coreAssignee: Project Inbox <cdt-core-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: minor    
Priority: P3 CC: cdtdoug, christophe.le-camus, recoskie
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Christophe Le Camus CLA 2010-10-14 06:34:20 EDT
Build Identifier: Eclipse SDK  Version: 3.6.0 I20100608-0911

This question is relative to the CDT event detection.
The interface ICElementDelta publishes the following methods :
 ICElementDelta[] 	getAddedChildren()
          Returns deltas for the children that have been added.
 ICElementDelta[] 	getAffectedChildren()
          Returns deltas for the affected (added, removed, or changed)
children.
 ICElementDelta[] 	getChangedChildren()
          Returns deltas for the children which have changed.

However the content of the getChangedChildren() is always empty even if some
nodes are affected by a modification.
A modification is materialised as a creation event + a deletion event but
without any link between them.
or in another words :
To replace this modification information 2 events are published :
-one concerning the deletion of the old node (because name change, the old
node is considered deleted)
-one concerning the addition of a new  node (because the modification of the
name induces the creation of a different node from the old one).

I'd want to know if Eclipse has planned to enhance the management of
ICElementDelta with the implementation of the ICElementDelta[]
getChangedChildren() method ? If positive, when is it planned ?  Else, do
does exist a solution to be sure that the new node is the old one with little
modification ?

Thanks


Reproducible: Always

Steps to Reproduce:
// ICElementDelta delta;

        IWorkingCopy workingUnit = (IWorkingCopy) delta.getElement();
        ITranslationUnit originalUnit = workingUnit.getOriginalElement();
// always OK
        ICElementDelta[] children = delta.getAffectedChildren();
        ICElementDelta[] addedChildren = delta.getAddedChildren();
        ICElementDelta[] removedChildren = delta.getRemovedChildren();
// always empty
        ICElementDelta[] removedChildren = delta.getChnagedChildren();
Comment 1 Chris Recoskie CLA 2011-06-21 15:22:31 EDT
Correct me if I am wrong, but walking the delta for getAffectedChildren() should get you what you want.

We ought to remove this API since it adds nothing and does not work.

I'm downgrading this.  I don't see a show-stopping problem here.