[Soot-list] Class Hierarchy Analysis causes NullPointerException

Daniel Popescu dpopescu at usc.edu
Fri Dec 11 00:16:47 EST 2009


Hi all.

I am trying to analyze some Java legacy systems using the Soot Eclipse
plugin. I have been running into some problems and I hope somebody on
the list can help me.

I have been trying to create a call graph of my application using the
Class Hierarchy Analysis. Whenever I am analyzing the Java files of my
application, the JastAdd frontent is reporting a semantic error:
"Semantic Error: annotation is not applicable to this kind of
declaration". The Eclipse JDT parser and the JDK are able to parse
these annotations.

Since parsing the source code did not work for me, I was trying to
analyze the bytecode of the classes. This bytecode-based analysis
caused a NullPointerException in a different file.

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at ca.mcgill.sable.soot.launching.SootThread.run(SootThread.java:138)
Caused by: java.lang.NullPointerException
	at soot.jimple.toolkits.callgraph.Edge.hashCode(Edge.java:109)
	at java.util.HashMap.put(HashMap.java:372)
	at java.util.HashSet.add(HashSet.java:200)
	at soot.jimple.toolkits.callgraph.CallGraph.addEdge(CallGraph.java:43)
	at soot.jimple.toolkits.callgraph.ContextInsensitiveContextManager.addVirtualEdge(ContextInsensitiveContextManager.java:39)
	at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.addType(OnFlyCallGraphBuilder.java:111)
	at soot.jimple.toolkits.callgraph.CallGraphBuilder.build(CallGraphBuilder.java:94)
	at soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:43)
	at soot.SceneTransformer.transform(SceneTransformer.java:39)

How could I prevent this NullPointerException?

I have also noticed that Soot creates the call graph from classes that
I would like to ignore (e.g. sun.net.spi.DefaultProxySelector )
although the non-application mode is selected. I would have thought
that only the files of the project and the process directory would be
analyzed. My assumption seems to be wrong. How can I set classes as
library classes in the non-application mode?

I appreciate your help.
Daniel


More information about the Soot-list mailing list