Bug 19917 - Code Assist incorrect for hidden interface fields
Summary: Code Assist incorrect for hidden interface fields
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0 F3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-11 12:21 EDT by Peter Burka CLA
Modified: 2002-06-13 05:15 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Burka CLA 2002-06-11 12:21:02 EDT
Build F2

Consider the following Java file:
interface A {
	public static final String s = "a";
}
interface B extends A {
	public static final String s = "b";
}
public class Foo {
	public void foo() {
		B b = null;
		System.out.println(b.);
	}
}

Note that both interfaces have a field named 's'.

Place your cursor after the 'b.' in the 'System.out.println(b.)' line.

Press Ctrl+Space.

Among the suggestions offered are A.s and B.s.

This is incorrect, since A.s is hidden by B.s.

If you pick A.s, Code Assist inserts 'Foo.s' (i.e. 'System.out.println
(b.Foo.s)'). This is completely incorrect -- it's not what I picked and it 
doesn't even compile!
Comment 1 Philipe Mulet CLA 2002-06-11 12:44:33 EDT
Reproduced. The super slot shouldn't be proposed.
Comment 2 Philipe Mulet CLA 2002-06-11 13:06:03 EDT
Same bug with member types instead of fields.
Methods are working fine, its filter needs to be propagated to fields and 
member types.

Fixed.
Comment 3 David Audel CLA 2002-06-13 05:15:50 EDT
Verified.