[Soot-list] how to get the initial value of sootField

Stefan Willenbrock willenbr at rhrk.uni-kl.de
Sun May 23 19:57:01 EDT 2010


Sorry, lost the Mails of this thread because of an sudden poweroff.

> Hello,
>
> I double-checked real quick. Might get a little off-topic (not regarding soot), please excuse this.
> It seems that (at least in the rt.jar) only final fields have "ConstantValueInfo" tags, e.g., java.lang.Math.E
> Strangely enough, non-static "private final" fields may also have them (no, the compiler does *not* set the "static" flag for them) - in contrast to the Java Class File specification, see my previous post. Example: java.io.Writer.bufferSize. I obtained this by reading in the rt.jar versions 1.6.0_18 and 1.6.0_20 - maybe it should be filed as a bug with sun/oracle?
> Note, again, I am not sure about the behavior of soot in this matter, I performed my quick tests with the ASM framework.
>
> Regards,
> Tobias

I looked into your example real quick and found out that 
"ConstantValueInfo"s for "private final" fields are allowed but have to 
be ignored by the VM according the spec.

This is not a problem because <init> in java.io.Writer initialises the 
field to 1024.

Maybe this is just an addition that doesn't hurt.

Regards, Stefan


More information about the Soot-list mailing list