Summary: | Search finds deleted classes | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Martin Aeschlimann <martinae> | ||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Status: | RESOLVED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | ||||||||
Version: | 2.0 | ||||||||
Target Milestone: | 2.0 M4 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows 2000 | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Martin Aeschlimann
2002-02-07 10:23:57 EST
Created attachment 320 [details]
AllTypesCacheTest.java
Created attachment 321 [details]
AllTypesCache.java
Could it be related to recent changes in the delta processor ? Which version of jdt.ui is AllTypeCacheTests for? I tried with 20020205 and I cannot compile it. I tried the latest jdt.ui from HEAD, and I get a ClassCastException. Could you provide me with a self-contained test case? Closing. Please re-open if you have a valid test case. 1. Load plugin 'org.eclipse.jdt.ui.tests' (its also in dev.eclipse) to your workspace for eclipse developement. 2. You find the latest version of AllTypesCacheTest in there. It can be runned from its main, if you have all requiered projects at the same locaion (No usage of projects pointing directly to the drop), or use the JUnit Eclipse launcher. Doing that you get 1 failure. (1.) 3. No go to AutomatedSuite and uncomment the last line in suite. Now also other test cases fail that succeeded before. (2) What are the deleted types that are found? Where in the test suite code are they deleted? all the element are from a JAR ('mylib.jar'.). This JAR is put on the classpath in setup (look for JavaProjectHelper.MYLIB), and removed from the classpath again in the test. However, the types contained are still found by search. That's not what I'm seeing. I see that the 3 extra types are: 534: path= /TestProject2/src/pack1/ReqProjType.java; pkg= pack1; enclosing= ReqProjType; name= Inner 535: path= /TestProject2/src/pack1/ReqProjType.java; pkg= pack1; enclosing= ReqProjType.Inner; name= InnerInner 536: path= /TestProject2/src/pack1/ReqProjType.java; pkg= pack1; enclosing= ; name= ReqProjType Where are these types created and deleted? These types come from JavaModelUtilTest. First problem was because the same workspace scope was used before and after a classpath was changed. It was caching all the indexes visible in the workspace. Changed it (and all the scopes) so that they listen for the java element deltas and update their internal state when needed. Second problem was because the index of a project was not removed from disk when the project was deleted. As a result, when the same project was re- created, it would reuse the index and find extra-types. Now deleting the index when the project is deleted. |