[Soot-list] Determine a field's main class

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Wed Apr 27 12:47:31 EDT 2011


Hi Vasco.

I think in this case you are actually already doing the right thing.
In Java, fields in subclasses shadow fields with equal names in super
classes - both fields exist in memory, and both can be accessed by the
program's code. (This is very different from methods, which have an
overriding semantics.)

Eric

On 26/04/2011, Vasco Pessanha <coreanu_ at hotmail.com> wrote:
>
> Hi,
>
> I am using Soot to collect all the class fields accessed in a program. For
> each one, I keep the main class of the field and its name.
> For instances, "<Pair, x>" refers to the field "x" of class "Pair".
>
> The problem is, if I have an abstract class "A" that has a field "f", and
> another class "B" that extends "A", then I can have accesses to "f" in both
> classes. Therefore, since I am deducing the main class with the class where
> the access is made, we will generate "<A, f>" and "<B, f>" fields, despite
> they are the same.
>
> Can anyone help me to determine which is the main class of a given field
> (JInstanceFieldRef)? In the previous case would be "A"..
>
> Thanks,
>
> Vasco Pessanha
>  		 	   		


-- 
Dr. Eric Bodden, http://bodden.de/
Principal Investigator in Secure Services at CASED
Coordinator of the CASED Advisory Board of Study Affairs
PostDoc at Software Technology Group, Technische Universität Darmstadt
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list