public class BlockType
extends java.util.BitSet
If valid (isValid() returns true), a BlockType value is a stack of elements, which are either CATCH or FINALLY values. Call getDepth() to get the current nesting depth. Call get(int n) to get the nth stack item. Call getTopValue() to get the current top of the stack.
If invalid (isValid() returns false), a BlockType value is either top or bottom. These are the special values at the top and bottom of the dataflow lattice.
The dataflow lattice is effectively finite-height because real Java methods are guaranteed to have a finite catch and finally block nesting level.
BlockTypeAnalysis
,
Serialized FormModifier and Type | Field and Description |
---|---|
static boolean |
CATCH |
static boolean |
FINALLY |
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(BlockType other)
Make this object an exact duplicate of given object.
|
boolean |
equals(java.lang.Object obj) |
int |
getDepth()
Get the current nesting depth.
|
boolean |
getTopValue()
Get the top value on the catch and finally block nesting stack.
|
int |
hashCode() |
boolean |
isBottom()
Return whether or not this is the special "bottom" dataflow value.
|
boolean |
isNormal()
Return whether or not this value represents "normal" control-flow.
|
boolean |
isTop()
Return whether or not this is the special "top" dataflow value.
|
boolean |
isValid()
Return whether or not this value is valid, meaning it contains a valid
representation of the nesting of catch and finally blocks.
|
void |
mergeWith(BlockType other)
Merge other dataflow value into this value.
|
void |
pushCatch()
Enter a catch block.
|
void |
pushFinally()
Enter a finally block.
|
boolean |
sameAs(BlockType other)
Return whether or not this object is identical to the one given.
|
void |
setBottom()
Make this the special "bottom" dataflow value.
|
void |
setNormal()
Make this value represent "normal" control flow.
|
void |
setTop()
Make this the special "top" dataflow value.
|
java.lang.String |
toString() |
and, andNot, cardinality, clear, clear, clear, clone, flip, flip, get, get, intersects, isEmpty, length, nextClearBit, nextSetBit, or, previousClearBit, previousSetBit, set, set, set, set, size, toByteArray, toLongArray, valueOf, valueOf, valueOf, valueOf, xor
public static final boolean CATCH
public static final boolean FINALLY
public int hashCode()
hashCode
in class java.util.BitSet
public boolean equals(java.lang.Object obj)
equals
in class java.util.BitSet
public boolean isValid()
public int getDepth()
public boolean getTopValue()
public boolean isNormal()
public void setNormal()
public boolean isTop()
public void setTop()
public boolean isBottom()
public void setBottom()
public void copyFrom(BlockType other)
other
- the other BlockType objectpublic boolean sameAs(BlockType other)
other
- the other BlockType objectpublic void mergeWith(BlockType other)
other
- the other BlockType valuepublic void pushCatch()
public void pushFinally()
public java.lang.String toString()
toString
in class java.util.BitSet
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.