Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » IMethod.getParameterTypes() - Source vs Binary method signatures
IMethod.getParameterTypes() - Source vs Binary method signatures [message #1814266] Sat, 07 September 2019 10:40 Go to next message
Alex Mising name is currently offline Alex Mising nameFriend
Messages: 149
Registered: March 2010
Senior Member
Hello,

When I call getParameterTypes() on SOURCE methods, I get signature types where for example "java.lang.String" shows up as "QString".

This does not happen forBINARY methods where this shows up as a regular "java.lang.String".

Is there a way to get this kind of signature for source methods? I would like to always get the behaviour of binary methods (i.e. "java.lang.String")
Re: IMethod.getParameterTypes() - Source vs Binary method signatures [message #1814280 is a reply to message #1814266] Sun, 08 September 2019 14:11 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
For binary methods the fully qualified name comes for free (it's directly found in the byte code).

For source methods the light-weight Java Model does not directly provide this information. You have two options:
- go through ASTParser.createBindings() to obtain the bindings with full resolved type names, or
- try using IType.resolveType(), but you may have to first call Signature.toString(type) to get rid of the "Q...;" part

If you are dealing with many types, then surely the approach using ASTParser.createBindings() performs better, as it can compute many bindings in one go.

HTH

Previous Topic:Type and Method binding not working properly in some cases
Next Topic:Save/restore project settings from team(git) repository
Goto Forum:
  


Current Time: Tue Sep 24 02:32:30 GMT 2024

Powered by FUDForum. Page generated in 0.03243 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top