diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java index 130901f1a75..5aa35c3d718 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java @@ -127,8 +127,14 @@ public class ChangeGenerator extends CPPASTVisitor { List modificationsForNode = rootModifications .getModificationsForNode(modifiedNode); IASTNode modifiedNodeParent = determineParentToBeRewritten(modifiedNode, modificationsForNode); - modificationParent.put(modifiedNodeParent != null ? modifiedNodeParent : modifiedNode, - modificationsForNode); + List list = modificationParent.get(modifiedNodeParent != null ? modifiedNodeParent : modifiedNode); + if(list != null){ + list.addAll(modificationsForNode); + }else{ + List modifiableList = new ArrayList(modificationsForNode); + modificationParent.put(modifiedNodeParent != null ? modifiedNodeParent : modifiedNode, + modifiableList); + } } } }