[Soot-list] Question about class resolving

mbatch at cs.mcgill.ca mbatch at cs.mcgill.ca
Tue Feb 7 16:59:37 EST 2006


Hello folks,

I have a simple java test program. Class 'test' subclasses class 'B'.
Class 'B' subclasses class 'A'. Each has an <init> constructor method, so
both test and B call super (and A implicitly calls super on
java.lang.Object).

I wrote a simple SceneTransformer that iterates over all application
classes and prints out (for each method in each class) whether an active
body exists or not.

If I call soot and pass 'test' as the main class:

"soot.MySimpleTransformer -main-class test -w A B test"

Then all methods found have active bodies. However, if I do not specify a
main class ("soot.MySimpleTransformer -w A B test") I get the resulting
error:

Testing SceneTransformer...
	Processing A
<init> has no body
	Processing test
<init> has no body
main has no body
toString has active body
	Processing B
<init> has no body
toString has active body
<clinit> has no body
Transforming A...
Transforming test...
Transforming B...
Writing to sootOutput/A.class
Writing to sootOutput/test.class
Writing to sootOutput/B.class
Soot finished on Tue Feb 07 16:43:28 EST 2006


As you can see there are many methods with no active bodies. Can anybody
explain to me why this would be so? Why would soot resolve some methods
and not others in a classfile based on whether the main class is set or
not? I have attached the java source files.

Michael Batchelder
Sable Research Group
McGill University
Montreal, PQ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A.java
Type: text/x-java
Size: 76 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060207/f853ee4c/A.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: B.java
Type: text/x-java
Size: 143 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060207/f853ee4c/B.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.java
Type: text/x-java
Size: 185 bytes
Desc: not available
Url : http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060207/f853ee4c/test.bin


More information about the Soot-list mailing list