Bug 40464 - Index states not saved
Summary: Index states not saved
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-18 09:24 EDT by Jerome Lanneluc CLA
Modified: 2003-08-28 06:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerome Lanneluc CLA 2003-07-18 09:24:24 EDT
Build 20030717

1. Start freash workspace
2. File->New Java project
3. Enter project name 'Test'
4. Next
5. Select source folder 'Test' and Remove
6. Finish
7. Ctrl-Shift-T (to wait until rt.jar is indexed)
8. Close dialog
9. Exit/restart workbench
10. Ctrl-Shitf-T
Observe: You see 2 files to index
11. Go to the index directory and open 'savedIndexNames.txt'
Observe: It is empty
Comment 1 Jerome Lanneluc CLA 2003-07-18 09:30:35 EDT
2 problems:
- IndexAllProject never saves the index state if it contains no source
- when creating the Java project, the job queue contains 2 AddJarFileToIndex 
jobs for rt.jar. When the first job tries to save the index, 
IndexManager.saveIndex(IIndex) saves the index but not its state since there is 
a second job with the same path in the queue. When the second job executes, its 
index already exists, and it simply returns.
Comment 2 Jerome Lanneluc CLA 2003-07-18 09:34:28 EDT
IndexBinaryFolder has the same problem as IndexAllProject
Comment 3 Kent Johnson CLA 2003-07-18 14:00:35 EDT
Changed IndexAllProject and IndexBinaryFolder to always save the index.

We cannot leave it in the REBUILDING_STATE when its empty or no added/removed 
files were found.
Comment 4 Kent Johnson CLA 2003-07-18 14:15:31 EDT
Actually when idle for a specified period, the IndexManager is supposed to save 
all changed indexes.

With the switch to wait/notify, we lost this behaviour so I've added it back 
after the thread wakes up, but before processing the first job.
Comment 5 Kent Johnson CLA 2003-08-22 11:24:17 EDT
We believe we have caught all the cases which would cause the indexer to 're-
index' files.

We'll create a new PR if other cases are detected.
Comment 6 David Audel CLA 2003-08-28 06:17:51 EDT
Verified.