Package edu.umd.cs.findbugs.ba
Class AssertionMethods
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.AssertionMethods
-
public class AssertionMethods extends java.lang.Object
Mark methodref constant pool entries of methods that are likely to implement assertions. This is useful for pruning likely false paths.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AssertionMethods.UserAssertionMethod
-
Field Summary
Fields Modifier and Type Field Description private java.util.BitSet
assertionMethodRefSet
Bitset of methodref constant pool indexes referring to likely assertion methods.private static boolean
DEBUG
private static java.util.List<AssertionMethods.UserAssertionMethod>
userAssertionMethodList
-
Constructor Summary
Constructors Constructor Description AssertionMethods(org.apache.bcel.classfile.JavaClass jclass)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
init(org.apache.bcel.classfile.JavaClass jclass)
boolean
isAssertionCall(org.apache.bcel.generic.InvokeInstruction inv)
boolean
isAssertionHandle(org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg)
boolean
isAssertionInstruction(org.apache.bcel.generic.Instruction ins, org.apache.bcel.generic.ConstantPoolGen cpg)
Does the given instruction refer to a likely assertion method?private static boolean
isUserAssertionMethod(java.lang.String className, java.lang.String methodName)
-
-
-
Field Detail
-
DEBUG
private static final boolean DEBUG
-
assertionMethodRefSet
private final java.util.BitSet assertionMethodRefSet
Bitset of methodref constant pool indexes referring to likely assertion methods.
-
userAssertionMethodList
@StaticConstant private static final java.util.List<AssertionMethods.UserAssertionMethod> userAssertionMethodList
-
-
Method Detail
-
init
private void init(org.apache.bcel.classfile.JavaClass jclass)
-
isUserAssertionMethod
private static boolean isUserAssertionMethod(java.lang.String className, java.lang.String methodName)
-
isAssertionHandle
public boolean isAssertionHandle(org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg)
-
isAssertionInstruction
public boolean isAssertionInstruction(org.apache.bcel.generic.Instruction ins, org.apache.bcel.generic.ConstantPoolGen cpg)
Does the given instruction refer to a likely assertion method?- Parameters:
ins
- the instruction- Returns:
- true if the instruction likely refers to an assertion, false if not
-
isAssertionCall
public boolean isAssertionCall(org.apache.bcel.generic.InvokeInstruction inv)
-
-