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

RE: Phantom classes and analysis



> 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.

But when all I want just is getting some line numbers I think resolving
down through the whole JRE is really a little bit overkill! Of course
some classes are implementing Clonable. But I think for providing a
static analysis just on the source files I provide, it must be possible
somehow, to prevent soot from tying to resolve these (not loaded)
classes and maybe instead create empty phantom classes or am I wrong?

> 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.
I already had that set. That did not change anything at all. I always
get...

Exception in thread "main" java.lang.RuntimeException:
Aborting: can't find classfilejava.lang.Cloneable
        at soot.Scene.getSootClass(Scene.java:386)
        at soot.RefType.getSootClass(RefType.java:95)
        at soot.jimple.toolkits.typing.TypeNode.<init>(TypeNode.java:85)
        at
soot.jimple.toolkits.typing.ClassHierarchy$ConstructorChooser.caseRefTyp
e(ClassHierarchy.java:240)
        at soot.RefType.apply(RefType.java:136)
        at
soot.jimple.toolkits.typing.ClassHierarchy$ConstructorChooser.typeNode(C
lassHierarchy.java:233)
        at
soot.jimple.toolkits.typing.ClassHierarchy.typeNode(ClassHierarchy.java:
129)
        at
soot.jimple.toolkits.typing.ClassHierarchy.<init>(ClassHierarchy.java:84
)
        at
soot.jimple.toolkits.typing.ClassHierarchy.classHierarchy(ClassHierarchy
.java:107)
        at
soot.jimple.toolkits.typing.TypeResolver.<init>(TypeResolver.java:157)
        at
soot.jimple.toolkits.typing.TypeResolver.resolve(TypeResolver.java:180)
        at
soot.jimple.toolkits.typing.TypeAssigner.internalTransform(TypeAssigner.
java:59)
        at soot.BodyTransformer.transform(BodyTransformer.java:58)
        at soot.BodyTransformer.transform(BodyTransformer.java:80)
        at soot.jimple.JimpleBody.applyPhaseOptions(JimpleBody.java:118)
        at
soot.coffi.CoffiMethodSource.getBody(CoffiMethodSource.java:108)
        at soot.SootMethod.getBodyFromMethodSource(SootMethod.java:89)
        at soot.SootMethod.retrieveActiveBody(SootMethod.java:305)
        at analysis.ToolKit.extractLineNumber(ToolKit.java:106)
        at
analysis.ClassTreeSupplier.setData(ClassTreeSupplier.java:103)
        at
gui.main.MainForm.classComboBoxActionPerformed(MainForm.java:384)
        at gui.main.MainForm.access$200(MainForm.java:49)
        at gui.main.MainForm$3.actionPerformed(MainForm.java:144)
        at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1196)
        at javax.swing.JComboBox.contentsChanged(JComboBox.java:1267)
        at
javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java
:100)
        at
javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.ja
va:88)
        at
javax.swing.DefaultComboBoxModel.addElement(DefaultComboBoxModel.java:12
6)
        at javax.swing.JComboBox.addItem(JComboBox.java:690)
        at gui.main.MainForm.setClassComboBoxItems(MainForm.java:532)
        at
gui.main.MainForm.packageComboBoxActionPerformed(MainForm.java:394)
        at gui.main.MainForm.access$100(MainForm.java:49)
        at gui.main.MainForm$2.actionPerformed(MainForm.java:136)
        at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1196)
        at javax.swing.JComboBox.contentsChanged(JComboBox.java:1267)
        at
javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java
:100)
        at
javax.swing.DefaultComboBoxModel.setSelectedItem(DefaultComboBoxModel.ja
va:88)
        at
javax.swing.DefaultComboBoxModel.addElement(DefaultComboBoxModel.java:12
6)
        at javax.swing.JComboBox.addItem(JComboBox.java:690)
        at gui.main.MainForm.setPackageComboBoxItems(MainForm.java:524)
        at gui.main.MainForm.updateComboBoxes(MainForm.java:508)
        at jpt.main(jpt.java:25)

So do you know what I could change to make Soot behave in the way I
want?

Cheers,
Eric