Bug 149640

Summary: [1.5][assist] code assist fails in foreach loop in anonymous innerclass as a field
Product: [Eclipse Project] JDT Reporter: Leif Åstrand <leif.astrand>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: eric_jodet
Version: 3.2   
Target Milestone: 3.4 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Leif Åstrand CLA 2006-07-05 05:09:42 EDT
public class Test {
    
//    private void foo() {
    Object foo = new Object() {
        private void foo() {
            for (Object o : new Object[0]) {
                o.
            }
        }
    };
//    }

}
Comment 1 Leif Åstrand CLA 2006-07-05 05:15:14 EDT
Accidentally pressed enter submitting the incomplete report, here comes the rest of the description:

Content assitst doesn't give any suggestions for the incomplete "o." variable. "o cannot be resolved" is printed in the status bar.

If the comments are removed, making foo a local variable instead of an instance variable the expected suggestions are displayed when ctrl + space is pressed.
Comment 2 David Audel CLA 2008-04-10 07:12:27 EDT

*** This bug has been marked as a duplicate of bug 193045 ***
Comment 3 Eric Jodet CLA 2008-04-29 01:26:59 EDT
Verified for 3.4M7 using I20080427-2000.