diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java index b47a937406e..a6f273aa0bd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/CIndex.java @@ -91,11 +91,13 @@ public class CIndex implements IIndex { return null; } - public IIndexBinding[] findBindings(Pattern pattern, boolean isFullyQualified, IndexFilter filter, IProgressMonitor monitor) throws CoreException { + public IIndexBinding[] findBindings(Pattern pattern, boolean isFullyQualified, IndexFilter filter, + IProgressMonitor monitor) throws CoreException { return findBindings(new Pattern[] { pattern }, isFullyQualified, filter, monitor); } - public IIndexBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter filter, IProgressMonitor monitor) throws CoreException { + public IIndexBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter filter, + IProgressMonitor monitor) throws CoreException { if (SPECIALCASE_SINGLES && fFragments.length == 1) { return fFragments[0].findBindings(patterns, isFullyQualified, filter, monitor); } else { @@ -122,7 +124,8 @@ public class CIndex implements IIndex { } } - public IIndexBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor) throws CoreException { + public IIndexBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor) + throws CoreException { if (SPECIALCASE_SINGLES && fFragments.length == 1) { return fFragments[0].findMacroContainers(pattern, filter, monitor); } else { @@ -133,7 +136,8 @@ public class CIndex implements IIndex { IIndexFragmentBinding[][] fragmentBindings = new IIndexFragmentBinding[fPrimaryFragmentCount][]; for (int i = 0; i < fPrimaryFragmentCount; i++) { try { - IBinding[] part = fFragments[i].findMacroContainers(pattern, retargetFilter(linkage, filter), monitor); + IBinding[] part = fFragments[i].findMacroContainers(pattern, + retargetFilter(linkage, filter), monitor); fragmentBindings[i] = new IIndexFragmentBinding[part.length]; System.arraycopy(part, 0, fragmentBindings[i], 0, part.length); } catch (CoreException e) { @@ -259,7 +263,8 @@ public class CIndex implements IIndex { return result.toArray(new IIndexInclude[result.size()]); } - public void findIncludedBy(List in, List out, int depth, HashSet handled) throws CoreException { + public void findIncludedBy(List in, List out, int depth, + HashSet handled) throws CoreException { List nextLevel= depth != 0 ? new LinkedList() : null; for (IIndexFile iIndexFile : in) { IIndexFragmentFile file = (IIndexFragmentFile) iIndexFile; @@ -295,7 +300,8 @@ public class CIndex implements IIndex { return result.toArray(new IIndexInclude[result.size()]); } - private void findIncludes(List in, List out, int depth, HashSet handled) throws CoreException { + private void findIncludes(List in, List out, int depth, + HashSet handled) throws CoreException { List nextLevel= depth != 0 ? new LinkedList() : null; for (IIndexFile iIndexFile : in) { IIndexFragmentFile file = (IIndexFragmentFile) iIndexFile; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java index e49aa2205ff..2ca1f06577b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java @@ -113,8 +113,8 @@ public class IndexFactory { safeAddFragment(readOnlyFrag, fPDOMManager.getPDOM(cproject)); } - Collection roPdoms= readOnlyFrag.values(); - return new WritableCIndex(pdom, roPdoms.toArray(new IIndexFragment[roPdoms.size()]) ); + Collection readOnlyFragments= readOnlyFrag.values(); + return new WritableCIndex(pdom, readOnlyFragments.toArray(new IIndexFragment[readOnlyFragments.size()])); } private Collection getProjects(ICProject[] projects, boolean addDependencies,