FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba.constant
Class ConstantAnalysis

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<Fact>
      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<Constant,ConstantFrame>
                  extended by edu.umd.cs.findbugs.ba.constant.ConstantAnalysis
All Implemented Interfaces:
DataflowAnalysis<ConstantFrame>

public class ConstantAnalysis
extends FrameDataflowAnalysis<Constant,ConstantFrame>

Dataflow analysis to find constant values.

Author:
David Hovemeyer
See Also:
Constant

Constructor Summary
ConstantAnalysis(org.apache.bcel.generic.MethodGen methodGen, DepthFirstSearch dfs)
           
 
Method Summary
 ConstantFrame createFact()
          Create empty (uninitialized) dataflow facts for one program point.
 void initEntryFact(ConstantFrame frame)
          Initialize the "entry" fact for the graph.
 void meetInto(ConstantFrame fact, Edge edge, ConstantFrame result)
          Meet a dataflow fact associated with an incoming edge into another fact.
protected  void mergeValues(ConstantFrame otherFrame, ConstantFrame resultFrame, int slot)
          Merge the values contained in a given slot of two Frames.
 void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, ConstantFrame frame)
          Transfer function for a single instruction.
 
Methods inherited from class edu.umd.cs.findbugs.ba.FrameDataflowAnalysis
copy, getLastUpdateTimestamp, isFactValid, isTop, makeFactTop, mergeInto, modifyFrame, same, setLastUpdateTimestamp
 
Methods inherited from class edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis
getBlockOrder, getDepthFirstSearch, isForwards
 
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transfer
 
Methods inherited from class edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getResultFact, getStartFact, resultFactIterator, startIteration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantAnalysis

public ConstantAnalysis(org.apache.bcel.generic.MethodGen methodGen,
                        DepthFirstSearch dfs)
Method Detail

createFact

public ConstantFrame 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.


initEntryFact

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


transferInstruction

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

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

meetInto

public void meetInto(ConstantFrame fact,
                     Edge edge,
                     ConstantFrame 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.

Parameters:
fact - the predecessor fact (incoming edge)
edge - the edge from the predecessor
result - the result fact
Throws:
DataflowAnalysisException

mergeValues

protected void mergeValues(ConstantFrame otherFrame,
                           ConstantFrame resultFrame,
                           int slot)
                    throws DataflowAnalysisException
Description copied from class: FrameDataflowAnalysis
Merge the values contained in a given slot of two Frames.

Specified by:
mergeValues in class FrameDataflowAnalysis<Constant,ConstantFrame>
Parameters:
otherFrame - a Frame
resultFrame - a Frame which will contain the resulting merged value
slot - a slot in both frames
Throws:
DataflowAnalysisException

FindBugs™ 1.3.9

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