FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba.npe2
Class DefinitelyNullSetAnalysis

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<DefinitelyNullSet>
              extended by edu.umd.cs.findbugs.ba.npe2.DefinitelyNullSetAnalysis
All Implemented Interfaces:
DataflowAnalysis<DefinitelyNullSet>

public class DefinitelyNullSetAnalysis
extends ForwardDataflowAnalysis<DefinitelyNullSet>

A simple null-pointer analysis that keeps track of which value numbers are definitely known to be null.

Author:
David Hovemeyer

Constructor Summary
DefinitelyNullSetAnalysis(DepthFirstSearch dfs, ValueNumberDataflow vnaDataflow, CompactLocationNumbering compactLocationNumbering)
          Constructor.
 
Method Summary
 void copy(DefinitelyNullSet source, DefinitelyNullSet dest)
          Copy dataflow facts.
 DefinitelyNullSet createFact()
          Create empty (uninitialized) dataflow facts for one program point.
 void edgeTransfer(Edge edge, DefinitelyNullSet fact)
          Edge transfer function.
 void initEntryFact(DefinitelyNullSet result)
          Initialize the "entry" fact for the graph.
 boolean isFactValid(DefinitelyNullSet fact)
          Determine whether the given fact is valid (neither top nor bottom).
 boolean isTop(DefinitelyNullSet fact)
          Is the given fact the top value.
 void makeFactTop(DefinitelyNullSet fact)
          Make given fact the top value.
 void meetInto(DefinitelyNullSet fact, Edge edge, DefinitelyNullSet result)
          Meet a dataflow fact associated with an incoming edge into another fact.
 boolean same(DefinitelyNullSet fact1, DefinitelyNullSet fact2)
          Are given dataflow facts the same?
 void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, DefinitelyNullSet fact)
          Transfer function for a single instruction.
 
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
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
 

Constructor Detail

DefinitelyNullSetAnalysis

public DefinitelyNullSetAnalysis(DepthFirstSearch dfs,
                                 ValueNumberDataflow vnaDataflow,
                                 CompactLocationNumbering compactLocationNumbering)
Constructor.

Parameters:
dfs - DepthFirstSearch for the method
vnaDataflow - value number dataflow for the method
compactLocationNumbering - CompactLocationNumbering for the method
Method Detail

isFactValid

public boolean isFactValid(DefinitelyNullSet fact)
Description copied from class: AbstractDataflowAnalysis
Determine whether the given fact is valid (neither top nor bottom).

Specified by:
isFactValid in class AbstractDataflowAnalysis<DefinitelyNullSet>

transferInstruction

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

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

edgeTransfer

public void edgeTransfer(Edge edge,
                         DefinitelyNullSet fact)
                  throws DataflowAnalysisException
Description copied from interface: DataflowAnalysis
Edge transfer function. Modify the given fact that is true on the (logical) edge source to modify it so that it is true at the (logical) edge target.

A do-nothing implementation is legal, and appropriate for analyses where branches are not significant.

Specified by:
edgeTransfer in interface DataflowAnalysis<DefinitelyNullSet>
Overrides:
edgeTransfer in class BasicAbstractDataflowAnalysis<DefinitelyNullSet>
Parameters:
edge - the Edge
fact - a dataflow fact
Throws:
DataflowAnalysisException

copy

public void copy(DefinitelyNullSet source,
                 DefinitelyNullSet dest)
Description copied from interface: DataflowAnalysis
Copy dataflow facts.


createFact

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

Throws:
DataflowAnalysisException

makeFactTop

public void makeFactTop(DefinitelyNullSet fact)
Description copied from interface: DataflowAnalysis
Make given fact the top value.


isTop

public boolean isTop(DefinitelyNullSet fact)
Description copied from interface: DataflowAnalysis
Is the given fact the top value.


meetInto

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

same

public boolean same(DefinitelyNullSet fact1,
                    DefinitelyNullSet fact2)
Description copied from interface: DataflowAnalysis
Are given dataflow facts the same?


FindBugs™ 1.3.9

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