Package soot

Class PolymorphicMethodRef

  • All Implemented Interfaces:
    SootMethodInterface, SootMethodRef

    public class PolymorphicMethodRef
    extends SootMethodRefImpl
    Special class to treat the methods with polymorphic signatures in the classes MethodHandle and VarHandle. 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
    • Constructor Detail

      • PolymorphicMethodRef

        public PolymorphicMethodRef​(SootClass declaringClass,
                                    String name,
                                    List<Type> parameterTypes,
                                    Type returnType,
                                    boolean isStatic)
        Constructor.
        Parameters:
        declaringClass - the declaring class. Must not be null
        name - the method name. Must not be null
        parameterTypes - the types of parameters. May be null
        returnType - the type of return value. Must not be null
        isStatic - the static modifier value
        Throws:
        IllegalArgumentException - is thrown when declaringClass, or name, or returnType is 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: SootMethodRef
        Resolves 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:
        resolve in interface SootMethodRef
        Overrides:
        resolve in class SootMethodRefImpl
        Returns:
        The immediate target if this method reference