|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis<StateSet>
edu.umd.cs.findbugs.ba.obl.ObligationAnalysis
public class ObligationAnalysis
Dataflow analysis to track obligations (i/o streams and other resources which must be closed).
See Weimer and Necula, Finding and preventing run-time error handling mistakes, OOPSLA 2004.
Constructor Summary | |
---|---|
ObligationAnalysis(DepthFirstSearch dfs,
TypeDataflow typeDataflow,
org.apache.bcel.generic.MethodGen methodGen,
ObligationFactory factory,
PolicyDatabase database,
RepositoryLookupFailureCallback lookupFailureCallback)
Constructor. |
Method Summary | |
---|---|
void |
copy(StateSet src,
StateSet dest)
Copy dataflow facts. |
StateSet |
createFact()
Create empty (uninitialized) dataflow facts for one program point. |
void |
endTransfer(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle end,
java.lang.Object result_)
Subclasses may override this. |
void |
initEntryFact(StateSet fact)
Initialize the "entry" fact for the graph. |
void |
initResultFact(StateSet fact)
Initialize result fact for block. |
boolean |
isFactValid(StateSet fact)
Determine whether the given fact is valid (neither top nor bottom). |
void |
makeFactTop(StateSet fact)
Make given fact the top value. |
void |
meetInto(StateSet fact,
Edge edge,
StateSet result)
Meet a dataflow fact associated with an incoming edge into another fact. |
boolean |
same(StateSet a,
StateSet b)
Are given dataflow facts the same? |
void |
transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
BasicBlock basicBlock,
StateSet fact)
Transfer function for a single instruction. |
Methods inherited from class edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis |
---|
getBlockOrder, getDepthFirstSearch, isForwards |
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis |
---|
factToString, getFactAfterLocation, getFactAtLocation, getResultFact, getStartFact, resultFactIterator, startTransfer, transfer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObligationAnalysis(DepthFirstSearch dfs, TypeDataflow typeDataflow, org.apache.bcel.generic.MethodGen methodGen, ObligationFactory factory, PolicyDatabase database, RepositoryLookupFailureCallback lookupFailureCallback)
dfs
- a DepthFirstSearch on the method to be analyzedmethodGen
- the MethodGen of the method being analyzedfactory
- the ObligationFactory defining the obligation typesdatabase
- the PolicyDatabase defining the methods which
add and delete obligationslookupFailureCallback
- callback to use when reporting
missing classesMethod Detail |
---|
public StateSet createFact()
DataflowAnalysis
public boolean isFactValid(StateSet fact)
AbstractDataflowAnalysis
isFactValid
in class AbstractDataflowAnalysis<StateSet>
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, StateSet fact) throws DataflowAnalysisException
AbstractDataflowAnalysis
transferInstruction
in class AbstractDataflowAnalysis<StateSet>
handle
- the instructionbasicBlock
- the BasicBlock containing the instruction; needed to disambiguate
instructions in inlined JSR subroutinesfact
- which should be modified based on the instruction
DataflowAnalysisException
public void endTransfer(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle end, java.lang.Object result_) throws DataflowAnalysisException
AbstractDataflowAnalysis
endTransfer
in class AbstractDataflowAnalysis<StateSet>
basicBlock
- the basic blockend
- last instruction analyzed (null if entire block was analyzed)result_
- the result fact for the block
DataflowAnalysisException
public void copy(StateSet src, StateSet dest)
DataflowAnalysis
public void initEntryFact(StateSet fact) throws DataflowAnalysisException
DataflowAnalysis
DataflowAnalysisException
public void initResultFact(StateSet fact)
DataflowAnalysis
public void makeFactTop(StateSet fact)
DataflowAnalysis
public boolean same(StateSet a, StateSet b)
DataflowAnalysis
public void meetInto(StateSet fact, Edge edge, StateSet result) throws DataflowAnalysisException
DataflowAnalysis
fact
- the predecessor fact (incoming edge)edge
- the edge from the predecessorresult
- the result fact
DataflowAnalysisException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |