[Soot-list] ThrowableSet.catchableAs()

Eric Bodden eric.bodden at mail.mcgill.ca
Tue Mar 18 09:07:18 EDT 2008


Hi, Irem.

>  Exception in thread "main" java.lang.RuntimeException: This operation
>  requires resolving level HIERARCHY but
>  java.lang.UnsupportedClassVersionError is at resolving level DANGLING
>         at soot.SootClass.checkLevel(SootClass.java:121)
>         at soot.FastHierarchy.canStoreClass(FastHierarchy.java:269)
>         at soot.FastHierarchy.canStoreType(FastHierarchy.java:204)
>         at
>  soot.toolkits.exceptions.ThrowableSet.catchableAs(ThrowableSet.java:904)
>  ----------------
>
>  Does anyone know what I am doing wrong?

To determine whether UnsupportedClassVersionError is of one of the
types you care about (or a subtype thereof), it needs hierarchy
information about the class. However, by default Soot won't construct
this information for all classes, unless you are in whole-program mode
or you explicitly tell Soot to do so.

Try to do this right at the beginning of your code, ideally before
calling soot.Main.main(..):

Scene.v().addBasicClass("java.lang.UnsupportedClassVersionError",SootClass.SIGNATURES);

This will advise Soot to resolve this class to the SIGNATURES level
when it's loaded.

Eric

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list