Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kucera2009-06-25 17:24:15 -0400
committerMike Kucera2009-06-25 17:24:15 -0400
commit4c9fa30f86318f2c00615018356cc1066a38fbe6 (patch)
tree4207dd6f1a184b900702378208c702f988a5d3ef
parent09830611388e51910d4e91a726c1b44721803f8a (diff)
downloadorg.eclipse.cdt-4c9fa30f86318f2c00615018356cc1066a38fbe6.tar.gz
org.eclipse.cdt-4c9fa30f86318f2c00615018356cc1066a38fbe6.tar.xz
org.eclipse.cdt-4c9fa30f86318f2c00615018356cc1066a38fbe6.zip
[281415] StandaloneIndexerInputAdapter.resolveIncludeFile() does not check that the include file exists
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java
index 63dd9d9c41..b2e5c7e025 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java
@@ -21,6 +21,7 @@ import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.core.parser.IScannerInfo;
import org.eclipse.cdt.internal.core.index.IndexFileLocation;
import org.eclipse.cdt.internal.core.pdom.IndexerInputAdapter;
+import org.eclipse.cdt.internal.core.pdom.indexer.FileExistsCache;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -30,8 +31,9 @@ import org.eclipse.core.runtime.Path;
* @since 5.0
*/
public class StandaloneIndexerInputAdapter extends IndexerInputAdapter {
- private HashMap<String, IIndexFileLocation> fIflCache= new HashMap<String, IIndexFileLocation>();
-
+ private final HashMap<String, IIndexFileLocation> fIflCache= new HashMap<String, IIndexFileLocation>();
+ private final FileExistsCache fExistsCache = new FileExistsCache();
+
private final StandaloneIndexer fIndexer;
public StandaloneIndexerInputAdapter(StandaloneIndexer indexer) {
@@ -82,11 +84,14 @@ public class StandaloneIndexerInputAdapter extends IndexerInputAdapter {
@Override
public boolean doesIncludeFileExist(String includePath) {
- return new File(includePath).isFile();
+ return fExistsCache.isFile(includePath);
}
@Override
public IIndexFileLocation resolveIncludeFile(String includePath) {
+ if (!fExistsCache.isFile(includePath)) {
+ return null;
+ }
IIndexFileLocation result= fIflCache.get(includePath);
if (result == null) {
File file= new File(includePath);

Back to the top