[Soot-list] Recursive Object Initializers

Phil Pratt-Szeliga pcpratts at trifort.org
Tue Jul 23 15:42:19 EDT 2013


Hello Marc-Andre,

> 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.

The problem you will encounter here most likely is that a random class
B may not have a default constructor. In rootbeer I append a
constructor to every application class that accepts a single parameter
of class type Sentinal. So it is guarenteed that you can call the
constructor easily and it is guarenteed that a similar constructor
does not exist.

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


More information about the Soot-list mailing list