Class CheckTypeQualifiers
java.lang.Object
edu.umd.cs.findbugs.bcel.CFGDetector
edu.umd.cs.findbugs.detect.CheckTypeQualifiers
- All Implemented Interfaces:
Detector2, Priorities
Check JSR-305 type qualifiers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BugReporter(package private) booleanprivate Stringprivate static final booleanprivate static final booleanprivate static final Stringprivate static final Stringprivate static final String(package private) booleanFields inherited from class CFGDetector
classContext, methodFields inherited from interface Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidannotateWarningWithSourceSinkInfo(BugInstance warning, XMethod xMethod, ValueNumber vn, SourceSinkInfo sourceSinkInfo) private voidannotateWarningWithTypeQualifier(BugInstance warning, TypeQualifierValue<?> typeQualifierValue) private voidcheckDataflow(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ValueNumberDataflow vnaDataflow, ForwardTypeQualifierDataflow forwardDataflow, BackwardTypeQualifierDataflow backwardDataflow) private voidcheckForConflictingValues(XMethod xMethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, TypeQualifierValueSet forwardsFact, TypeQualifierValueSet backwardsFact, Location locationToReport, Location locationWhereDoomedValueIsObserved, ValueNumberFrame vnaFrame) private voidcheckForEqualityTest(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, TypeQualifierValueSet forwardsFact, Location loc, ValueNumberFrame factAtLocation) private voidcheckQualifier(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ForwardTypeQualifierDataflowFactory forwardDataflowFactory, BackwardTypeQualifierDataflowFactory backwardDataflowFactory, ValueNumberDataflow vnaDataflow) Check a specific TypeQualifierValue on a method.private voidcheckValueSources(XMethod xMethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ValueNumberDataflow vnaDataflow, ForwardTypeQualifierDataflow forwardDataflow, BackwardTypeQualifierDataflow backwardDataflow) private voidemitDataflowWarning(XMethod xMethod, TypeQualifierValue<?> typeQualifierValue, TypeQualifierValueSet forwardsFact, TypeQualifierValueSet backwardsFact, ValueNumber vn, FlowValue forward, FlowValue backward, Location locationToReport, Location locationWhereDoomedValueIsObserved, ValueNumberFrame vnaFrame) private voidemitSourceWarning(String bugType, XMethod xMethod, TypeQualifierValue<?> typeQualifierValue, FlowValue backwardsFlowValue, TypeQualifierValueSet backwardsFact, SourceSinkInfo source, ValueNumber vn, Location location) private LocationgetEdgeSourceLocation(CFG cfg, Edge edge) private LocationgetEdgeTargetLocation(CFG cfg, Edge edge) private LocationgetSinkLocation(SourceSinkInfo sourceSinkInfo) private LocationgetSinkLocation(Iterable<? extends SourceSinkInfo> info) voidvisitClass(ClassDescriptor classDescriptor) Visit a class.protected voidvisitMethodCFG(MethodDescriptor methodDescriptor, CFG cfg) Visit the CFG (control flow graph) of a method to be analyzed.Methods inherited from class CFGDetector
finishPassMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Detector2
getDetectorClassName
-
Field Details
-
DEBUG
private static final boolean DEBUG -
DEBUG_DATAFLOW
private static final boolean DEBUG_DATAFLOW -
DEBUG_DATAFLOW_MODE
-
NONNULL_ANNOTATION
-
METHOD
-
bugReporter
-
checked
boolean checked -
shouldRunAnalysis
boolean shouldRunAnalysis -
checkLocation
-
-
Constructor Details
-
CheckTypeQualifiers
-
-
Method Details
-
visitClass
Description copied from interface:Detector2Visit a class.- Specified by:
visitClassin interfaceDetector2- Overrides:
visitClassin classCFGDetector- Parameters:
classDescriptor- descriptor naming the class to visit- Throws:
CheckedAnalysisException- if an exception occurs during analysis
-
visitMethodCFG
protected void visitMethodCFG(MethodDescriptor methodDescriptor, CFG cfg) throws CheckedAnalysisException Description copied from class:CFGDetectorVisit the CFG (control flow graph) of a method to be analyzed. Should be overridden by subclasses.- Specified by:
visitMethodCFGin classCFGDetector- Parameters:
methodDescriptor-cfg-- Throws:
CheckedAnalysisException
-
checkQualifier
private void checkQualifier(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ForwardTypeQualifierDataflowFactory forwardDataflowFactory, BackwardTypeQualifierDataflowFactory backwardDataflowFactory, ValueNumberDataflow vnaDataflow) throws CheckedAnalysisException Check a specific TypeQualifierValue on a method.- Parameters:
xmethod- MethodDescriptor of methodcfg- CFG of methodtypeQualifierValue- TypeQualifierValue to checkforwardDataflowFactory- ForwardTypeQualifierDataflowFactory used to create forward dataflow analysis objectsbackwardDataflowFactory- BackwardTypeQualifierDataflowFactory used to create backward dataflow analysis objectsvnaDataflow- ValueNumberDataflow for the method- Throws:
CheckedAnalysisException
-
checkDataflow
private void checkDataflow(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ValueNumberDataflow vnaDataflow, ForwardTypeQualifierDataflow forwardDataflow, BackwardTypeQualifierDataflow backwardDataflow) throws CheckedAnalysisException - Throws:
CheckedAnalysisException
-
checkForEqualityTest
private void checkForEqualityTest(XMethod xmethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, TypeQualifierValueSet forwardsFact, Location loc, ValueNumberFrame factAtLocation) throws DataflowAnalysisException - Throws:
DataflowAnalysisException
-
checkValueSources
private void checkValueSources(XMethod xMethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, ValueNumberDataflow vnaDataflow, ForwardTypeQualifierDataflow forwardDataflow, BackwardTypeQualifierDataflow backwardDataflow) throws CheckedAnalysisException - Throws:
CheckedAnalysisException
-
getEdgeTargetLocation
-
getEdgeSourceLocation
-
checkForConflictingValues
private void checkForConflictingValues(XMethod xMethod, CFG cfg, TypeQualifierValue<?> typeQualifierValue, TypeQualifierValueSet forwardsFact, TypeQualifierValueSet backwardsFact, Location locationToReport, Location locationWhereDoomedValueIsObserved, ValueNumberFrame vnaFrame) throws CheckedAnalysisException - Throws:
CheckedAnalysisException
-
emitDataflowWarning
private void emitDataflowWarning(XMethod xMethod, TypeQualifierValue<?> typeQualifierValue, TypeQualifierValueSet forwardsFact, TypeQualifierValueSet backwardsFact, ValueNumber vn, FlowValue forward, FlowValue backward, Location locationToReport, @CheckForNull Location locationWhereDoomedValueIsObserved, ValueNumberFrame vnaFrame) throws CheckedAnalysisException - Throws:
CheckedAnalysisException
-
emitSourceWarning
private void emitSourceWarning(String bugType, XMethod xMethod, TypeQualifierValue<?> typeQualifierValue, FlowValue backwardsFlowValue, TypeQualifierValueSet backwardsFact, SourceSinkInfo source, ValueNumber vn, Location location) -
annotateWarningWithTypeQualifier
private void annotateWarningWithTypeQualifier(BugInstance warning, TypeQualifierValue<?> typeQualifierValue) -
annotateWarningWithSourceSinkInfo
private void annotateWarningWithSourceSinkInfo(BugInstance warning, XMethod xMethod, ValueNumber vn, SourceSinkInfo sourceSinkInfo) -
getSinkLocation
-
getSinkLocation
-