Class BootstrapMethodsUtil
java.lang.Object
edu.umd.cs.findbugs.util.BootstrapMethodsUtil
Utility methods for working with bootstrap methods
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.apache.bcel.classfile.BootstrapMethodfindBootstrapMethod(org.apache.bcel.classfile.JavaClass cls, int index) static List<MethodDescriptor> getInvokedMethodTargets(org.apache.bcel.classfile.JavaClass cls, int bootstrapIndex, org.apache.bcel.classfile.ConstantPool cp) Returns the methods invoked by handle arguments of a bootstrap method from a Java class.static Optional<org.apache.bcel.classfile.Method> getMethodFromBootstrap(org.apache.bcel.classfile.BootstrapMethods bms, int index, org.apache.bcel.classfile.ConstantPool cp, org.apache.bcel.classfile.JavaClass cls) Returns the method representation of a bootstrap method from a Java class.
-
Constructor Details
-
BootstrapMethodsUtil
public BootstrapMethodsUtil()
-
-
Method Details
-
getInvokedMethodTargets
public static List<MethodDescriptor> getInvokedMethodTargets(org.apache.bcel.classfile.JavaClass cls, int bootstrapIndex, org.apache.bcel.classfile.ConstantPool cp) Returns the methods invoked by handle arguments of a bootstrap method from a Java class.- Parameters:
cls- the java class whose bootstrap method attribute is consultedbootstrapIndex- the index of the bootstrap methodcp- the constant pool of the java class- Returns:
- the invoked methods if found, an empty list otherwise
-
findBootstrapMethod
private static org.apache.bcel.classfile.BootstrapMethod findBootstrapMethod(org.apache.bcel.classfile.JavaClass cls, int index) -
getMethodFromBootstrap
public static Optional<org.apache.bcel.classfile.Method> getMethodFromBootstrap(org.apache.bcel.classfile.BootstrapMethods bms, int index, org.apache.bcel.classfile.ConstantPool cp, org.apache.bcel.classfile.JavaClass cls) Returns the method representation of a bootstrap method from a Java class.- Parameters:
bms- the BootstrapMethods attribute of a java classindex- the index of the bootstrap methodcp- the constant pool of the java classcls- the java class itself- Returns:
- the bootstrap method represented as Method if found, Optional.empty() otherwise
-