Bug 128169

Summary: [codeassist] Type parameter name of method declaration proposal must not create conflit
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: David Audel <david_audel>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2006-02-16 04:46:05 EST
From bug 98532 comment 10

-------------------------------
class X<T> implements List<T> {
  toArra|
}
-------------------------------

"public <T> T[] toArray(T[] a)" shouldn't be proposed because enclosing type already define a type parameter T. "public <U> U[] toArray(U[] a)" should be proposed instead.
Comment 1 David Audel CLA 2006-02-22 10:15:46 EST
Fixed and test added
  CompletionTests_1_5#test0266() -> test0268()

Now, if there is a conflict between a method type parameter and another enclosing type then the name of the type parameter is changed.
If the name has only one character, the next letter is proposed instead (eg. T -> U).
Otherwise a number is added at the end (eg. TypeParameter -> TypeParameter2).

JDT/Text doesn't use the completion proposed by JDT/Core and has the same bug. I open a new bug for this problem (bug 128980)
Comment 2 Olivier Thomann CLA 2006-03-28 10:13:54 EST
Verified using I20060328-0010 for 3.2M6