Bytecode method signatures corresponding to a MethodDeclaration node [message #913318] |
Sat, 15 September 2012 08:28 |
Saswat Anand Messages: 1 Registered: September 2012 |
Junior Member |
|
|
Hello,
I am using JDT's ASTParser in combination with a static analysis tool that works only with Java bytecode. To do so, I have to map information extracted using JDT to bytecode level information. Currently, I am stuck with computing bytecode-level method signatures for each method declared in the source code. I found that computing this mapping is straight-forward except in cases like the following.
In the following code, the doInBackground method in the MyTask class corresponds to two methods in the bytecode of MyTask class.
class AsyncTask<Params, Progress, Result> {
abstract protected Result doInBackground(Params... params);
}
class MyTask extends AsyncTask<String, Void, Void> {
protected Void doInBackground(String... params) {
}
}
The signatures of the two methods in bytecode (obtained from javap) are:
protected java.lang.Void doInBackground(java.lang.String[]);
protected java.lang.Object doInBackground(java.lang.Object[]);
Now my question is: Given the org.eclipse.jdt.core.dom.MethodDeclaration node corresponding to doInBackground method in the MyTask class, how can I compute the second signature from above? Specifically, are there JDT API methods that I can use for my purpose? I can compute the first signature.
Thanks so much!
Saswat
ps: I am using JDT's ASTParser totally outside of eclipse in a headless mode.
[Updated on: Sat, 15 September 2012 08:38] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.25906 seconds