[Soot-list] constructors with field defaults?

mbatch at cs.mcgill.ca mbatch at cs.mcgill.ca
Tue Apr 11 19:24:10 EDT 2006


Greg,

Eric is correct as far as I know but it would be trivial to write a
transformer to add explicit assignments into each constructor you come
across.

Michael

On Tue, April 11, 2006 6:34 pm, Eric Bodden wrote:
> Hi, Greg.
>
>
> I don't think so, because those assignments in fact do not exist in the
> bytecode. The VM rather assumes fields to have those values *implicitly*
> unless anything else is assigned.
>
> Eric
>
>
>> -----Original Message-----
>> From: soot-list-bounces at sable.mcgill.ca
>> [mailto:soot-list-bounces at sable.mcgill.ca] On Behalf Of Greg Dennis
>> Sent: Tuesday, April 11, 2006 1:14 PM
>> To: soot-list at sable.mcgill.ca
>> Subject: [Soot-list] constructors with field defaults?
>>
>>
>> Is there an option that will force soot to output
>> constructors that explicitly assign the default values to all fields that
>> are not assigned in the source code?
>>
>> For example, given the following class and constructor
>>
>>
>> class C { T x, y;
>> int i; boolean b;
>>
>> C(T x) {
>> this.x = x; }
>> }
>>
>>
>> I would like the soot output to look as if the constructor
>> were written as follows
>>
>> C(T x) {
>> this.x = x; this.y = null; this.i = 0; this.b = false; }
>>
>>
>> Is there an option that causes soot to create these explicit
>> assignments of the default values to fields?
>>
>> Thanks,
>> Greg
>> _______________________________________________
>> 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