diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java index 6c0de994f23..b3a75c718fb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMWriter.java @@ -83,7 +83,8 @@ abstract public class PDOMWriter { * Extracts symbols from the given ast and adds them to the index. It will * make calls to * {@link #needToUpdate(IIndexFileLocation)}, - * {@link #postAddToIndex(IIndexFileLocation, IIndexFile)} and + * {@link #postAddToIndex(IIndexFileLocation, IIndexFile)}, + * {@link #getLastModified(IIndexFileLocation)} and * {@link #findLocation(String)} to obtain further information. * @since 4.0 */ @@ -253,7 +254,7 @@ abstract public class PDOMWriter { } else { file= index.addFile(location); } - file.setTimestamp(EFS.getStore(location.getURI()).fetchInfo().getLastModified()); + file.setTimestamp(getLastModified(location)); ArrayList[] lists= (ArrayList[]) symbolMap.get(location); if (lists != null) { ArrayList list= lists[0]; @@ -293,4 +294,15 @@ abstract public class PDOMWriter { fInfo.fTotalSourcesEstimate+= totalEstimate; } } + + /** + * Obtains the timestamp of an index file location. + * @param location the location for which the timestamp is obtained. + * @return the timestamp. + * @throws CoreException + * @since 4.0 + */ + protected long getLastModified(IIndexFileLocation location) throws CoreException { + return EFS.getStore(location.getURI()).fetchInfo().getLastModified(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java index e9d059e7e80..311af18a685 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/PDOMIndexerTask.java @@ -107,7 +107,8 @@ public abstract class PDOMIndexerTask extends PDOMWriter implements IPDOMIndexer * {@link #createAST(ITranslationUnit, IProgressMonitor)}, * {@link #needToUpdate(IIndexFileLocation)}, * {@link #addSymbols(IASTTranslationUnit, IWritableIndex, int, IProgressMonitor)} - * {@link #postAddToIndex(IIndexFileLocation, IIndexFile)} and + * {@link #postAddToIndex(IIndexFileLocation, IIndexFile)}, + * {@link #getLastModified(IIndexFileLocation)} and * {@link #findLocation(String)} * @since 4.0 */