[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is this a bug?



Hi,

I was trying to print a SootClass in jimple representation via Printer.printTo() method. However, it balks with an error.

java.lang.RuntimeException: method finalize has no active body!
        at soot.Printer.printTo(Printer.java:195)

Now this line turns out to be the following.


if (!Modifier.isAbstract(method.getModifiers()) && !Modifier.isNative(method.getModifiers())) { if (!method.hasActiveBody()) --> throw new RuntimeException( "method " + method.getName() + " has no active body!"); else printTo(method.getActiveBody(), out);

                        if (methodIt.hasNext()) {
                            out.println();
                            incJimpleLnNum();
                        }
                    }

Now this is strange. In jimple, one can load and release a method's body on a need basis. If so, why is it assumed that the concrete method will have an active body? Instead shouldn't the printer load the method body, print it, and release the method body?

Or am I missing something?

waiting for reply,

--

Venkatesh Prasad Ranganath,
Dept. Computing and Information Science,
Kansas State University, US.
web: http://www.cis.ksu.edu/~rvprasad