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

Tanmay Mogra tanmaym at iitk.ac.in
Sat Jun 23 11:25:55 EDT 2012


Hi Eric,

Thank you for the quick response and suggestion.
I'll make do with the byte code as of now. But I might need the source.
Can you think of any immediate possible solutions with fixing the code, 
that may be easy for me to fix?

Thanks
Tanmay

On 22-06-2012 11:14, Eric Bodden wrote:
>
> 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 
> <mailto: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/20120623/9d6b2a57/attachment.html 


More information about the Soot-list mailing list