|
|
Re: IType.getMethod and signature from bytecode [message #650933 is a reply to message #650906] |
Thu, 27 January 2011 08:45 |
Michal Borek Messages: 25 Registered: August 2010 |
Junior Member |
|
|
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 08:45] Report message to a moderator
|
|
|
|
Re: IType.getMethod and signature from bytecode [message #653171 is a reply to message #650831] |
Tue, 08 February 2011 18:09 |
|
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
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.02876 seconds