Package soot
Class SootMethodRefImpl
- java.lang.Object
-
- soot.SootMethodRefImpl
-
- All Implemented Interfaces:
SootMethodInterface,SootMethodRef
- Direct Known Subclasses:
PolymorphicMethodRef
public class SootMethodRefImpl extends Object implements SootMethodRef
Representation of a reference to a method as it appears in a class file. Note that the method directly referred to may not actually exist; the actual target of the reference is determined according to the resolution procedure in the Java Virtual Machine Specification, 2nd ed, section 5.4.3.3.- Author:
- Manuel Benz 22.10.19 - Delegate method resolution behavior to FastHierarchy to have one common place for extension
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSootMethodRefImpl.ClassResolutionFailedException
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.SootMethodRef
isConstructor
-
-
-
-
Constructor Detail
-
SootMethodRefImpl
public SootMethodRefImpl(SootClass declaringClass, String name, List<Type> parameterTypes, Type returnType, boolean isStatic)
Constructor.- Parameters:
declaringClass- the declaring class. Must not benullname- the method name. Must not benullparameterTypes- the types of parameters. May benullreturnType- the type of return value. Must not benullisStatic- the static modifier value- Throws:
IllegalArgumentException- is thrown whendeclaringClass, orname, orreturnTypeis null
-
-
Method Detail
-
declaringClass
public SootClass declaringClass()
Description copied from interface:SootMethodRefUseSootMethodInterface.getDeclaringClass()instead- Specified by:
declaringClassin interfaceSootMethodRef
-
getDeclaringClass
public SootClass getDeclaringClass()
- Specified by:
getDeclaringClassin interfaceSootMethodInterface- Returns:
- The class which declares the current
SootMethod/SootMethodRef
-
name
public String name()
Description copied from interface:SootMethodRefUseSootMethodInterface.getName()instead- Specified by:
namein interfaceSootMethodRef
-
getName
public String getName()
- Specified by:
getNamein interfaceSootMethodInterface- Returns:
- Name of the method
-
parameterTypes
public List<Type> parameterTypes()
Description copied from interface:SootMethodRefUseSootMethodInterface.getParameterTypes()instead- Specified by:
parameterTypesin interfaceSootMethodRef
-
getParameterTypes
public List<Type> getParameterTypes()
- Specified by:
getParameterTypesin interfaceSootMethodInterface
-
returnType
public Type returnType()
Description copied from interface:SootMethodRefUseSootMethodInterface.getReturnType()instead- Specified by:
returnTypein interfaceSootMethodRef
-
getReturnType
public Type getReturnType()
- Specified by:
getReturnTypein interfaceSootMethodInterface
-
isStatic
public boolean isStatic()
- Specified by:
isStaticin interfaceSootMethodInterface
-
getSubSignature
public NumberedString getSubSignature()
- Specified by:
getSubSignaturein interfaceSootMethodRef
-
getSignature
public String getSignature()
- Specified by:
getSignaturein interfaceSootMethodInterface- Returns:
- The Soot signature of this method. Used to refer to methods unambiguously.
-
parameterType
public Type parameterType(int i)
Description copied from interface:SootMethodRefUseSootMethodInterface.getParameterType(int)instead- Specified by:
parameterTypein interfaceSootMethodRef
-
getParameterType
public Type getParameterType(int i)
- Specified by:
getParameterTypein interfaceSootMethodInterface
-
resolve
public SootMethod resolve()
Description copied from interface:SootMethodRefResolves this method call, i.e., finds the method to which this reference points. This method does not handle virtual dispatch, it just gives the immediate target, which can also be an abstract method.- Specified by:
resolvein interfaceSootMethodRef- Returns:
- The immediate target if this method reference
-
tryResolve
public SootMethod tryResolve()
Description copied from interface:SootMethodRefTries to resolve this method call, i.e., tries to finds the method to which this reference points. This method does not handle virtual dispatch, it just gives the immediate target, which can also be an abstract method. This method is different fromSootMethodRef.resolve()in the following ways: (1) This method does not fail when the target method does not exist and phantom references are not allowed. In that case, it returnsnull. (2) WhileSootMethodRef.resolve()creates fake methods that throw exceptions when a target method does not exist and phantom references are allowed, this method returnsnull.- Specified by:
tryResolvein interfaceSootMethodRef- Returns:
- The immediate target if this method reference if available,
nullotherwise
-
tryResolve
protected SootMethod tryResolve(StringBuilder trace)
-
-