[Soot-list] using DeclaresMethod in SootClass

Jennifer Lhotak jlhotak at cs.mcgill.ca
Tue Jan 24 15:30:05 EST 2006


Well one thing you could do is get a list of the methods using
the methods method and then iterate through the list and check the
parameter types against the parameter types you are looking for.
To do that you can use the FastHierarchy class which makes a hierarchy
of the classes in the Scene and the method
canStoreType to find the supertype relations.

It might be ineffiecient... but I think it would work.

Jennifer

On Tue, Jan 24, 2006 at 01:30:23PM -0500, Nomair A. Naeem wrote:
> Hey Guys,
>    A question for the Soot gurus:
> 
> Suppose a SootClass declares a method
>        foo(List)
> 
> Now I need to be able to check whether it declares a Method
>       foo(ArrayList)
> 
> The declaresMethod method should return true in the case the
> SootClass declares a method where the paramtypes are super types of the
> types i am trying to match e.g. ArrayList is a subType of List.
> 
> How do i do this.
> 
> An attempt was as follows:
>     List argList = new ArrayList();
>     argList.add(RefType.v("java.util.ArrayList");
> 
>    testSootClass.declaresMethod("foo",argList);
> 
> The declaresMethod returns false.
> 
> Any suggestions.
> 
> Nomair
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list


More information about the Soot-list mailing list