Class ResourceValueAnalysis<Resource>
java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<ResourceValueFrame>
edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<ResourceValueFrame>
edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis<ResourceValueFrame>
edu.umd.cs.findbugs.ba.FrameDataflowAnalysis<ResourceValue, ResourceValueFrame>
edu.umd.cs.findbugs.ba.ResourceValueAnalysis<Resource>
- All Implemented Interfaces:
DataflowAnalysis<ResourceValueFrame>, EdgeTypes
@ParametersAreNonnullByDefault
public class ResourceValueAnalysis<Resource>
extends FrameDataflowAnalysis<ResourceValue, ResourceValueFrame>
implements EdgeTypes
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CFGprivate static final booleanprivate final booleanprivate final org.apache.bcel.generic.MethodGenprivate final Resourceprivate final ResourceTracker<Resource> private final ResourceValueFrameModelingVisitorFields inherited from interface EdgeTypes
BACKEDGE_SOURCE_EDGE, BACKEDGE_TARGET_EDGE, CHECKED_EXCEPTIONS_FLAG, EXIT_EDGE, EXPLICIT_EXCEPTIONS_FLAG, FALL_THROUGH_EDGE, GOTO_EDGE, HANDLED_EXCEPTION_EDGE, IFCMP_EDGE, JSR_EDGE, RET_EDGE, RETURN_EDGE, START_EDGE, SWITCH_DEFAULT_EDGE, SWITCH_EDGE, UNHANDLED_EXCEPTION_EDGE, UNKNOWN_EDGE -
Constructor Summary
ConstructorsConstructorDescriptionResourceValueAnalysis(org.apache.bcel.generic.MethodGen methodGen, CFG cfg, DepthFirstSearch dfs, ResourceTracker<Resource> resourceTracker, Resource resource) -
Method Summary
Modifier and TypeMethodDescriptionCreate empty (uninitialized) dataflow facts for one program point.voidinitEntryFact(ResourceValueFrame result) Initialize the "entry" fact for the graph.voidmeetInto(ResourceValueFrame fact, Edge edge, ResourceValueFrame result) Meet a dataflow fact associated with an incoming edge into another fact.protected voidmergeInto(ResourceValueFrame frame, ResourceValueFrame result) Merge one frame into another.protected voidmergeValues(ResourceValueFrame otherFrame, ResourceValueFrame resultFrame, int slot) Merge the values contained in a given slot of two Frames.voidtransferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, ResourceValueFrame fact) Transfer function for a single instruction.Methods inherited from class FrameDataflowAnalysis
copy, getFactAtPC, getFactBeforeExceptionCheck, getLastUpdateTimestamp, isFactValid, isTop, makeFactTop, modifyFrame, same, setLastUpdateTimestampMethods inherited from class ForwardDataflowAnalysis
getBlockOrder, getDepthFirstSearch, isForwardsMethods inherited from class AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transferMethods inherited from class BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getResultFact, getStartFact, resultFactIterator, startIteration
-
Field Details
-
DEBUG
private static final boolean DEBUG -
methodGen
private final org.apache.bcel.generic.MethodGen methodGen -
cfg
-
resourceTracker
-
resource
-
visitor
-
ignoreImplicitExceptions
private final boolean ignoreImplicitExceptions
-
-
Constructor Details
-
ResourceValueAnalysis
public ResourceValueAnalysis(org.apache.bcel.generic.MethodGen methodGen, CFG cfg, DepthFirstSearch dfs, ResourceTracker<Resource> resourceTracker, Resource resource)
-
-
Method Details
-
createFact
Description copied from interface:DataflowAnalysisCreate empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used.- Specified by:
createFactin interfaceDataflowAnalysis<Resource>
-
initEntryFact
Description copied from interface:DataflowAnalysisInitialize the "entry" fact for the graph.- Specified by:
initEntryFactin interfaceDataflowAnalysis<Resource>
-
meetInto
public void meetInto(ResourceValueFrame fact, Edge edge, ResourceValueFrame result) throws DataflowAnalysisException Description copied from interface:DataflowAnalysisMeet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.- Specified by:
meetIntoin interfaceDataflowAnalysis<Resource>- Parameters:
fact- the predecessor fact (incoming edge)edge- the edge from the predecessorresult- the result fact- Throws:
DataflowAnalysisException
-
mergeInto
protected void mergeInto(ResourceValueFrame frame, ResourceValueFrame result) throws DataflowAnalysisException Description copied from class:FrameDataflowAnalysisMerge one frame into another.- Overrides:
mergeIntoin classFrameDataflowAnalysis<ResourceValue, ResourceValueFrame>- Parameters:
frame- the frame to merge with the resultresult- the result frame, which is modified to be the merge of the two frames- Throws:
DataflowAnalysisException
-
mergeValues
Description copied from class:FrameDataflowAnalysisMerge the values contained in a given slot of two Frames.- Specified by:
mergeValuesin classFrameDataflowAnalysis<ResourceValue, ResourceValueFrame>- Parameters:
otherFrame- a FrameresultFrame- a Frame which will contain the resulting merged valueslot- a slot in both frames
-
transferInstruction
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, ResourceValueFrame fact) throws DataflowAnalysisException Description copied from class:AbstractDataflowAnalysisTransfer function for a single instruction.- Specified by:
transferInstructionin classAbstractDataflowAnalysis<ResourceValueFrame>- Parameters:
handle- the instructionbasicBlock- the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutinesfact- which should be modified based on the instruction- Throws:
DataflowAnalysisException
-