edu.umd.cs.findbugs.ba
Class BetterTypeAnalysis

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<Type,BetterTypeFrame>
              extended by edu.umd.cs.findbugs.ba.BetterTypeAnalysis
All Implemented Interfaces:
DataflowAnalysis<BetterTypeFrame>

public class BetterTypeAnalysis
extends FrameDataflowAnalysis<Type,BetterTypeFrame>


Field Summary
private static java.lang.String JAVA_LANG_THROWABLE_SIGNATURE
           
private  RepositoryLookupFailureCallback lookupFailureCallback
           
private  org.apache.bcel.generic.MethodGen methodGen
           
private  java.lang.String[] parameterSignatureList
           
private  TypeMerger typeMerger
           
private  TypeRepository typeRepository
           
 
Constructor Summary
BetterTypeAnalysis(org.apache.bcel.generic.MethodGen methodGen, java.lang.String[] parameterSignatureList, CFG cfg, DepthFirstSearch dfs, TypeRepository typeRepository, TypeMerger typeMerger, RepositoryLookupFailureCallback lookupFailureCallback)
           
 
Method Summary
 BetterTypeFrame createFact()
          Create empty (uninitialized) dataflow facts for one program point.
 void initEntryFact(BetterTypeFrame result)
          Initialize the "entry" fact for the graph.
 void meetInto(BetterTypeFrame fact, Edge edge, BetterTypeFrame result)
          Meet a dataflow fact associated with an incoming edge into another fact.
protected  Type mergeValues(BetterTypeFrame frame, int slot, Type a, Type b)
          Merge two values in a particular slot of a Frame.
 void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, BetterTypeFrame fact)
          Transfer function for a single instruction.
 
Methods inherited from class edu.umd.cs.findbugs.ba.FrameDataflowAnalysis
copy, initResultFact, isFactValid, makeFactTop, mergeInto, 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

JAVA_LANG_THROWABLE_SIGNATURE

private static final java.lang.String JAVA_LANG_THROWABLE_SIGNATURE
See Also:
Constant Field Values

methodGen

private org.apache.bcel.generic.MethodGen methodGen

parameterSignatureList

private java.lang.String[] parameterSignatureList

typeRepository

private TypeRepository typeRepository

typeMerger

private TypeMerger typeMerger

lookupFailureCallback

private RepositoryLookupFailureCallback lookupFailureCallback
Constructor Detail

BetterTypeAnalysis

public BetterTypeAnalysis(org.apache.bcel.generic.MethodGen methodGen,
                          java.lang.String[] parameterSignatureList,
                          CFG cfg,
                          DepthFirstSearch dfs,
                          TypeRepository typeRepository,
                          TypeMerger typeMerger,
                          RepositoryLookupFailureCallback lookupFailureCallback)
Method Detail

createFact

public BetterTypeFrame 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(BetterTypeFrame result)
                   throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Initialize the "entry" fact for the graph.

Throws:
DataflowAnalysisException

transferInstruction

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

Specified by:
transferInstruction in class AbstractDataflowAnalysis<BetterTypeFrame>
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

meetInto

public void meetInto(BetterTypeFrame fact,
                     Edge edge,
                     BetterTypeFrame 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 Type mergeValues(BetterTypeFrame frame,
                           int slot,
                           Type a,
                           Type b)
                    throws DataflowAnalysisException
Description copied from class: FrameDataflowAnalysis
Merge two values in a particular slot of a Frame.

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