Community
Participate
Working Groups
I20080501-0100 - create the following class package p; public class P { private void foo(String key){ if (key != null) { String[] keys= { k }; } } } - try to complete 'k' inside the array initializer: No results. Expected: 'key' and types starting with 'K'
David, is it a regression comparing to 3.3.2 ?
It is a regression comparing to 3.3.2 added by the fix for bug 193909.
Please investigate for RC1
Created attachment 99011 [details] Proposed fix The problem is inside CompletionEngne#buildMoreCompletionEnclosingContext(). The innermost enclosing if statement is rebuild but when the current element of the recovery is RecoveredLocalVariable then this recovered element can be also included inside the if statement. So if the location of the RecoveredLocalVariable is after the if source start then the recovered AST of the local variable must be computed and added inside the if statement and the RecoveredLocalVariable must be removed from the parent node.
Frederic - Could you review my fix ?
Patch looks good to me: +1
Released for 3.4RC1. Test added CompletionParserTests2#test0178_Method()
Verified for 3.4RC1 using I20080513-2000