I am using Soot in order to be able to use its call graph but unfortunately I am having trouble with constructors.

I think this is best explained with an answer so here goes:

Consider a class CachingCollector$NoScoreCachingLeafCollector where NoScoreCachingLeafCollector extends FilterLeafCollector.

I want to get the constructor of such class whereby its parameter types are: LeafCollector and int.

For some reason Soot says that there is a constructor with those parameters BUT the first parameter is CachingCollector.

I cannot understand what is happening and I've been trying for a few hours now to no avail. What is confusing me even more is that there are some inner classes which extend some class but the Soot does not add that extra parameter in the beginning.

Any help would be greatly appreciated!!

有帮助吗?

解决方案

Such questions are most quickly answered on the Soot mailing list.

To answer your question: Soot simply shows you what the bytecode actually looks like. The class you are talking about is an inner class. Constructors to such classes are automatically passed a "this" reference to the outer class, such that this outer object can be accessed from within the inner class. That is what Soot shows you.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top