Bug 222080

Summary: [assist] Wrong proposals order when completing on an item of an array
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jerome_lanneluc
Version: 3.4   
Target Milestone: 3.4 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Project to reproduce the problem
none
Proposed fix none

Description Frederic Fusier CLA 2008-03-10 12:41:06 EDT
Created attachment 92055 [details]
Project to reproduce the problem

Build I20080305-1100.

Unzip the attached jar file, import the 'Completion' project in a workspace, open the class 'Test' and complete where indicated. You'll get a long list of proposals...

The one I was looking for was 'type', and I'm really surprised to find it only near the end of the list. As I was in an identity test with ASTNode, I would not expect to see all 'int' proposals placed before the 'ASTNode' one...
Comment 1 David Audel CLA 2008-03-10 13:31:32 EDT
Smaller test case:

package p;

public class Test {
	void foo(Object a) {
		Object zzvar1 = null;
		int zzvar2 = 0;
		if (a == zz) {
			
		}
	}
}

zzvar2 shouldn't be the first proposal.
Comment 2 David Audel CLA 2008-03-13 05:46:28 EDT
Created attachment 92412 [details]
Proposed fix
Comment 3 David Audel CLA 2008-03-13 05:55:49 EDT
Released for 3.4M6

Test added
  CompletionTests#testCompletionAfterEqualEqual1()

Comment 4 Jerome Lanneluc CLA 2008-03-25 12:59:53 EDT
'type' is no longer proposed at the end of the list. However this could still be improved. I entered bug 223899 for this.

In the meantime, marking this bug as verified for 3.4M6 using I20080325-0100