Bug 142303

Summary: Right-click, "Open Declaration" fails under 3.2RC4
Product: [Eclipse Project] JDT Reporter: David Pickens <pickens>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Possible fix
none
Updated fix none

Description David Pickens CLA 2006-05-17 14:16:59 EDT
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;
    }
}
Comment 1 Martin Aeschlimann CLA 2006-05-18 12:00:21 EDT
Verified in RC4: code resolve returns an empty array.
The AST seems to be able to get the correct binding.
Comment 2 David Audel CLA 2006-05-23 06:03:37 EDT
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.
Comment 3 David Audel CLA 2006-05-23 06:04:07 EDT
Created attachment 42251 [details]
Possible fix
Comment 4 David Audel CLA 2006-09-25 05:55:53 EDT
Created attachment 50805 [details]
Updated fix
Comment 5 David Audel CLA 2006-09-25 05:58:54 EDT
Released for 3.3 M3.

Test added
  ResolveTests#testMethodInAnonymous1()
Comment 6 Olivier Thomann CLA 2006-10-30 14:55:07 EST
Verified for 3.3 M3 using warm-up build I20061030-0800