Bug 222080 - [assist] Wrong proposals order when completing on an item of an array
Summary: [assist] Wrong proposals order when completing on an item of an array
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-10 12:41 EDT by Frederic Fusier CLA
Modified: 2008-03-25 12:59 EDT (History)
1 user (show)

See Also:


Attachments
Project to reproduce the problem (4.15 KB, application/octet-stream)
2008-03-10 12:41 EDT, Frederic Fusier CLA
no flags Details
Proposed fix (3.04 KB, patch)
2008-03-13 05:46 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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