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 f4cd9a0ff5a..a3c14c9626e 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 @@ -139,8 +139,8 @@ abstract public class PDOMWriter { * @since 4.0 */ public void addSymbols(IASTTranslationUnit ast, IIndexFileLocation[] ifls, IWritableIndex index, - int readlockCount, boolean flushIndex, int configHash, ITodoTaskUpdater taskUpdater, IProgressMonitor pm) - throws InterruptedException, CoreException { + int readlockCount, boolean flushIndex, int configHash, ITodoTaskUpdater taskUpdater, + IProgressMonitor pm) throws InterruptedException, CoreException { if (fShowProblems) { fShowInclusionProblems= true; fShowScannerProblems= true; @@ -159,7 +159,8 @@ abstract public class PDOMWriter { resolveNames(symbolMap, ifls, stati, pm); // index update - storeSymbolsInIndex(symbolMap, ifls, ast.getLinkage().getLinkageID(), configHash, contextIncludes, index, readlockCount, flushIndex, stati, pm); + storeSymbolsInIndex(symbolMap, ifls, ast.getLinkage().getLinkageID(), configHash, contextIncludes, + index, readlockCount, flushIndex, stati, pm); if (taskUpdater != null) { taskUpdater.updateTasks(ast.getComments(), ifls); @@ -186,13 +187,14 @@ abstract public class PDOMWriter { } } - private void storeSymbolsInIndex(final Map symbolMap, IIndexFileLocation[] ifls, int linkageID, int configHash, - HashSet contextIncludes, IWritableIndex index, int readlockCount, boolean flushIndex, + private void storeSymbolsInIndex(final Map symbolMap, IIndexFileLocation[] ifls, + int linkageID, int configHash, HashSet contextIncludes, + IWritableIndex index, int readlockCount, boolean flushIndex, ArrayList stati, IProgressMonitor pm) throws InterruptedException, CoreException { index.acquireWriteLock(readlockCount); long start= System.currentTimeMillis(); try { - for (int i=0; i symbolMap, IIndexFileLocation[] ifls, ArrayList stati, IProgressMonitor pm) { + private void resolveNames(final Map symbolMap, IIndexFileLocation[] ifls, + ArrayList stati, IProgressMonitor pm) { long start= System.currentTimeMillis(); for (IIndexFileLocation path : ifls) { if (pm.isCanceled()) { @@ -253,7 +257,8 @@ abstract public class PDOMWriter { } else if (name.isReference()) { if (binding instanceof ICPPTemplateParameter || binding instanceof ICPPUnknownBinding || - ((fSkipReferences & SKIP_TYPE_REFERENCES) != 0 && isTypeReferenceBinding(binding))) { + ((fSkipReferences & SKIP_TYPE_REFERENCES) != 0 && + isTypeReferenceBinding(binding))) { if (!isRequiredReference(name)) { na[0]= null; } else { @@ -274,8 +279,8 @@ abstract public class PDOMWriter { } if (th != null) { if (!reported) { - stati.add(CCorePlugin.createStatus( - NLS.bind(Messages.PDOMWriter_errorResolvingName, name.toString(), path.getURI().getPath()), th)); + stati.add(CCorePlugin.createStatus(NLS.bind(Messages.PDOMWriter_errorResolvingName, + name.toString(), path.getURI().getPath()), th)); } reported= true; j.remove(); @@ -286,8 +291,8 @@ abstract public class PDOMWriter { fStatistics.fResolutionTime += System.currentTimeMillis()-start; } - private void extractSymbols(IASTTranslationUnit ast, final Map symbolMap, Collection contextIncludes) throws CoreException { - + private void extractSymbols(IASTTranslationUnit ast, final Map symbolMap, + Collection contextIncludes) throws CoreException { final HashSet contextIFLs= new HashSet(); final IIndexFileLocation astIFL = fResolver.resolveASTPath(ast.getFilePath()); @@ -307,8 +312,7 @@ abstract public class PDOMWriter { if (include.isActive()) { if (!include.isResolved()) { unresolvedIncludes++; - } - else if (updateSource) { + } else if (updateSource) { // the include was parsed, check if we want to update the included file in the index final IIndexFileLocation targetIFL= fResolver.resolveASTPath(include.getPath()); if (symbolMap.containsKey(targetIFL) && contextIFLs.add(targetIFL)) { @@ -421,13 +425,15 @@ abstract public class PDOMWriter { lists.fNames.add(thing); } - private void addToMap(Map map, IIndexFileLocation location, IASTPreprocessorIncludeStatement thing) { + private void addToMap(Map map, IIndexFileLocation location, + IASTPreprocessorIncludeStatement thing) { Symbols lists= map.get(location); if (lists != null) lists.fIncludes.add(thing); } - private void addToMap(Map map, IIndexFileLocation location, IASTPreprocessorStatement thing) { + private void addToMap(Map map, IIndexFileLocation location, + IASTPreprocessorStatement thing) { Symbols lists= map.get(location); if (lists != null) lists.fMacros.add(thing); @@ -440,8 +446,9 @@ abstract public class PDOMWriter { return false; } - private IIndexFragmentFile storeFileInIndex(IWritableIndex index, IIndexFileLocation location, Map symbolMap, - int linkageID, int configHash, Set contextIncludes) throws CoreException { + private IIndexFragmentFile storeFileInIndex(IWritableIndex index, IIndexFileLocation location, + Map symbolMap, int linkageID, int configHash, + Set contextIncludes) throws CoreException { Set clearedContexts= Collections.emptySet(); IIndexFragmentFile file= index.getWritableFile(linkageID, location); if (file != null) { @@ -464,7 +471,7 @@ abstract public class PDOMWriter { } IncludeInformation[] includeInfos= new IncludeInformation[lists.fIncludes.size()]; - for (int i=0; i