Summary: | Search in hierarchy misses dependent projects | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P2 | ||||||||
Version: | 2.1 | ||||||||
Target Milestone: | 2.1.1 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows 2000 | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Jerome Lanneluc
2003-03-27 10:03:52 EST
Not critical, just search in workspace instead. Created attachment 4378 [details]
MatchLocator2 patch
Fixed by resolving in the context of the focus project only potential matches
that are in a prereq project of the focus project. Other potential matches are
resolved in the context of their respective projects.
Created attachment 4379 [details]
Regression test testHierarchyScope3().
I suspect each match should rather always be resolved in its defining context, with some knowledge of type hierarchy. e.g. P0 defines type X public class X { public static X TheX; public void foo(){} } P1 prereqs P0 and defines type T public class T { public X zork(){ return X.TheX; } } P2 prereqs P0 and P1, and defines Y public class Y extends X { public void bar() { new T().zork().foo(); } } P3 prereqs P2, and defines Z public class Z extends Y { static { X.TheX = new Z(); // zork() will actually answer an instance of Z } public void foo() {} // refs should find one in Y.bar() } Reopen May also want to backport into 2.1 future patch Each potential match is now resolved in the context of its project. If the focus type is not visible from this project, then its super type names are used (instead of the bindings). Added regression tests JavaSearchMultipleProjectsTests.testHierarchyScope3() and testHierarchyScope4(). Fix and tests backported to the 2.1 maintenance stream. Fixed in 2.2 stream as well. Verified. Verified for 3.0M1. |