Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/indexer/StandaloneIndexerInputAdapter.java')
-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 63dd9d9c41a..b2e5c7e025d 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