You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to add JUnit4 entrypoint support #669 ,I failed to build call graph for the java class without main method. I'm not sure how to make call graph in a directory across multiple files #648 and analyze the source file(.java) dir of java programs #573.
How can we define our own entry point for JUnit4,and how to do across files analysis?
This is my code:
scope = new JavaSourceAnalysisScope(); scope.addSourceFileToScope(JavaSourceAnalysisScope.SOURCE,new File(path),".java");
scope.addClassFileToScope(ClassLoaderReference.Application,new File(path));
scope.addToScope(ClassLoaderReference.Application,new SourceDirectoryTreeModule(new File(path));
cha = ClassHierarchyFactory.make(scope,new ECJClassLoaderFactory(scope.getExclusions()));
And this is the error.
Class Hierarchy construction failed
com.ibm.wala.ipa.cha.ClassHierarchyException: failed to load root <Primordial,Ljava/lang/Object> of class hierarchy
com.ibm.wala.ipa.cha.ClassHierarchyException: failed to load root <Primordial,Ljava/lang/Object> of class hierarchy
at com.ibm.wala.ipa.cha.ClassHierarchy.(ClassHierarchy.java)
at com.ibm.wala.ipa.cha.ClassHierarchy.(ClassHierarchy.java)
atcom.ibm.wala.ipa.cha.ClassHierarchyFactory.make(ClassHierarchyFactory.java)
atcom.ibm.wala.ipa.cha.ClassHierarchyFactory.make(ClassHierarchyFactory.java)
atcom.ibm.wala.cast.java.client.JavaSourceAnalysisEngine.buildClassHierarchy(JavaSourceAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.defaultCallGraphBuilder(AbstractAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.buildDefaultCallGraph(AbstractAnalysisEngine.java)
java.lang.IllegalArgumentException: cha is null
at com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(Util.java)
atcom.ibm.wala.cast.java.client.JavaSourceAnalysisEngine.makeDefaultEntrypoints(JavaSourceAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.defaultCallGraphBuilder(AbstractAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.buildDefaultCallGraph(AbstractAnalysisEngine.java)
The text was updated successfully, but these errors were encountered:
When I try to add JUnit4 entrypoint support #669 ,I failed to build call graph for the java class without main method. I'm not sure how to make call graph in a directory across multiple files #648 and analyze the source file(.java) dir of java programs #573.
How can we define our own entry point for JUnit4,and how to do across files analysis?
This is my code:
scope = new JavaSourceAnalysisScope(); scope.addSourceFileToScope(JavaSourceAnalysisScope.SOURCE,new File(path),".java");
scope.addClassFileToScope(ClassLoaderReference.Application,new File(path));
scope.addToScope(ClassLoaderReference.Application,new SourceDirectoryTreeModule(new File(path));
cha = ClassHierarchyFactory.make(scope,new ECJClassLoaderFactory(scope.getExclusions()));
Iterable entryPoints = findMethod1();
AnalysisOptions options = new AnalysisOptions(scope, entryPoints);
//options.setEntrypoints(entryPoints);
And this is the error.
Class Hierarchy construction failed
com.ibm.wala.ipa.cha.ClassHierarchyException: failed to load root <Primordial,Ljava/lang/Object> of class hierarchy
com.ibm.wala.ipa.cha.ClassHierarchyException: failed to load root <Primordial,Ljava/lang/Object> of class hierarchy
at com.ibm.wala.ipa.cha.ClassHierarchy.(ClassHierarchy.java)
at com.ibm.wala.ipa.cha.ClassHierarchy.(ClassHierarchy.java)
atcom.ibm.wala.ipa.cha.ClassHierarchyFactory.make(ClassHierarchyFactory.java)
atcom.ibm.wala.ipa.cha.ClassHierarchyFactory.make(ClassHierarchyFactory.java)
atcom.ibm.wala.cast.java.client.JavaSourceAnalysisEngine.buildClassHierarchy(JavaSourceAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.defaultCallGraphBuilder(AbstractAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.buildDefaultCallGraph(AbstractAnalysisEngine.java)
java.lang.IllegalArgumentException: cha is null
at com.ibm.wala.ipa.callgraph.impl.Util.makeMainEntrypoints(Util.java)
atcom.ibm.wala.cast.java.client.JavaSourceAnalysisEngine.makeDefaultEntrypoints(JavaSourceAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.defaultCallGraphBuilder(AbstractAnalysisEngine.java)
atcom.ibm.wala.client.AbstractAnalysisEngine.buildDefaultCallGraph(AbstractAnalysisEngine.java)
The text was updated successfully, but these errors were encountered: