Bug 32488

Summary: Request to add/remove source folder to index should not look at active job
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 RC2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Jerome Lanneluc CLA 2003-02-21 10:41:36 EST
Build 20030221

1. Start runtime workspace under debug
2. Create Java project Test (with prj=src=bin)
3. Add class X.java in Test
4. Close project Test
5. Put a breakpoint in IndexAllProject on line 294 (last line of execute())
6. Open project Test
7. When the breakpoint is hit, leave the Java Indexing thread suspended
8. Edit Test's claspath so that it now have a 'src' source folder and no more 
proj=src.
9. Resume Java Indexing thread
10. Open Type...
Observe: X is returned (it is still in the index)

When setting the classpath, we should always post an IndexAllProject job (and 
remove the jobs of the same family)
Comment 1 Jerome Lanneluc CLA 2003-02-21 10:42:27 EST
I believe this can cause the Java model tests to fail intermitently.
Comment 2 Jerome Lanneluc CLA 2003-02-24 07:33:37 EST
Actually, the work in SetClasspathOperation is ok. The problem comes from the 
fact that IndexManager.removeSourceFolder(...) looks at the running job to 
determine if the request should be made or not. If an IndexAllProject job has 
already started, this check is wrong.

Changed title to reflect the real problem.
Comment 3 Jerome Lanneluc CLA 2003-02-26 05:29:05 EST
We should fix all cases were we look at the job queue before adding a job. We 
should never consider the active job (i.e. the one at jobStart) as it may have 
already started.
Comment 4 Jerome Lanneluc CLA 2003-02-26 11:05:24 EST
Fixed IndexManager.indexAll, indexLibrary, indexSourceFolder, 
removeSourceFolder to not consider the job at jobStart.
Comment 5 David Audel CLA 2003-03-10 09:46:52 EST
Verified.