Community
Participate
Working Groups
Build ID: M20070212-1330 Steps To Reproduce: Code completion does not work for loop variables in foreach loops within inner classes. The cases below demonstrate this. All are commented out, with comments above explaining whether they work or not. #1, #2, and #3 are within an inner class declaration. #4 is within a class method. #1 & #3 fail. (commented out) #2 & #4 work. private final Filter<Element> BRFilter = new Filter<Element>() { public boolean accept(Element... elements) { for (Element element : elements) { // #1 bug, does not work // element. // #2 works String s; // s. String[] ts = new String[]{}; for (String t : ts) { // #3 bug, does not work //t. } } return false; } }; public void foo() { String[] ts = new String[]{}; for (String t : ts) { // #4 works // t. } } More information:
*** Bug 195910 has been marked as a duplicate of this bug. ***
David, is this a regression compared to 3.2?
It's not a regression.
Created attachment 94835 [details] Proposed fix
Released for 3.4M7. Tests added GenericsCompletionParserTest#test0216_Diet()
*** Bug 149640 has been marked as a duplicate of this bug. ***
*** Bug 227606 has been marked as a duplicate of this bug. ***
Verified for 3.4M7 using I20080427-2000.