Community
Participate
Working Groups
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
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.
IndexBinaryFolder has the same problem as IndexAllProject
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.
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.
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.
Verified.