Bug 113945

Summary: No codeassist in anonymous class in generics
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Philipe Mulet CLA 2005-10-27 05:33:55 EDT
Build id: I20051018-0932

No 'compareTo' completion is offered when completing inside the 'compareTo'
message sending expression below.

import java.util.*;
public class X <E,K extends Comparable<K>> {

	E[] source;
	F<E, K> f;
		
void init(){
	final Map<E,K> values = new HashMap<E,K>(this.source.length);
	new Comparator<E>(){
		public int compare(E o1, E o2) {
			return values.get(o1).compareTo(values.get(o2));
		}
	};
}
}
abstract class F<I,O> {
	public abstract O get(I in);
}
Comment 1 Philipe Mulet CLA 2005-10-27 05:36:02 EDT
Also, hovering on the leading receiver (values.get(o1)) reveals that the some
type information got altered. It shows: 'K get(Object)' instead of 'K get(E)'.
Note that this may be a different bug in codeselect.
Comment 2 David Audel CLA 2005-10-27 09:11:30 EDT
the bug described in comment 1 is invalid. The parameter's type of the get
method is declared as Object.
Comment 3 David Audel CLA 2005-11-04 12:17:50 EST
Fixed and tests added
  CompletionTests_1_5#test0261() -> test 0263()
Comment 4 Jerome Lanneluc CLA 2005-12-12 09:37:26 EST
Verified for 3.2 M4 using build I20051212-0010