Bug 128169 - [codeassist] Type parameter name of method declaration proposal must not create conflit
Summary: [codeassist] Type parameter name of method declaration proposal must not crea...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M6   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 04:46 EST by David Audel CLA
Modified: 2006-03-28 10:13 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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