[Soot-list] Class resolving with Soot

Bernhard Berger berber at tzi.de
Fri Jan 4 06:39:18 EST 2013


Hi,

if you look into the source of SootResolver you will find that SootResolver.resolveClass calls SootResolver.makeClassRef. There the scene is asked whether it contains the class.If it is not in the scene it creates a new SootClass with level DANGLING and adds it to the scene. Afterwards, somewhere in SootResolver.processResolvingList soot tries to bring it to another level but fails and throws the exception. The second time you call the method Soot is able to find the dangling SootClass and returns it.

Regards,

Bernhard


Am 04.01.2013 um 12:20 schrieb Yi Lin <qinsoon at gmail.com>:

> Hi Eric,
> 
> Yes, on the second call, I can get a SootClass object with the class 
> name (e.g. "String"), but with empty package name, no methods, etc. I 
> assume the class resolving still fails, however, these information 
> cannot definitely tell that the class resolving fails. I would expect 
> that the second call could raise the same exception as the first call so 
> that I can know that the class is still not found. Is there any other 
> class resolving APIs that I can try with?
> 
> Thank you very much.
> 
> Regards,
> Yi
> 
> On 4/01/13 21:58 , Eric Bodden wrote:
>> Hi Yi.
>> 
>> What happens on the second call? Do you actually get a SootClass object?
>> 
>> Eric
>> 
>> On 4 January 2013 03:15, Yi Lin <qinsoon at gmail.com> wrote:
>>> Hi all,
>>> 
>>> I am trying to use either Scene.v().forceResolve() or
>>> SootResolver.v().resolveClass().
>>> 
>>> However, if I give a wrong class name, e.g. "String" instead of
>>> "java.lang.String", calling either of the methods above would cause a
>>> runtime exception saying "couldn't find class: String". However, next
>>> time when forceResolve() or resolveClass() is called with "String" in
>>> the same run, no exception is raised. So in this case, is it possible
>>> for me to tell that the resolving fails?
>>> 
>>> Regards,
>>> Yi
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> 
>> 
> 
> _______________________________________________
> 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