Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Recoskie2009-11-12 12:19:03 -0500
committerChris Recoskie2009-11-12 12:19:03 -0500
commitf88a496f036f7a568664b9394029550a5c9dc1f0 (patch)
treec09f38f80c55eeb37cccecd45dfcb89411338960
parent42111501e2e6eaebda753019b43fe5ddc1a8b022 (diff)
downloadorg.eclipse.cdt-f88a496f036f7a568664b9394029550a5c9dc1f0.tar.gz
org.eclipse.cdt-f88a496f036f7a568664b9394029550a5c9dc1f0.tar.xz
org.eclipse.cdt-f88a496f036f7a568664b9394029550a5c9dc1f0.zip
fix for Bug 294994 - scanner discovery improperly persists include paths from EFS projectsv200911121315
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
index dd5faef410..602344e919 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/PerProjectSICollector.java
@@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.cdt.make.internal.core.scannerconfig2;
+import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -43,6 +44,10 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.DiscoveredScannerInfoSto
import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
+import org.eclipse.cdt.utils.FileSystemUtilityManager;
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -287,8 +292,27 @@ public class PerProjectSICollector implements IScannerInfoCollector3, IScannerIn
newPersistedIncludes.put(include, persistedIncludes.get(include));
}
else {
- newPersistedIncludes.put(include,
- ((new Path(include)).toFile().exists()) ? Boolean.FALSE : Boolean.TRUE);
+ // the paths may be on EFS resources, not local
+ Boolean includePathExists = true;
+ URI projectLocationURI = discPathInfo.getProject().getLocationURI();
+
+ // use the project's location... create a URI that uses the same provider but that points to the include path
+ URI includeURI = FileSystemUtilityManager.getDefault().replacePath(projectLocationURI, include);
+
+ // ask EFS if the path exists
+ try {
+ IFileStore fileStore = EFS.getStore(includeURI);
+ IFileInfo info = fileStore.fetchInfo();
+ if(!info.exists()) {
+ includePathExists = false;
+ }
+ } catch (CoreException e) {
+ MakeCorePlugin.log(e);
+ }
+
+ // if the include path doesn't exist, then we tell the scanner config system that the folder
+ // has been "removed", and thus it won't show up in the UI
+ newPersistedIncludes.put(include, !includePathExists);
}
}
}

Back to the top