Bug 78266 - [dom] [1.5] API of ITypeBinding: no isGenericType() query
Summary: [dom] [1.5] API of ITypeBinding: no isGenericType() query
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All Windows XP
: P3 enhancement (vote)
Target Milestone: 3.1 M4   Edit
Assignee: Jim des Rivieres CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 77360 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-10 03:29 EST by Markus Keller CLA
Modified: 2004-12-14 23:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2004-11-10 03:29:44 EST
I200411090800

Bug 77360 outlines the three possible kinds of type bindings for generic types:
a) generic type
  -> request for new query isGenericType()
b) parameterized type
  -> ITypeBinding#isParameterizedType()
c) raw type
  -> ITypeBinding#isRawType()

Currently, clients do the check for isGenericType() with
'getTypeParameters().length > 0'. For isParameterizedType(), they could also ask
'getTypeArguments().length > 0', but it seem strange that there is an explicit
query in one case but not the other.

The Javadoc of ITypeBinding#getErasure() could then mention that isGenericType()
is true for the returned type binding iff either of the receiver's
isGenericType(), isParameterizedType(), isRawType() was true.
Comment 1 Jim des Rivieres CLA 2004-11-10 11:42:06 EST
Added
   ITypeBinding.isGenericType()
   IMethodBinding.isGenericMethod().
Updated specs for isRawType/Method and isParameterizedType/Method and 
getErasure as suggested.

Updated existing AST converter tests to ensure that both new methods work.

Olivier, ASTConverter15Test.test0038 and test0044 have failures on some of the 
predicates. I'll enter a separate PR to track these.
Comment 2 Jerome Lanneluc CLA 2004-11-24 05:54:50 EST
*** Bug 77360 has been marked as a duplicate of this bug. ***
Comment 3 Olivier Thomann CLA 2004-12-14 23:21:04 EST
Verified in 200412140800