Package soot
Class PolymorphicMethodRef
- java.lang.Object
-
- soot.SootMethodRefImpl
-
- soot.PolymorphicMethodRef
-
- All Implemented Interfaces:
SootMethodInterface,SootMethodRef
public class PolymorphicMethodRef extends SootMethodRefImpl
Special class to treat the methods with polymorphic signatures in the classesMethodHandleandVarHandle. As described in https://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.12.4.4 method references to the methods with a polymorphic signature, which are the methods in `java.lang.invoke.MethodHandle` and `java.lang.invoke.VarHandle`, require special treatment- Author:
- Andreas Dann created on 06.02.19, Manuel Benz 27.2.19
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.SootMethodRefImpl
SootMethodRefImpl.ClassResolutionFailedException
-
-
Field Summary
Fields Modifier and Type Field Description static StringMETHODHANDLE_SIGNATUREstatic StringPOLYMORPHIC_SIGNATUREstatic StringVARHANDLE_SIGNATURE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanhandlesClass(String declaringClassName)static booleanhandlesClass(SootClass declaringClass)Check if the declaring class "has the rights" to declare polymorphic methods {@see http://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.12.4.4}SootMethodresolve()Resolves this method call, i.e., finds the method to which this reference points.-
Methods inherited from class soot.SootMethodRefImpl
createParameterTypeList, declaringClass, equals, getDeclaringClass, getName, getParameterType, getParameterTypes, getReturnType, getSignature, getSubSignature, hashCode, isStatic, name, parameterType, parameterTypes, returnType, toString, tryResolve, tryResolve
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface soot.SootMethodRef
isConstructor
-
-
-
-
Field Detail
-
METHODHANDLE_SIGNATURE
public static final String METHODHANDLE_SIGNATURE
- See Also:
- Constant Field Values
-
VARHANDLE_SIGNATURE
public static final String VARHANDLE_SIGNATURE
- See Also:
- Constant Field Values
-
POLYMORPHIC_SIGNATURE
public static final String POLYMORPHIC_SIGNATURE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PolymorphicMethodRef
public PolymorphicMethodRef(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
-
handlesClass
public static boolean handlesClass(SootClass declaringClass)
Check if the declaring class "has the rights" to declare polymorphic methods {@see http://docs.oracle.com/javase/specs/jls/se11/html/jls-15.html#jls-15.12.4.4}- Parameters:
declaringClass- the class to check- Returns:
- if the class is allowed according to the JVM Spec
-
handlesClass
public static boolean handlesClass(String declaringClassName)
-
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- Overrides:
resolvein classSootMethodRefImpl- Returns:
- The immediate target if this method reference
-
-