Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326570

Summary: Hide remote indexer for local projects
Product: [Tools] PTP Reporter: Vivian Kong <vivkong>
Component: RDTAssignee: Vivian Kong <vivkong>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ptp-inbox
Version: 4.0.3   
Target Milestone: 4.0.4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Vivian Kong CLA 2010-09-29 14:17:50 EDT
The remote indexer is available in the indexer properties page for local projects. There is no service model configuration for local projects so the remote indexer won't work.

When switching to the remote indexer and clicking OK on the properties page an error dialog immediately pops up. The following shows up in the error log:

An internal error occurred during: "C/C++ Indexer".
org.eclipse.ptp.rdt.services.core.ProjectNotConfiguredException
	at org.eclipse.ptp.rdt.services.core.ServiceModelManager.getConf(Unknown Source)
	at org.eclipse.ptp.rdt.services.core.ServiceModelManager.getActiveConfiguration(Unknown Source)
	at org.eclipse.ptp.internal.rdt.core.index.RemoteFastIndexer.createTask(Unknown Source)
	at org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask.createDelegate(Unknown Source)
	at org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask.run(Unknown Source)
	at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(Unknown Source)
	at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)


The remote indexer should not be available as an option for local projects.
Comment 1 Vivian Kong CLA 2010-09-29 14:19:32 EDT
Here's the proposed patch:

### Eclipse Workspace Patch 1.0
#P org.eclipse.ptp.rdt.ui
Index: src/org/eclipse/ptp/internal/rdt/ui/preferences/IndexerBlock.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.ptp/rdt/org.eclipse.ptp.rdt.ui/src/org/eclipse/ptp/internal/rdt/ui/preferences/IndexerBlock.java,v
retrieving revision 1.2.2.1
diff -u -r1.2.2.1 IndexerBlock.java
--- src/org/eclipse/ptp/internal/rdt/ui/preferences/IndexerBlock.java	9 Aug 2010 17:47:35 -0000	1.2.2.1
+++ src/org/eclipse/ptp/internal/rdt/ui/preferences/IndexerBlock.java	29 Sep 2010 18:19:08 -0000
@@ -455,7 +455,9 @@
                 				fIndexerConfigMap.put(id, config);
                 			}
                 		} else {
-                			fIndexerConfigMap.put(id, config);
+                			if (!(id.startsWith("org.eclipse.ptp.rdt.core.RemoteFastIndexer"))) { //$NON-NLS-1$ 
+                				fIndexerConfigMap.put(id, config);
+                			}
                 		}
                 	}
                 }
Comment 2 Vivian Kong CLA 2010-09-29 14:28:22 EDT
Fixed in ptp_4_0 and HEAD