[Soot-list] SootClass.getMethod

Eugen Zalinescu eugen.zalinescu at gmail.com
Thu Nov 26 10:04:22 EST 2015


Hello,

I have the following code:

        SootClass c = Scene.v().getSootClass("java.io.PrintWriter");
        SootMethod m = c.getMethodByName("close");
        String name = "<java.io.PrintWriter: void close()>";
        assert(m.getSignature().equals(name));
        Scene.v().getMethod(name);
        c.getMethod(name);

which fails on the last line with:

Exception in thread "main" java.lang.RuntimeException: No method
<java.io.PrintWriter: void close()> in class java.io.PrintWriter
    at soot.SootClass.getMethod(SootClass.java:297)
    at soot.SootClass.getMethod(SootClass.java:321)
    at org.tcs.Main.main(Main.java:368)

Could someone please explain to me why the calls to
'c.getMethodByName' and 'Scene.v().getMethod' succeed, while the call
to 'c.getMethod' fails? Is this a bug or should I have prepared the
class in some way beforehand?

Thanks,
Eugen


More information about the Soot-list mailing list