Community
Participate
Working Groups
Build I20030325 1. In self-hosting workspace, open PlatformObject in org.eclipse.core.runtime 2. In Outline, select getAdapter(Class) 3. Search in hierarchy Observe: No matches are found, but there are some (e.g. in org.eclipse.debug.internal.core.RuntimeProcess.getAdapter(Class)).
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.