Bug 35132 - Need to reindex jar not on classpath not detected
Summary: Need to reindex jar not on classpath not detected
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: 2.1 RC3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-17 07:13 EST by Jerome Lanneluc CLA
Modified: 2003-03-19 09:53 EST (History)
1 user (show)

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-03-17 07:13:01 EST
Build RC2

As shown in bug 34574, if a jar (or another library) is not on the classpath 
when it is changed, we don't detect that the corresponding index should be 
recomputed if this jar is added to the classpath later on.
Comment 1 Jerome Lanneluc CLA 2003-03-17 07:22:02 EST
Fix would consist in 2 parts:
- delta processor would remove the in-memory index when detecting a change to a 
jar or library folder that is not on the classpath
- index manager would need to remember the timestamp of the jar or library 
folder for each index. It would use this timestamp to determine if the jar or 
library folder needs to be reindexed.
Comment 2 Philipe Mulet CLA 2003-03-17 07:33:35 EST
Unless PDE works around this issue (unlikely), we should fix this providing we 
have the 2 portions of the fix (only if we do).

Without fixing this defect, we have a regression compared to 2.0, where indexes 
would only be inconsistent until the next session. Indeed, on next session, the 
eager index consistency check would reject the old JAR index.

Will candidate it for RC3. Kent, can you investigate a fix for dealing with 
timestamps ?
Comment 3 Jerome Lanneluc CLA 2003-03-17 12:48:02 EST
Actually, the change in the delta processor would be too costly. A better 
change would be in SetClasspathOperation: when detecting that a root is 
removed, it should remove the in-memory index.
Comment 4 Kent Johnson CLA 2003-03-17 17:06:21 EST
If the PDE bug is not fixed (and Jerome doesn't put in a patch to delete the in-
memory index), then we will have a problem with replaced jar files if the first 
request of all future sessions for the index is a search job.

If the first request of the next session for the index is a rebuild job then 
the index will be recreated, just as it was in 2.0.
Comment 5 Philipe Mulet CLA 2003-03-17 17:15:04 EST
If the replacing JAR is close enough (same entries), we will not think we need 
to recreate it, though references maybe totally different.

The timestamp idea would elegantly solve this.

Also, for the in-memory cleanup, as soon as the JAR/lib is no longer referenced 
from any classpath, it should be removed from the in-memory table; but kept on 
disk, so that if switching JDKs or similar things, then it would get reopened 
from disk rather than being fully recreated (cleanup on disk only occurs on 
shutdown).

Index file opening should check for dirty-ness and timestamp of matching lib.
Comment 6 Philipe Mulet CLA 2003-03-18 04:43:28 EST
Got approval for RC3.
Comment 7 Jerome Lanneluc CLA 2003-03-18 13:14:45 EST
Solution was finally to remove both the in-memory index and the on-disk index 
if the jar is not referenced on any classpath.
Comment 8 David Audel CLA 2003-03-19 09:53:17 EST
Verified.