[Soot-list] Recursive Object Initializers

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Tue Jul 23 19:20:04 EDT 2013


Hello,

If I have a guarantee of having a no-argument constructor, then I could reuse some of the rootbeer code? Or at least adapt it to my needs? Please tell me where it is in your repo!

Phil Pratt-Szeliga <pcpratts at trifort.org> wrote:

>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