Bug 123225

Summary: Code assist suggests overridden method
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix none

Description Martin Aeschlimann CLA 2006-01-10 05:57:04 EST
20060110

The example in bug 111350 shows that NumericArray:add overrides Array:add

- Do a code assist in A, you get 2 proposals add(Integer), add(Number)
- I think only add(Number) should be shown. add(Integer) is not available here


package p;

public class A {
	public static void main(String[] args) {
		new NumericArray<Integer>().|code assist
	}
}

class Array<T> {
	public void add(T t){
		System.out.println("Array<T>:add");
	}
}

class NumericArray<T extends Number> extends Array<T> {
	@Override
	public void add(Number n){
		System.out.println("NumericArray<T>:add");
	}
}
Comment 1 David Audel CLA 2006-09-25 04:13:54 EDT
Created attachment 50786 [details]
Proposed fix
Comment 2 David Audel CLA 2006-09-25 04:19:37 EDT
Released for 3.3 M3.

Tests added
  CompletionTests_1_5#test0291() -> test0293()
Comment 3 Frederic Fusier CLA 2006-10-30 11:56:30 EST
Verified for 3.3 M3 using warm-up build I20061030-0010.