Merge pull request #724 from eclipse/ak/fixed_node_replacement

[NodeModel] replace a first child of a new node with null if an old does not have children
This commit is contained in:
Anton Kosyakov 2015-10-22 16:30:59 +02:00
commit b5e0f8cdfc

View file

@ -330,8 +330,8 @@ public class NodeModelBuilder {
CompositeNode oldComposite = (CompositeNode) oldNode;
CompositeNode newComposite = (CompositeNode) newNode;
AbstractNode child = oldComposite.basicGetFirstChild();
newComposite.basicSetFirstChild(child);
if (child != null) {
newComposite.basicSetFirstChild(child);
while(child.basicGetParent() != newComposite) {
child.basicSetParent(newComposite);
child = child.basicGetNextSibling();