Summary: | [1.5] Raw bindings miss type arguments but sometimes have type parameters | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | eclipse, philippe_mulet | ||||||
Version: | 3.2 | ||||||||
Target Milestone: | 3.2 RC2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Markus Keller
2005-09-27 10:01:40 EDT
Is this still an issue ? Yes, has not been changed in HEAD compared to I20050923-1000. getTypeParameters() and getTypeArguments() should return an empty array in this case. I willa adjust the specifications of getTypeArguments() and fix the implementation of getTypeParameters(). Patch to follow. Philippe, +1 for RC2? Created attachment 39293 [details]
Proposed fix
Created attachment 39294 [details]
Regression test
+1 for 3.2-RC2, assuming JDT/UI is ok with the change. Added org.eclipse.jdt.core.tests.dom.ASTConverter15Test.test0217. An empty array is returned in all cases described in comment 0. Fixed and released in HEAD. I'm OK with the code change for getTypeParameters() (unless we get test failures in the N-build, but I don't think we will ...). However, I think the original API of ITypeBindings#getTypeArguments() would have been quite useful if it worked. E.g. here: class Generic<E extends List<String>> { } class User { Generic raw; } , I currently see no way to get at the type argument for E from the raw binding (a raw List here). Verified with I20060427-1600 for RC2. Markus, Why not using getTypeDeclaration() on the raw type binding. getTypeDeclaration() returns a generic binding, from which I can get the type parameters, but not the type arguments of the raw binding. Since getErasure() on the individual type parameters also doesn't return raw types, I don't think there's currently a way to solve the puzzler in comment 7. |