Package edu.umd.cs.findbugs.detect
Class FindUnsatisfiedObligation
java.lang.Object
edu.umd.cs.findbugs.bcel.CFGDetector
edu.umd.cs.findbugs.detect.FindUnsatisfiedObligation
- All Implemented Interfaces:
Detector2
,Priorities
Find unsatisfied obligations in Java methods. Examples: open streams, open
database connections, etc.
See Weimer and Necula, Finding and preventing run-time error handling mistakes, OOPSLA 2004.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
A helper class to check a single method for unsatisfied obligations.private static class
Helper class to keep track of possible obligation transfers observed along paths where an obligation appears to be leaked. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BugReporter
private static final boolean
Compute possible obligation transfers as a way of suppressing false positives due to "wrapper" objects.private final ObligationPolicyDatabase
private static final boolean
private static final boolean
private static final String
private static final boolean
Report the final obligation set as part of the BugInstance.private static final boolean
Report path information from point of resource creation to CFG exit.private static final boolean
Fields inherited from class edu.umd.cs.findbugs.bcel.CFGDetector
classContext, method
Fields inherited from interface edu.umd.cs.findbugs.Priorities
EXP_PRIORITY, HIGH_PRIORITY, IGNORE_PRIORITY, LOW_PRIORITY, NORMAL_PRIORITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
report()
void
visitClass
(ClassDescriptor classDescriptor) Visit a class.protected void
visitMethodCFG
(MethodDescriptor methodDescriptor, CFG cfg) Visit the CFG (control flow graph) of a method to be analyzed.Methods inherited from class edu.umd.cs.findbugs.bcel.CFGDetector
finishPass, getDetectorClassName
-
Field Details
-
DEBUG
private static final boolean DEBUG -
DEBUG_METHOD
-
DEBUG_FP
private static final boolean DEBUG_FP -
COMPUTE_TRANSFERS
private static final boolean COMPUTE_TRANSFERSCompute possible obligation transfers as a way of suppressing false positives due to "wrapper" objects. Not quite ready for prime time. -
REPORT_PATH
private static final boolean REPORT_PATHReport path information from point of resource creation to CFG exit. This makes the reported warning a lot easier to understand. -
REPORT_PATH_DEBUG
private static final boolean REPORT_PATH_DEBUG -
REPORT_OBLIGATION_SET
private static final boolean REPORT_OBLIGATION_SETReport the final obligation set as part of the BugInstance. -
bugReporter
-
database
-
-
Constructor Details
-
FindUnsatisfiedObligation
-
-
Method Details
-
visitClass
Description copied from interface:Detector2
Visit a class.- Specified by:
visitClass
in interfaceDetector2
- Overrides:
visitClass
in 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:CFGDetector
Visit the CFG (control flow graph) of a method to be analyzed. Should be overridded by subclasses.- Specified by:
visitMethodCFG
in classCFGDetector
- Parameters:
methodDescriptor
-cfg
-- Throws:
CheckedAnalysisException
-
report
public void report()
-