[Soot-list] Soot: Class Resolution Exception for Generics
Tanmay Mogra
tanmaym at iitk.ac.in
Thu Jun 21 18:23:47 EDT 2012
Hi,
Soot creates the following exception while creating this object vbox_A
of class 'jvstm.VBox'
VBox<A> vbox_A = new VBox<A>(new A(0,0,0), "A");
----------------------------------------------------
........
Caused by: soot.SootMethodRefImpl$ClassResolutionFailedException: Class
jvstm.VBox doesn't have method <init>([test.A, java.lang.String]) :
void; failed to resolve in superclasses and interfacesLooking in
jvstm.VBox which has methods [<jvstm.VBox: void <init>()>, <jvstm.VBox:
void <init>(java.lang.Object,java.lang.String)>, <jvstm.VBox: void
<init>(jvstm.VBoxBody)>, <jvstm.VBox: java.lang.Object get()>,
<jvstm.VBox: void put(java.lang.Object)>, <jvstm.VBox: jvstm.VBoxBody
commit(java.lang.Object,int)>, <jvstm.VBox: jvstm.VBoxBody
makeNewBody(java.lang.Object,int,jvstm.VBoxBody)>]
.........
-----------------------------------------------------
The class 'jvstm.VBox' looks like this:
public class VBox<E> {
/*Code*/
public VBox(E initial, String s) { //This is the constructor
/*Code*/
}
/*Code*/
}
I see that Soot changes this constructor which uses a generic(E) class
to constructor using an Object class as evident in "<jvstm.VBox: void
<init>(java.lang.Object,java.lang.String)>". So it raises an error when
some particular class is passed to the constructor (in my case: test.A).
Is there any workaround ? Can this exception be ignored somehow ?
Thanks
Tanmay Mogra
IIT Kanpur
More information about the Soot-list
mailing list