Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-01-14 15:47:04 +0000
committerMarkus Schorn2008-01-14 15:47:04 +0000
commit46ea38b3b183dd29ddb0f0685b02d8e003d89f5b (patch)
tree13ef4b29e02ce3eaf96c9047dcbf58ac61204124 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite
parent3b962a362e57d3f2d6c21ac2b73e8e3aa5027e70 (diff)
downloadorg.eclipse.cdt-46ea38b3b183dd29ddb0f0685b02d8e003d89f5b.tar.gz
org.eclipse.cdt-46ea38b3b183dd29ddb0f0685b02d8e003d89f5b.tar.xz
org.eclipse.cdt-46ea38b3b183dd29ddb0f0685b02d8e003d89f5b.zip
Fixes a NPE.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationMap.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationMap.java
index eaf332e224b..46db04febaf 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationMap.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/ASTModificationMap.java
@@ -73,10 +73,14 @@ public class ASTModificationMap {
* Returns the list of modifications for a given node. The list can contain different modifications.
* It is guaranteed that INSERT_BEFORE modifications appear first. Furthermore, if there is a
* REPLACE modification the list will not contain any other REPLACE or APPEND_CHILD modifications.
- * @return the modification list or <code>null</code>.
+ * @return the modification list, which may be empty.
*/
public List<ASTModification> getModificationsForNode(IASTNode node) {
- return Collections.unmodifiableList(fModifications.get(node));
+ List<ASTModification> modList = fModifications.get(node);
+ if (modList == null) {
+ return Collections.emptyList();
+ }
+ return Collections.unmodifiableList(modList);
}
/**

Back to the top