[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Phantom classes and analysis
On Wed, 22 Jan 2003, Eric Bodden wrote:
> JimpleBody body = (JimpleBody) method.retrieveActiveBody();
> to get the body of the methods and then the line numbers of the single
> units. So far ok. But now I have the problem, that when I do not include
> the JRE into my classpath ("%javahome%\lib\rt.jar" to be precise), then
> Soot crashes with an exception telling me that java.lang.Cloneable could
> not be found. I mean: Of course it could not be found. But why is Soot
> actually trying to resolve that deeply? I thought java.lang.Cloneable
> would just be made a phantom class and then this would be ok. But it is
> _not_ resolved as phantom class and so cannot be found. Why?
Things don't really work right if Cloneable isn't found; I'm sure that one
of your classes implements Cloneable. If we don't have a SootClass for
java.lang.Cloneable, type inference usually won't work. We don't like not
having type inference, so we don't allow phantom refs to be arbitrarily
created.
If you do what Feng said and hardcode allowPhantomRefs to true, then your
classes should jimplify, but you won't get great things out of it.
pat