diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java index 41d3d1ea675..f045d96132f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 Intel Corporation and others. + * Copyright (c) 2006, 2007 Intel Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -24,9 +24,9 @@ import junit.framework.TestSuite; import org.eclipse.cdt.core.CCProjectNature; import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.dom.IPDOMManager; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.internal.core.pdom.indexer.fast.PDOMFastIndexer; import org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildIOType; @@ -997,11 +997,7 @@ public class BuildDescriptionModelTests extends TestCase { ManagedBuildTestHelper.createFile(project, "f.h", "\n"); ICProject cProject = CoreModel.getDefault().create(project); - try { - CCorePlugin.getPDOMManager().setIndexerId(cProject, PDOMFastIndexer.ID); - } catch (CoreException e2) { - doFail("testDes_gnu30_exe_deps: failed to associate the fast indexer with the project"); - } + CCorePlugin.getIndexManager().setIndexerId(cProject, IPDOMManager.ID_FAST_INDEXER); IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project); IManagedProject mProj = info.getManagedProject(); IConfiguration cfg = mProj.getConfigurations()[0]; diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexLocationTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexLocationTest.java index 19f538fed76..dae28224086 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexLocationTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexLocationTest.java @@ -72,7 +72,7 @@ public class IndexLocationTest extends BaseTestCase { String content = testData[2].toString().replaceAll("ABS_EXTERNAL", externalHeader.getAbsolutePath().replaceAll("\\\\","\\\\\\\\")); IFile file3 = TestSourceReader.createFile(cproject.getProject(), "source.cpp", content); - CCorePlugin.getPDOMManager().setIndexerId(cproject, IPDOMManager.ID_FAST_INDEXER); + CCorePlugin.getIndexManager().setIndexerId(cproject, IPDOMManager.ID_FAST_INDEXER); assertTrue(CCorePlugin.getIndexManager().joinIndexer(10000, new NullProgressMonitor())); super.setUp(); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java index be9f79208f3..e2be3588268 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexTestBase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -47,7 +47,7 @@ public class IndexTestBase extends BaseTestCase { CProjectHelper.importSourcesFromPlugin(result[0], CTestPlugin.getDefault().getBundle(), importSource); } }, null); - CCorePlugin.getPDOMManager().setIndexerId(result[0], IPDOMManager.ID_FAST_INDEXER); + CCorePlugin.getIndexManager().setIndexerId(result[0], IPDOMManager.ID_FAST_INDEXER); // wait until the indexer is done assertTrue(CCorePlugin.getIndexManager().joinIndexer(10000, new NullProgressMonitor())); return result[0]; diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TeamSharedIndexTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TeamSharedIndexTest.java index 40f615e55b3..ff44f6bf023 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TeamSharedIndexTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TeamSharedIndexTest.java @@ -23,6 +23,7 @@ import org.eclipse.cdt.core.dom.IPDOMManager; import org.eclipse.cdt.core.dom.ast.IBinding; import org.eclipse.cdt.core.dom.ast.IVariable; import org.eclipse.cdt.core.index.IIndex; +import org.eclipse.cdt.core.index.IIndexManager; import org.eclipse.cdt.core.index.IndexFilter; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ElementChangedEvent; @@ -30,7 +31,7 @@ import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.IElementChangedListener; import org.eclipse.cdt.core.testplugin.CProjectHelper; import org.eclipse.cdt.core.testplugin.util.TestSourceReader; -import org.eclipse.cdt.internal.core.pdom.PDOMManager; +import org.eclipse.cdt.internal.core.CCoreInternals; import org.eclipse.cdt.internal.core.pdom.indexer.IndexerPreferences; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProjectDescription; @@ -51,7 +52,7 @@ public class TeamSharedIndexTest extends IndexTestBase { } private Collection fProjects= new LinkedList(); - private static final PDOMManager fPDOMManager = (PDOMManager) CCorePlugin.getPDOMManager(); + private static final IIndexManager fPDOMManager = CCoreInternals.getPDOMManager(); public TeamSharedIndexTest(String name) { super(name); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TrilogyPerformanceTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TrilogyPerformanceTest.java index ea3dc3f82ed..d96c2a5ba42 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TrilogyPerformanceTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/TrilogyPerformanceTest.java @@ -58,7 +58,7 @@ public class TrilogyPerformanceTest extends IndexTestBase { try { IndexerPreferences.set(cproject.getProject(), IndexerPreferences.KEY_INDEX_ALL_FILES, "true"); long start = System.currentTimeMillis(); - CCorePlugin.getPDOMManager().reindex(cproject); + CCorePlugin.getIndexManager().reindex(cproject); assertTrue(CCorePlugin.getIndexManager().joinIndexer(360000, new NullProgressMonitor())); System.out.println("Took: "+(System.currentTimeMillis() - start)); IIndex index= CCorePlugin.getIndexManager().getIndex(cproject); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java index a34ddd6606b..742ad4a8581 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/PDOMTestBase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 QNX Software Systems and others. + * Copyright (c) 2006, 2007 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -97,7 +97,7 @@ public class PDOMTestBase extends BaseTestCase { }, null); // Index the project - CCorePlugin.getPDOMManager().setIndexerId(cprojects[0], IPDOMManager.ID_FAST_INDEXER); + CCorePlugin.getIndexManager().setIndexerId(cprojects[0], IPDOMManager.ID_FAST_INDEXER); // wait until the indexer is done assertTrue(CCorePlugin.getIndexManager().joinIndexer(360000, new NullProgressMonitor())); diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java index af8f1f53dc1..ed3910a5187 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CPPSelectionTestsAnyIndexer.java @@ -56,7 +56,7 @@ public abstract class CPPSelectionTestsAnyIndexer extends BaseSelectionTestsInde // ScannerConfigNature.addScannerConfigNature(project); // PerProjectSICollector.calculateCompilerBuiltins(project); - CCorePlugin.getPDOMManager().setIndexerId(fCProject, sourceIndexerID); + CCorePlugin.getIndexManager().setIndexerId(fCProject, sourceIndexerID); index= CCorePlugin.getIndexManager().getIndex(fCProject); } diff --git a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java index 6c3775f64f3..097133b57b4 100644 --- a/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java +++ b/core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/selection/CSelectionTestsAnyIndexer.java @@ -52,7 +52,7 @@ public abstract class CSelectionTestsAnyIndexer extends BaseSelectionTestsIndexe fCProject = createProject("CSelectionTestsDOMIndexerProject"); //$NON-NLS-1$ assertNotNull("Unable to create project", fCProject); - CCorePlugin.getPDOMManager().setIndexerId(fCProject, sourceIndexerID); + CCorePlugin.getIndexManager().setIndexerId(fCProject, sourceIndexerID); index= CCorePlugin.getIndexManager().getIndex(fCProject); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/SetFastIndexerAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/SetFastIndexerAction.java index 3ca673b8eb7..664791ee990 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/SetFastIndexerAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/indexview/SetFastIndexerAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2006 QNX Software Systems + * Copyright (c) 2005, 2007 QNX Software Systems * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -16,6 +16,7 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.dom.IPDOMManager; +import org.eclipse.cdt.core.index.IIndexManager; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.ui.CUIPlugin; @@ -33,14 +34,10 @@ public class SetFastIndexerAction extends IndexAction { public void run() { try { - IPDOMManager manager = CCorePlugin.getPDOMManager(); + IIndexManager manager = CCorePlugin.getIndexManager(); ICProject[] projects = CoreModel.getDefault().getCModel().getCProjects(); for (int i = 0; i < projects.length; ++i) { - try { - manager.setIndexerId(projects[i], IPDOMManager.ID_FAST_INDEXER); - } catch (CoreException e) { - CUIPlugin.getDefault().log(e); - } + manager.setIndexerId(projects[i], IPDOMManager.ID_FAST_INDEXER); } } catch (CoreException e) { CCorePlugin.log(e); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java index 8d66cc64115..788ace7cc58 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/CContentAssistInvocationContext.java @@ -18,7 +18,6 @@ import org.eclipse.jface.text.ITextViewer; import org.eclipse.ui.IEditorPart; import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.dom.IPDOMManager; import org.eclipse.cdt.core.dom.ast.ASTCompletionNode; import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndexManager; @@ -117,10 +116,8 @@ public class CContentAssistInvocationContext extends ContentAssistInvocationCont if (proj == null) return null; try{ - IPDOMManager manager = CCorePlugin.getPDOMManager(); - String indexerId = manager.getIndexerId(proj); - - if (!IPDOMManager.ID_NO_INDEXER.equals(indexerId)) { + IIndexManager manager= CCorePlugin.getIndexManager(); + if (manager.isProjectIndexed(proj)) { fIndex = CCorePlugin.getIndexManager().getIndex(proj, IIndexManager.ADD_DEPENDENCIES | IIndexManager.ADD_DEPENDENT);