Package org.sonar.java.cfg
Class CFG.Block
java.lang.Object
org.sonar.java.cfg.CFG.Block
- All Implemented Interfaces:
CFG.IBlock<Tree>
,ControlFlowGraph.Block
- Enclosing class:
- CFG
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addExitSuccessor(CFG.Block block)
void
addFalseSuccessor(CFG.Block successor)
void
addTrueSuccessor(CFG.Block successor)
Label is used to contain additional information about a block which is not directly related to CFG structure.elements()
int
id()
boolean
boolean
boolean
boolean
boolean
void
setCaseGroup(CaseGroupTree caseGroup)
This method makes the implementation of RSPEC-3626 almost trivial.
-
Field Details
-
IS_CATCH_BLOCK
-
-
Constructor Details
-
Block
public Block(int id)
-
-
Method Details
-
id
public int id()- Specified by:
id
in interfaceCFG.IBlock<Tree>
- Specified by:
id
in interfaceControlFlowGraph.Block
-
elements
- Specified by:
elements
in interfaceCFG.IBlock<Tree>
- Specified by:
elements
in interfaceControlFlowGraph.Block
-
trueBlock
-
falseBlock
-
exitBlock
-
isFinallyBlock
public boolean isFinallyBlock() -
isCatchBlock
public boolean isCatchBlock() -
isDefaultBlock
public boolean isDefaultBlock() -
addTrueSuccessor
-
addFalseSuccessor
-
addExitSuccessor
-
predecessors
-
successors
- Specified by:
successors
in interfaceCFG.IBlock<Tree>
- Specified by:
successors
in interfaceControlFlowGraph.Block
-
exceptions
-
terminator
- Specified by:
terminator
in interfaceCFG.IBlock<Tree>
- Specified by:
terminator
in interfaceControlFlowGraph.Block
-
isInactive
public boolean isInactive() -
isMethodExitBlock
public boolean isMethodExitBlock() -
successorWithoutJump
This method makes the implementation of RSPEC-3626 almost trivial.- Returns:
- the block which would be the successor of this one if this one didn't terminate with a jump
-
caseGroup
Label is used to contain additional information about a block which is not directly related to CFG structure. Used for simplifying implementation of RSPEC-128. -
setCaseGroup
-