Community
Participate
Working Groups
N20070108-0010 Have this: 1. in project S add to package 'packS': public class Stat { public static void testMethod() { } } 2. hack the following code into your CompletionRequestor: yourRequestor.setFavoriteReferences(new String[] { "packS.Stat.*" }); 3. in project P with package 'packP': public class Foo { void foo() { t<code assist> } } ==> suggests 'testMethod' which it shouldn't applying this would cause a compilation error because type packS.Stat isn't on the build path of project P.
I can reproduce the problem only if Stat.java is opened in a editor. When the editor is closed 'testMethod' isn't proposed. The problem seems to be in NameLookup. The workingcopies given to build the NameLookup aren't filtered if they are not on the buildpath of the project. I can reproduce a similar behavior with the following test case. 1) create a project P1 2) create p1/X.java inside P1 package p1; public class X {} 3) create a project P2 4) create p2/Y.java inside P2 package p2; import p1| // complete at | location public class Y { } 5) do ctrl+space at | location if X.java is opened in an editor p1 is proposed. if X.java isn't opened in an editor p1 isn't proposed.
*** Bug 170249 has been marked as a duplicate of this bug. ***
NameLookup constructor should filter out working copies that don't belong to the project
See also bug 194399
Created attachment 75957 [details] Proposed fix and regression test
Fix and test released for 3.4M2 in HEAD.
Verified for 3.4 M2 using I20070917-0010.