Community
Participate
Working Groups
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)
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.
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).
Old support need to be replaced. Will release improvement in 1.5 stream only. Still need some tuning to handle member parameterized types.
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.
- upgraded #getSimpleName(...) - added #createTypeParameterSignature(...) - upgraded #getReturnType(...) (was incorrectly assuming '^' for exceptions) - added #getThrownExceptionTypes(...) - added #getTypeParameters(...) for either method or type generic signature
- upgraded toSring(...) and toCharArray(...) to support wildcards (bound and unbound)
- upgraded getQualifier(...) to support parameterized types
- upgraded getSimpleNames(...) to support parameterized types
- added getTypeErasure(...) and getTypeArguments(...)
From the previous comments, signature now supports generic types. Fixed.
Verified for 3.1 M4 using build I200412140800.