Bug 142303 - Right-click, "Open Declaration" fails under 3.2RC4
Summary: Right-click, "Open Declaration" fails under 3.2RC4
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-17 14:16 EDT by David Pickens CLA
Modified: 2006-10-30 14:55 EST (History)
0 users

See Also:


Attachments
Possible fix (974 bytes, patch)
2006-05-23 06:04 EDT, David Audel CLA
no flags Details | Diff
Updated fix (2.86 KB, patch)
2006-09-25 05:55 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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