Community
Participate
Working Groups
3.2 M2 Consider following test case: class X { static char[] AN_ARRAY = new char[10]; static int AN_INT_VALUE = 0; static int ANOTHER_VALUE = 1; void foo(int i) { switch (i) { case AN // <-- complete after the 'AN' } } } Proposals list starts with: AN_ARRAY char[] - X AN_INT_VALUE int - X ANOTHER_VALUE int - X ... I see 2 problems here: 1) int values should have an higher relevance than other proposals 2) not sure that AN_ARRAY should be proposed as this is not an int and no int constants can be reached through it
Created attachment 73006 [details] Proposed fix
Released for 3.4M1 Test added CompletionTests#testCompletionAfterCase3() -> testCompletionAfterCase4() This patch fix only 1). Now the relevance take into account the type of the expression. I will enter another bug report for problem 2) which is another issue.
I entered bug 195346 about the issue 2)
Verified issue 1) for 3.4M1 using build I20070802-0800.