public class ObligationAnalysis extends ForwardDataflowAnalysis<StateSet>
See Weimer and Necula, Finding and preventing run-time error handling mistakes, OOPSLA 2004.
| Constructor and Description |
|---|
ObligationAnalysis(DepthFirstSearch dfs,
XMethod xmethod,
org.apache.bcel.generic.ConstantPoolGen cpg,
ObligationFactory factory,
ObligationPolicyDatabase database,
TypeDataflow typeDataflow,
IsNullValueDataflow invDataflow,
IErrorLogger errorLogger)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
copy(StateSet src,
StateSet dest)
Copy dataflow facts.
|
StateSet |
createFact()
Create empty (uninitialized) dataflow facts for one program point.
|
void |
edgeTransfer(Edge edge,
StateSet fact)
Edge transfer function.
|
InstructionActionCache |
getActionCache() |
void |
initEntryFact(StateSet fact)
Initialize the "entry" fact for the graph.
|
boolean |
isFactValid(StateSet fact)
Determine whether the given fact is valid (neither top nor
bottom).
|
boolean |
isTop(StateSet fact)
Is the given fact the top value.
|
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 |
transfer(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle end,
StateSet start,
StateSet result)
Transfer function for the analysis.
|
void |
transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
BasicBlock basicBlock,
StateSet fact)
Transfer function for a single instruction.
|
getBlockOrder, getDepthFirstSearch, isForwardsgetFactAfterLocation, getFactAtLocationfactToString, finishIteration, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIterationpublic ObligationAnalysis(DepthFirstSearch dfs, XMethod xmethod, org.apache.bcel.generic.ConstantPoolGen cpg, ObligationFactory factory, ObligationPolicyDatabase database, TypeDataflow typeDataflow, IsNullValueDataflow invDataflow, IErrorLogger errorLogger)
dfs - a DepthFirstSearch on the method to be analyzedxmethod - method to analyzecpg - ConstantPoolGen of the method to be analyzedfactory - the ObligationFactory defining the obligation typesdatabase - the PolicyDatabase defining the methods which add and delete
obligationserrorLogger - callback to use when reporting missing classespublic InstructionActionCache getActionCache()
public StateSet createFact()
DataflowAnalysispublic boolean isFactValid(StateSet fact)
AbstractDataflowAnalysisisFactValid in class AbstractDataflowAnalysis<StateSet>public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
BasicBlock basicBlock,
StateSet fact)
throws DataflowAnalysisException
AbstractDataflowAnalysistransferInstruction 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 instructionDataflowAnalysisExceptionpublic void transfer(BasicBlock basicBlock, @CheckForNull org.apache.bcel.generic.InstructionHandle end, StateSet start, StateSet result) throws DataflowAnalysisException
DataflowAnalysistransfer in interface DataflowAnalysis<StateSet>transfer in class AbstractDataflowAnalysis<StateSet>basicBlock - the basic blockend - if nonnull, stop before considering this instruction;
otherwise, consider all of the instructions in the basic blockstart - dataflow facts at beginning of block (if forward analysis) or
end of block (if backwards analysis)result - resulting dataflow facts at other end of blockDataflowAnalysisExceptionpublic void edgeTransfer(Edge edge, StateSet fact) throws DataflowAnalysisException
DataflowAnalysisA do-nothing implementation is legal, and appropriate for analyses where branches are not significant.
edgeTransfer in interface DataflowAnalysis<StateSet>edgeTransfer in class BasicAbstractDataflowAnalysis<StateSet>edge - the Edgefact - a dataflow factDataflowAnalysisExceptionpublic void copy(StateSet src, StateSet dest)
DataflowAnalysispublic void initEntryFact(StateSet fact) throws DataflowAnalysisException
DataflowAnalysisDataflowAnalysisExceptionpublic void makeFactTop(StateSet fact)
DataflowAnalysispublic boolean isTop(StateSet fact)
DataflowAnalysispublic boolean same(StateSet a, StateSet b)
DataflowAnalysispublic void meetInto(StateSet fact, Edge edge, StateSet result) throws DataflowAnalysisException
DataflowAnalysisfact - the predecessor fact (incoming edge)edge - the edge from the predecessorresult - the result factDataflowAnalysisExceptionFindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.