edu.umd.cs.findbugs.ba
Class ResourceValueAnalysis<Resource>

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
      extended by edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis<FrameType>
          extended by edu.umd.cs.findbugs.ba.FrameDataflowAnalysis<ResourceValue,ResourceValueFrame>
              extended by edu.umd.cs.findbugs.ba.ResourceValueAnalysis<Resource>
All Implemented Interfaces:
DataflowAnalysis<ResourceValueFrame>, EdgeTypes

public class ResourceValueAnalysis<Resource>
extends FrameDataflowAnalysis<ResourceValue,ResourceValueFrame>
implements EdgeTypes


Field Summary
private  CFG cfg
           
private static boolean DEBUG
           
private  boolean ignoreImplicitExceptions
           
private  org.apache.bcel.generic.MethodGen methodGen
           
private  Resource resource
           
private  ResourceTracker<Resource> resourceTracker
           
private  ResourceValueFrameModelingVisitor visitor
           
 
Fields inherited from interface edu.umd.cs.findbugs.ba.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
ResourceValueAnalysis(org.apache.bcel.generic.MethodGen methodGen, CFG cfg, DepthFirstSearch dfs, ResourceTracker<Resource> resourceTracker, Resource resource)
           
 
Method Summary
 ResourceValueFrame createFact()
          Create empty (uninitialized) dataflow facts for one program point.
 void initEntryFact(ResourceValueFrame result)
          Initialize the "entry" fact for the graph.
 void meetInto(ResourceValueFrame fact, Edge edge, ResourceValueFrame result)
          Meet a dataflow fact associated with an incoming edge into another fact.
protected  void mergeInto(ResourceValueFrame frame, ResourceValueFrame result)
          Merge one frame into another.
protected  ResourceValue mergeValues(ResourceValueFrame frame, int slot, ResourceValue a, ResourceValue b)
          Merge two values in a particular slot of a Frame.
 void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, ResourceValueFrame fact)
          Transfer function for a single instruction.
 
Methods inherited from class edu.umd.cs.findbugs.ba.FrameDataflowAnalysis
copy, initResultFact, isFactValid, makeFactTop, modifyFrame, same
 
Methods inherited from class edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis
getBlockOrder, getDepthFirstSearch, isForwards
 
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis
endTransfer, 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
 

Field Detail

DEBUG

private static final boolean DEBUG

methodGen

private org.apache.bcel.generic.MethodGen methodGen

cfg

private CFG cfg

resourceTracker

private ResourceTracker<Resource> resourceTracker

resource

private Resource resource

visitor

private ResourceValueFrameModelingVisitor visitor

ignoreImplicitExceptions

private boolean ignoreImplicitExceptions
Constructor Detail

ResourceValueAnalysis

public ResourceValueAnalysis(org.apache.bcel.generic.MethodGen methodGen,
                             CFG cfg,
                             DepthFirstSearch dfs,
                             ResourceTracker<Resource> resourceTracker,
                             Resource resource)
Method Detail

createFact

public ResourceValueFrame createFact()
Description copied from interface: DataflowAnalysis
Create empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used.

Specified by:
createFact in interface DataflowAnalysis<ResourceValueFrame>

initEntryFact

public void initEntryFact(ResourceValueFrame result)
Description copied from interface: DataflowAnalysis
Initialize the "entry" fact for the graph.

Specified by:
initEntryFact in interface DataflowAnalysis<ResourceValueFrame>

meetInto

public void meetInto(ResourceValueFrame fact,
                     Edge edge,
                     ResourceValueFrame result)
              throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Meet 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:
meetInto in interface DataflowAnalysis<ResourceValueFrame>
Parameters:
fact - the predecessor fact (incoming edge)
edge - the edge from the predecessor
result - the result fact
Throws:
DataflowAnalysisException

mergeInto

protected void mergeInto(ResourceValueFrame frame,
                         ResourceValueFrame result)
                  throws DataflowAnalysisException
Description copied from class: FrameDataflowAnalysis
Merge one frame into another.

Overrides:
mergeInto in class FrameDataflowAnalysis<ResourceValue,ResourceValueFrame>
Parameters:
frame - the frame to merge with the result
result - the result frame, which is modified to be the merge of the two frames
Throws:
DataflowAnalysisException

mergeValues

protected ResourceValue mergeValues(ResourceValueFrame frame,
                                    int slot,
                                    ResourceValue a,
                                    ResourceValue b)
                             throws DataflowAnalysisException
Description copied from class: FrameDataflowAnalysis
Merge two values in a particular slot of a Frame.

Specified by:
mergeValues in class FrameDataflowAnalysis<ResourceValue,ResourceValueFrame>
Parameters:
frame - the Frame
slot - the slot of the Frame
a - a value
b - another value
Returns:
the merged value
Throws:
DataflowAnalysisException

transferInstruction

public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
                                BasicBlock basicBlock,
                                ResourceValueFrame fact)
                         throws DataflowAnalysisException
Description copied from class: AbstractDataflowAnalysis
Transfer function for a single instruction.

Specified by:
transferInstruction in class AbstractDataflowAnalysis<ResourceValueFrame>
Parameters:
handle - the instruction
basicBlock - the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutines
fact - which should be modified based on the instruction
Throws:
DataflowAnalysisException