Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327753 - ICElementDelta[] getChangedChildren()
Summary: ICElementDelta[] getChangedChildren()
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-14 06:34 EDT by Christophe Le Camus CLA
Modified: 2020-09-04 15:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.