Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmanuel Graf2008-09-11 19:20:12 +0000
committerEmanuel Graf2008-09-11 19:20:12 +0000
commit4be6cbe06b92f7da0e369345feceeeed393efa7b (patch)
tree426efb2419f7112c3b31b52f2f9ad037c5369584
parentd27604d2e2287d7d8255d7f3017dec1eba8532a8 (diff)
downloadorg.eclipse.cdt-4be6cbe06b92f7da0e369345feceeeed393efa7b.tar.gz
org.eclipse.cdt-4be6cbe06b92f7da0e369345feceeeed393efa7b.tar.xz
org.eclipse.cdt-4be6cbe06b92f7da0e369345feceeeed393efa7b.zip
FIXED - bug 246921: NPE in ChangeGenerator when extracting constantv200809120802CDT_5_0_1
https://bugs.eclipse.org/bugs/show_bug.cgi?id=246921 patch from Tom Ball
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/rewrite/changegenerator/ChangeGenerator.java6
1 files changed, 4 insertions, 2 deletions
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 f6097dbf4a9..f692980178c 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
@@ -232,8 +232,10 @@ public class ChangeGenerator extends CPPASTVisitor {
targetLocation = getFileLocationOfEmptyTranslationUnit(modification.getTargetNode());
String currentFile = targetLocation.getFileName();
IPath implPath = new Path(currentFile);
- IFile relevantFile = ResourcesPlugin.getWorkspace().getRoot()
- .getFileForLocation(implPath);
+ IFile relevantFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(implPath);
+ if (relevantFile == null) { // if not in workspace
+ throw new UnhandledASTModificationException(modification);
+ }
MultiTextEdit edit;
if (changes.containsKey(relevantFile)) {
edit = changes.get(relevantFile);

Back to the top