edu.umd.cs.findbugs.ba.npe
Class NonNullContractCollector
java.lang.Object
edu.umd.cs.findbugs.ba.npe.NonNullContractCollector
- All Implemented Interfaces:
- JavaClassAndMethodChooser
public class NonNullContractCollector
- extends java.lang.Object
- implements JavaClassAndMethodChooser
Find the contract specified by @NonNull and @CheckForNull parameter
annotations in the class hierarchy. Also, check null argument sets
for violations.
TODO: this code could be generalized for other kinds of parameter annotations
- Author:
- David Hovemeyer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NonNullContractCollector
public NonNullContractCollector(ParameterNullnessPropertyDatabase nonNullParamDatabase,
ParameterNullnessPropertyDatabase possiblyNullParamDatabase)
choose
public boolean choose(JavaClassAndMethod classAndMethod)
- Specified by:
choose
in interface JavaClassAndMethodChooser
findContractForCallSite
public void findContractForCallSite(org.apache.bcel.generic.InvokeInstruction invokeInstruction,
org.apache.bcel.generic.ConstantPoolGen cpg)
throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
findContractForMethod
public void findContractForMethod(JavaClassAndMethod classAndMethod)
throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
checkSpecifications
public void checkSpecifications(int numParams,
NonNullContractCollector.SpecificationBuilder builder)
getViolationList
public void getViolationList(int numParams,
java.util.BitSet nullArgSet,
java.util.List<NonNullParamViolation> violationList,
java.util.BitSet violatedParamSet)
getAnnotationSets
public void getAnnotationSets(int numParams,
java.util.BitSet nonNullParamSet,
java.util.BitSet possiblyNullParamSet)