Skip to main content



      Home
Home » Language IDEs » PHP Development Tools (PDT) » IType.getMethod and signature from bytecode
IType.getMethod and signature from bytecode [message #650831] Wed, 26 January 2011 13:11 Go to next message
Eclipse UserFriend
Hello,
I've got a problem with getMethod() method of IType

I have a signature of specific method from bytecode.

For example:
(Ljava.lang.Integer;Ljava.lang.Integer)I

I want to use it in in
IType.getMethod(String methodName, String[] signatureParameters);

Eclipse doesn't recognize a type, but parameter that is in source code (e.g. java.lang.String != String)

Is there a way to get method if I don't know how developer wrote the type?

Thanks in advance!


Re: IType.getMethod and signature from bytecode [message #650906 is a reply to message #650831] Thu, 27 January 2011 01:55 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I do not understand you,can you explain more,thanks!
Re: IType.getMethod and signature from bytecode [message #650933 is a reply to message #650906] Thu, 27 January 2011 03:45 Go to previous messageGo to next message
Eclipse UserFriend
I analyze bytecode of java and I have method descriptor

for example:
method name: add
method descriptor (Ljava.lang.Integer;Ljava.lang.Integer)Ljava.lang.Integer;

it can be read as: Integer add (Integer , Integer)

I want to add a marker in a line there method signature is in source code

for example:
-> public Integer add(java.lang.Integer a, Integer b) {

}


where -> is a marker I want to add.

IType interface defines IMethod getMethod(String methodName, String[] signatureParameters);

but signatureParameters are not these from bytecode (e.g. Ljava.lang.Integer) but for example QInteger or Qjava.lang.Integer (depends on how it's defined in source code)

for "a" and "b" parameters in my example above it would be Qjava.lang.Integer; and QInteger; respectively.

My question is:
Is there a way to convert values from bytecode or somehow find particular method having only bytecode (always fully-qualified) parameter names.
for "b".

The best solution would be:
myClass.getMethod("add", new String[] {"Ljava.lang.Integer;", "Ljava.lang.Integer;"}); 


but it doesn't work (It needs Eclipse specific signatures).

If it's not clear please tell me what should I describe in detail.

[Updated on: Thu, 27 January 2011 03:45] by Moderator

Re: IType.getMethod and signature from bytecode [message #650956 is a reply to message #650933] Thu, 27 January 2011 05:04 Go to previous messageGo to next message
Eclipse UserFriend
finally,I got what do you mean,I think you should post it on JDT instead of PDT
Re: IType.getMethod and signature from bytecode [message #653171 is a reply to message #650831] Tue, 08 February 2011 13:09 Go to previous message
Eclipse UserFriend
On 1/26/2011 1:11 PM, emPl wrote:
> Hello,
> I've got a problem with getMethod() method of IType
> I have a signature of specific method from bytecode.
>
> For example:
> (Ljava.lang.Integer;Ljava.lang.Integer)I

You might want the JDT newsgroup instead of the PDT newsgroup.

--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational
Previous Topic:Strange Errormarking
Next Topic:Code hint for javascript files. js
Goto Forum:
  


Current Time: Tue Jul 22 18:13:13 EDT 2025

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

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

Back to the top