edu.umd.cs.findbugs.ba
public abstract class FrameDataflowAnalysis<ValueType,FrameType extends Frame<ValueType>> extends ForwardDataflowAnalysis<FrameType>
See Also: Frame DataflowAnalysis
Constructor Summary | |
---|---|
FrameDataflowAnalysis(DepthFirstSearch dfs) |
Method Summary | |
---|---|
void | copy(FrameType source, FrameType dest) |
void | initResultFact(FrameType result) |
boolean | isTop(FrameType fact) |
void | makeFactTop(FrameType fact) |
protected void | mergeInto(FrameType other, FrameType result)
Merge one frame into another.
|
protected abstract void | mergeValues(FrameType otherFrame, FrameType resultFrame, int slot)
Merge the values contained in a given slot of two Frames.
|
protected FrameType | modifyFrame(FrameType orig, FrameType copy)
Create a modifiable copy of a frame.
|
boolean | same(FrameType fact1, FrameType fact2) |
Parameters: other the frame to merge with the result result the result frame, which is modified to be the merge of the two frames
Parameters: otherFrame a Frame resultFrame a Frame which will contain the resulting merged value slot a slot in both frames
Throws: DataflowAnalysisException
FrameType copy = null; if (someCondition()) { copy = modifyFrame(fact, copy); // modify copy } if (someOtherCondition()) { copy = modifyFrame(fact, copy); // modify copy } if (copy != null) fact = copy; mergeInto(fact, result);The advantage of using modifyFrame() is that new code can be added before or after other places where the frame is modified, and the code will remain correct.
Parameters: orig the original frame copy the modifiable copy (returned by a previous call to modifyFrame()), or null if this is the first time modifyFrame() is being called
Returns: a modifiable copy of fact