Bug 64310 - [1.5][model] Signature implementation does not fully support generic parameterized type names
Summary: [1.5][model] Signature implementation does not fully support generic paramete...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-27 08:01 EDT by Philipe Mulet CLA
Modified: 2004-12-14 13:24 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 Philipe Mulet CLA 2004-05-27 08:01:44 EDT
Build 3.0M9

Implementation of Signature uses in various places: 
   CharOperation.lastIndexOf(C_DOT, name);

For these, if the name is a parameterized type name, it will get fooled by type 
arguments; e.g. "p.X<q.Y>" (last dot is inside type argument)
Comment 1 Jim des Rivieres CLA 2004-05-27 14:26:44 EDT
The methods that use CharOperation.lastIndexOf(C_DOT, name) are getSimpleName
(s) and getQualifier, which are spec'd to take type *names* as opposed to type 
*signatures*. So the implementation of these methods is fine.

However, that begs the question of how does one decode type signatures 
involving parameterized types. The API is missing certain essential methods 
that a client would need.
Comment 2 Jim des Rivieres CLA 2004-05-27 17:14:34 EDT
The missing functionality includes:
for type variable signature
- obtain type variable name (a string)
for class type signatures
- obtain simple name (a string)
- obtain optional qualifier (as a type signature)
- obtain optional type arguments (as list of a type argument signatures)
for type argument signatures
- obtain optional type signature
- obtain wildcard kind: ?, +, -

This could be done with 6 more static methods on Signature. But the API is 
starting to get very overloaded (deal with type signatures, methods 
signatures, formal type paramter signatures, as well as names, and now type 
argument signatures).
Comment 3 Philipe Mulet CLA 2004-05-28 12:52:00 EDT
Old support need to be replaced. Will release improvement in 1.5 stream only. 
Still need some tuning to handle member parameterized types.
Comment 4 Philipe Mulet CLA 2004-05-28 12:54:38 EDT
Previous comment was destinated to bug 64336. 
This one is a companion to it, and is rescheduled post 3.0 as well, will 
address it in 1.5 stream.
Comment 5 Philipe Mulet CLA 2004-06-25 09:25:04 EDT
- upgraded #getSimpleName(...)
- added #createTypeParameterSignature(...)
- upgraded #getReturnType(...) (was incorrectly assuming '^' for exceptions)
- added #getThrownExceptionTypes(...)
- added #getTypeParameters(...) for either method or type generic signature

Comment 6 Jerome Lanneluc CLA 2004-08-20 06:47:14 EDT
- upgraded toSring(...) and toCharArray(...) to support wildcards (bound and 
unbound)
Comment 7 Jerome Lanneluc CLA 2004-08-20 09:14:04 EDT
- upgraded getQualifier(...) to support parameterized types
Comment 8 Jerome Lanneluc CLA 2004-08-20 10:01:52 EDT
- upgraded getSimpleNames(...) to support parameterized types
Comment 9 Jerome Lanneluc CLA 2004-08-23 10:47:54 EDT
- added getTypeErasure(...) and getTypeArguments(...)
Comment 10 Jerome Lanneluc CLA 2004-11-10 11:40:02 EST
From the previous comments, signature now supports generic types.
Fixed.
Comment 11 Frederic Fusier CLA 2004-12-14 13:21:19 EST
Verified for 3.1 M4 using build I200412140800.