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

Eric Bodden eric.bodden at ec-spride.de
Sun Jun 24 07:39:17 EDT 2012


Hi Tanmay.

Would it be possible for you to prepare a minimal test case (in the
form of a .java file) and send that to me along with the exact command
line that I can use to reproduce this error? Given that info,
hopefully we should be able to fix this quickly.

Eric

On 23 June 2012 17:25, Tanmay Mogra <tanmaym at iitk.ac.in> wrote:
> 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> 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
>
>



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list