[Soot-list] What is the difference between getMethod() and getMethodRef()?

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Fri Jan 25 17:03:44 EST 2013


Hello,

I have been plagued with weird exceptions like this:

Exception in thread "main" 
soot.SootMethodRefImpl$ClassResolutionFailedException: Class 
javax.servlet.ServletContext doesn't have method getContextPath([]) : 
java.lang.String; failed to resolve in superclasses and 
interfacesLooking in javax.servlet.ServletContext which has methods 
[<javax.servlet.ServletContext: javax.servlet.ServletContext 
getContext(java.lang.String)>, <javax.servlet.ServletContext: int 
...<javax.servlet.ServletContext: javax.servlet.Servlet 
getServlet(java.lang.String)>, <javax.servlet.ServletContext: 
java.util.Enumeration getServlets()>, <javax.servlet.ServletContext: 
java.util.Enumeration getServletNames()>,
...
<javax.servlet.ServletContext: void 
log(java.lang.String,java.lang.Throwable)>, 
<javax.servlet.ServletContext: java.lang.String 
getRealPath(java.lang.String)>, <javax.servlet.ServletContext: 
java.lang.String getServerInfo()>, <javax.servlet.ServletContext: 
...<java.lang.Object: void wait()>, <java.lang.Object: void finalize()>, 
<java.lang.Object: void <clinit>()>]

	at soot.SootMethodRefImpl.resolve(SootMethodRefImpl.java:179)
	at soot.SootMethodRefImpl.resolve(SootMethodRefImpl.java:105)
	at 
soot.jimple.internal.AbstractInvokeExpr.getMethod(AbstractInvokeExpr.java:54)
	at ...

It happens if I have something like this: 
((DefinitionStmt)u).getInvokeExpr().getMethod()...

However, changing it to getMethodRef() won't break - why??? (Sidenote: I 
am running without exclusions)

Regards,

-- 
Marc-André Laverdière-Papineau
Doctorant - PhD Candidate


More information about the Soot-list mailing list