Community
Participate
Working Groups
Enter the following source code in the JDT source editor. Highlight the call to "foo". Right-click and select "Open Declaration". The editor fails to locate the definition of "foo". ------------------------------------------ public class Test2 { private void foo(boolean v) { } Object function(boolean v) { new Runnable() { public void run() { if (false) { } else { foo(false); // <-- right-click, open declaration fails } } }; new Runnable() { public void run() { } }; if (v) {} return null; } }
Verified in RC4: code resolve returns an empty array. The AST seems to be able to get the correct binding.
The problem is inside SelectionParser. The selection recovery doesn't set the last recovery checkpoint. In a first step the recovery build the correct AST, but this AST is removed in a second step.
Created attachment 42251 [details] Possible fix
Created attachment 50805 [details] Updated fix
Released for 3.3 M3. Test added ResolveTests#testMethodInAnonymous1()
Verified for 3.3 M3 using warm-up build I20061030-0800