Bug 19917

Summary: Code Assist incorrect for hidden interface fields
Product: [Eclipse Project] JDT Reporter: Peter Burka <peter_burka>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.0 F3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.