[Soot-list] SOOT getMethodbyName() problem

Phil Pratt-Szeliga pcpratts at trifort.org
Mon Apr 15 08:57:58 EDT 2013


Hello All,

Also, you have to search up the declared methods to find the method in
java.lang.reflect.AccessibleObject. I have attached an example.

Sincerely,
Phil Pratt-Szeliga
Syracuse University
http://trifort.org/


On Mon, Apr 15, 2013 at 5:16 AM, Quentin Sabah <quentin.sabah at inria.fr> wrote:
> Hi Abdejalil, I post my response to the mailing list since it might help
> other users in the future.
>
> On 04/15/2013 10:56 AM, Abdejalil SETH wrote:
>> Hi Quentin,
>>
>> thank you for your response, I try to use :
>> java.lang.reflect.AccessibleObject or java.lang.reflect.FIield
>>
>> this is my code :
>>
>>     I try to analyze the CallGraph :
>>
>>
>>     CallGraphExample : http://pastebin.com/43sq3fnz
>>
>>     FieldAccessible.java : http://pastebin.com/nEzZAAzV
>>
>>
>>     OUTPUT :
>>
>>     Exception in thread "main" java.lang.RuntimeException: ambiguous method
>>
>
> Here Soot tells you that there is more than one method corresponding to
> the name you are looking for ("ambiguous method"). If you take a look at
> java.lang.reflect.AccessibleObject, you will indeed observe the
> setAccessible method is overloaded. In this case, you have to
> disambiguate your query, by using one of the SootClass.getMethod(..)
> variants.
>
> I suggest you use getMethod(String name, List parameterTypes), you just
> have to provide a list of Soot.Type, like:
>
>     List parameterTypes = new ArrayList();
>     parameterTypes.add(Soot.BooleanType.v());
>     ... = ...getMethod("setAccessible", parameterTypes);
>
> Regards.
>
> --
> Quentin Sabah, CIFRE Ph.D. student
> Grenoble University
> INRIA-SPADES                   | STMicroelectronics/AST
> Montbonnot, France             | Grenoble, France
> mailto:quentin.sabah at inria.fr  | mailto:quentin.sabah at st.com
> phone: +33 476 61 54 57        | phone: +33 476 58 44 14
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CallGraphExample.java
Type: application/octet-stream
Size: 1723 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130415/c72f5a5a/attachment.obj 


More information about the Soot-list mailing list