Package edu.umd.cs.findbugs.util
Class BootstrapMethodsUtil
- java.lang.Object
-
- edu.umd.cs.findbugs.util.BootstrapMethodsUtil
-
public class BootstrapMethodsUtil extends java.lang.ObjectUtility methods for working with bootstrap methods
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringLAMBDA_METHOD_PREFIX
-
Constructor Summary
Constructors Constructor Description BootstrapMethodsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static org.apache.bcel.classfile.BootstrapMethodfindBootstrapMethod(org.apache.bcel.classfile.JavaClass cls, int index)private static java.util.List<MethodAnnotation>getDirectlyReferencedLambdas(org.apache.bcel.classfile.JavaClass cls, org.apache.bcel.classfile.Method method)static java.util.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 java.util.Set<MethodAnnotation>getLambdasOwnedBy(org.apache.bcel.classfile.JavaClass cls, org.apache.bcel.classfile.Method method)Returns the lambda methods belonging to the given method (including nested ones).static java.util.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.
-
-
-
Field Detail
-
LAMBDA_METHOD_PREFIX
private static final java.lang.String LAMBDA_METHOD_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInvokedMethodTargets
public static java.util.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 java.util.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
-
getLambdasOwnedBy
public static java.util.Set<MethodAnnotation> getLambdasOwnedBy(org.apache.bcel.classfile.JavaClass cls, org.apache.bcel.classfile.Method method)
Returns the lambda methods belonging to the given method (including nested ones).- Parameters:
cls- the java class containing the methodmethod- the method whose lambdas to find- Returns:
- the lambda methods if found, an empty set otherwise
-
getDirectlyReferencedLambdas
private static java.util.List<MethodAnnotation> getDirectlyReferencedLambdas(org.apache.bcel.classfile.JavaClass cls, org.apache.bcel.classfile.Method method)
-
-