[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading single class



loadClassAndSupport *is* the way to load a single class. It loads the
class, and all the other information it needs to make sense of the
class. For example, if the class you load refers to fields of another
class, those fields must be created in order for Soot to be able to
refer to them. Also, the relevant parts of the type hierarchy must
be available in order for Soot to be able to assign types to variables.

Note that loadClassAndSupport does *not* actually load all the code for
the support classes; it only constructs the Soot objects required to
refer to the support classes and their fields and methods.

One workaround is to just make only the class you're interested in
available on the classpath. This causes Soot to invent "phantom"
classes, which contain only the fields and methods that are referred to.
However, doing this will probably cause the typing algorithm to fail,
since the type hierarchy information will not be available.

Ondrej

On Sat, Jan 18, 2003 at 10:03:37PM -0000, Eric Bodden wrote:
> Hi!
> 
> A short question this time:
> I there any chance of _loading_ a single SootClass from a .class file
> without using Scene.v().loadClassAndSupport() ? I actually want to keep
> the Scene completely out of that...
> 
> Thanks,
> Eric
> 
> ------------------------------------------------------------
> Eric Bodden
> University of Kent at Canterbury
>