FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba
Class AbstractDataflowAnalysis<Fact>

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<Fact>
      extended by edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
All Implemented Interfaces:
DataflowAnalysis<Fact>
Direct Known Subclasses:
BackwardDataflowAnalysis, CallListAnalysis, ForwardDataflowAnalysis, TypeQualifierDataflowAnalysis

public abstract class AbstractDataflowAnalysis<Fact>
extends BasicAbstractDataflowAnalysis<Fact>

Abstract base class providing functionality that will be useful for most dataflow analysis implementations that model instructions within basic blocks.

Author:
David Hovemeyer
See Also:
Dataflow, DataflowAnalysis

Constructor Summary
AbstractDataflowAnalysis()
           
 
Method Summary
 Fact getFactAfterLocation(Location location)
          Get the dataflow fact representing the point just after given Location.
 Fact getFactAtLocation(Location location)
          Get the dataflow fact representing the point just before given Location.
abstract  boolean isFactValid(Fact fact)
          Determine whether the given fact is valid (neither top nor bottom).
 void transfer(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle end, Fact start, Fact result)
          Transfer function for the analysis.
abstract  void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, Fact fact)
          Transfer function for a single instruction.
 
Methods inherited from class edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIteration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.findbugs.ba.DataflowAnalysis
copy, createFact, getBlockOrder, initEntryFact, isForwards, isTop, makeFactTop, meetInto, same
 

Constructor Detail

AbstractDataflowAnalysis

public AbstractDataflowAnalysis()
Method Detail

transferInstruction

public abstract void transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
                                         BasicBlock basicBlock,
                                         Fact fact)
                                  throws DataflowAnalysisException
Transfer function for a single instruction.

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

isFactValid

@CheckReturnValue
public abstract boolean isFactValid(Fact fact)
Determine whether the given fact is valid (neither top nor bottom).


getFactAtLocation

public Fact getFactAtLocation(Location location)
                       throws DataflowAnalysisException
Get the dataflow fact representing the point just before given Location. Note "before" is meant in the logical sense, so for backward analyses, before means after the location in the control flow sense.

Specified by:
getFactAtLocation in interface DataflowAnalysis<Fact>
Overrides:
getFactAtLocation in class BasicAbstractDataflowAnalysis<Fact>
Parameters:
location - the location
Returns:
the fact at the point just before the location
Throws:
DataflowAnalysisException

getFactAfterLocation

public Fact getFactAfterLocation(Location location)
                          throws DataflowAnalysisException
Get the dataflow fact representing the point just after given Location. Note "after" is meant in the logical sense, so for backward analyses, after means before the location in the control flow sense.

Specified by:
getFactAfterLocation in interface DataflowAnalysis<Fact>
Overrides:
getFactAfterLocation in class BasicAbstractDataflowAnalysis<Fact>
Parameters:
location - the location
Returns:
the fact at the point just after the location
Throws:
DataflowAnalysisException

transfer

public void transfer(BasicBlock basicBlock,
                     @CheckForNull
                     org.apache.bcel.generic.InstructionHandle end,
                     Fact start,
                     Fact result)
              throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Transfer function for the analysis. Taking dataflow facts at start (which might be either the entry or exit of the block, depending on whether the analysis is forwards or backwards), modify result to be the facts at the other end of the block.

Parameters:
basicBlock - the basic block
end - if nonnull, stop before considering this instruction; otherwise, consider all of the instructions in the basic block
start - dataflow facts at beginning of block (if forward analysis) or end of block (if backwards analysis)
result - resulting dataflow facts at other end of block
Throws:
DataflowAnalysisException

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.