Package edu.umd.cs.findbugs.bcel
Class BCELUtil
java.lang.Object
edu.umd.cs.findbugs.bcel.BCELUtil
Utility methods for detectors and analyses using BCEL.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassDescriptor
getClassDescriptor
(org.apache.bcel.classfile.JavaClass jclass) Construct a ClassDescriptor from a JavaClass.static MethodDescriptor
getMethodDescriptor
(org.apache.bcel.classfile.JavaClass jclass, org.apache.bcel.classfile.Method method) Construct a MethodDescriptor from JavaClass and method.static org.apache.bcel.generic.ObjectType
getObjectTypeInstance
(String className) static boolean
isSynthetic
(org.apache.bcel.classfile.FieldOrMethod m) Deprecated.static boolean
isSynthetic
(org.apache.bcel.classfile.JavaClass j) static boolean
isSynthetic
(org.apache.bcel.generic.FieldGenOrMethodGen m) static boolean
preTiger
(org.apache.bcel.classfile.JavaClass jclass) Checks if classfile was compiled for pre 1.5 target
-
Field Details
-
JDK15_MAJOR
private static final int JDK15_MAJOR- See Also:
-
JDK15_MINOR
private static final int JDK15_MINOR- See Also:
-
-
Constructor Details
-
BCELUtil
public BCELUtil()
-
-
Method Details
-
getMethodDescriptor
public static MethodDescriptor getMethodDescriptor(org.apache.bcel.classfile.JavaClass jclass, org.apache.bcel.classfile.Method method) Construct a MethodDescriptor from JavaClass and method.- Parameters:
jclass
- a JavaClassmethod
- a Method belonging to the JavaClass- Returns:
- a MethodDescriptor identifying the method
-
getClassDescriptor
Construct a ClassDescriptor from a JavaClass.- Parameters:
jclass
- a JavaClass- Returns:
- a ClassDescriptor identifying that JavaClass
-
preTiger
public static boolean preTiger(org.apache.bcel.classfile.JavaClass jclass) Checks if classfile was compiled for pre 1.5 target -
getObjectTypeInstance
public static org.apache.bcel.generic.ObjectType getObjectTypeInstance(@DottedClassName String className) -
isSynthetic
Deprecated.You probably don't care for synthetic members, but want to know if the developer added it (think of lambdas), useMemberUtils.isUserGenerated(FieldOrMethod)
insteadChecks if the given member is synthetic- Parameters:
m
- The member to be checked- Returns:
- True if the member is synthetic, false otherwise
-
isSynthetic
public static boolean isSynthetic(org.apache.bcel.classfile.JavaClass j) -
isSynthetic
public static boolean isSynthetic(org.apache.bcel.generic.FieldGenOrMethodGen m)
-
MemberUtils.isUserGenerated(FieldOrMethod)
instead