edu.umd.cs.findbugs.ba.npe

Class NonNullContractCollector

public class NonNullContractCollector extends 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

Nested Class Summary
interfaceNonNullContractCollector.SpecificationBuilder
Constructor Summary
NonNullContractCollector(ParameterNullnessPropertyDatabase nonNullParamDatabase, ParameterNullnessPropertyDatabase possiblyNullParamDatabase)
Method Summary
voidcheckSpecifications(int numParams, NonNullContractCollector.SpecificationBuilder builder)
booleanchoose(JavaClassAndMethod classAndMethod)
voidfindContractForCallSite(InvokeInstruction invokeInstruction, ConstantPoolGen cpg)
voidfindContractForMethod(JavaClassAndMethod classAndMethod)
voidgetAnnotationSets(int numParams, BitSet nonNullParamSet, BitSet possiblyNullParamSet)
voidgetViolationList(int numParams, BitSet nullArgSet, List<NonNullParamViolation> violationList, BitSet violatedParamSet)

Constructor Detail

NonNullContractCollector

public NonNullContractCollector(ParameterNullnessPropertyDatabase nonNullParamDatabase, ParameterNullnessPropertyDatabase possiblyNullParamDatabase)

Method Detail

checkSpecifications

public void checkSpecifications(int numParams, NonNullContractCollector.SpecificationBuilder builder)

choose

public boolean choose(JavaClassAndMethod classAndMethod)

findContractForCallSite

public void findContractForCallSite(InvokeInstruction invokeInstruction, ConstantPoolGen cpg)

findContractForMethod

public void findContractForMethod(JavaClassAndMethod classAndMethod)

getAnnotationSets

public void getAnnotationSets(int numParams, BitSet nonNullParamSet, BitSet possiblyNullParamSet)

getViolationList

public void getViolationList(int numParams, BitSet nullArgSet, List<NonNullParamViolation> violationList, BitSet violatedParamSet)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.