A bug about the class hierarchy
I use Wala to construct a call graph via CHA algorithm, but the call graph is empty (without nodes and edges). After an investgation, I find it may be caused by an incomplete class hierarchy.
Input file
The jar file is from Maven: https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp/4.11.0
Wala setup
AnalysisScope scope = AnalysisScopeReader.instance.makeJavaBinaryAnalysisScope("Path/to/jar", walaExclusionFile);
scope.addToScope(javaScope); // JDK jar
IClassHierarchy hierarchy = ClassHierarchyFactory.makeWithRoot(scope);
Iterable<Entrypoint> entryPoints = generateEntryPoints(hierarchy); // We involve many entry methods in this library, but the generateEntryPoints is too long to show here
AnalysisOptions options = new AnalysisOptions(scope, entryPoints);
CallGraph cg = new CHACallGraph(hierarchy);
try {
((CHACallGraph) cg).init(entryPoints);
} catch (CancelException e) {
throw new RuntimeException(e);
}
How to reproduce
Analyze the jar file with the setup above.
Expected behavior
Finish analysis with correct graph.
Stacktrace
There is no exception, but the hierarchy didn't contain any class in the jar to be analyzed. See the figuare below, I debugged the program, but found no ok-http related classes in the hierarchy.
@kitty-1998 I'm really sorry for my slow response here. If this is still an issue for you, can you confirm that with your same driver code you are able to successfully construct a CHA call graph for other jar files? In other words, is this an issue specifically with the okhttp jar? Thanks and sorry again for the delay.