From 4c9fa30f86318f2c00615018356cc1066a38fbe6 Mon Sep 17 00:00:00 2001 From: Mike Kucera Date: Thu, 25 Jun 2009 21:24:15 +0000 Subject: [281415] StandaloneIndexerInputAdapter.resolveIncludeFile() does not check that the include file exists --- .../internal/core/indexer/StandaloneIndexerInputAdapter.java | 11 ++++++++--- 1 file 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 fIflCache= new HashMap(); - + private final HashMap fIflCache= new HashMap(); + 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); -- cgit v1.2.3