[Soot-list] Soot: Class Resolution Exception for Generics

Eric Bodden eric.bodden at ec-spride.de
Fri Jun 22 01:44:59 EDT 2012


Hi Tanmay.

Are you parsing source code? As a workaround you could process byte code
instead. Still we should fix this...

Eric
On Jun 22, 2012 12:24 AM, "Tanmay Mogra" <tanmaym at iitk.ac.in> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120622/05412933/attachment.html 


More information about the Soot-list mailing list