Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-11-21 14:47:18 -0500
committerSergey Prigogin2013-11-21 15:01:02 -0500
commitceac5fd156fc05021cab937977446bd1ca56b495 (patch)
treeaa029394b860207267405b96bebf6cbb24eb1f2c
parentf923ac33421be532f5fa828f459b7ee1afc083c4 (diff)
downloadorg.eclipse.cdt-ceac5fd156fc05021cab937977446bd1ca56b495.tar.gz
org.eclipse.cdt-ceac5fd156fc05021cab937977446bd1ca56b495.tar.xz
org.eclipse.cdt-ceac5fd156fc05021cab937977446bd1ca56b495.zip
Bug 422217 - NPE in IndexLocationFactory.getAbsolutePath
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java
index ad3d44f23f..efd6ed51bd 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java
@@ -72,6 +72,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexFile;
+import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.index.IIndexInclude;
import org.eclipse.cdt.core.index.IIndexName;
@@ -797,7 +798,10 @@ public class IncludeOrganizer {
IIndexFile indexFile = request.getDeclaringFiles().keySet().iterator().next();
if (!includedByPartner.contains(indexFile)) {
for (IIndexInclude include : indexFile.getIncludes()) {
- fContext.addHeaderAlreadyIncluded(getAbsolutePath(include.getIncludesLocation()));
+ IIndexFileLocation headerLocation = include.getIncludesLocation();
+ if (headerLocation != null) {
+ fContext.addHeaderAlreadyIncluded(getAbsolutePath(headerLocation));
+ }
}
includedByPartner.add(indexFile);
}

Back to the top