[Soot-list] Recursive Object Initializers

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Tue Jul 23 15:16:45 EDT 2013


Hello everyone,

I need to generate some code to initialize an object tree to non-null
values. The output would have to be in Jimple.

e.g.

class A{ private B b; private int c;}
class B{ private String s;}

I would need to create something like
A.b -> non-null B
A.c -> random int
B.s -> random string

And, of course, I have to be able to handle nearly anything thrown at me.

As a simplification, I'd need a solution that only has concrete types
and no subtypes to bother about.

It feels very similar to what object mocking and dependency injection
does, but only that I need it very static.

I was wondering if anybody on the list ever implemented that. If so, do
you have some readymade code to share?

Thanks and regards,

P.S. what is the behavior of Class.forName modeled by Soot and Spark on
that kind of stuff?

-- 
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate


More information about the Soot-list mailing list