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
- Specified by:
trueBlock
in interfaceControlFlowGraph.Block
-
falseBlock
- Specified by:
falseBlock
in interfaceControlFlowGraph.Block
-
exitBlock
- Specified by:
exitBlock
in interfaceControlFlowGraph.Block
-
isFinallyBlock
public boolean isFinallyBlock()- Specified by:
isFinallyBlock
in interfaceControlFlowGraph.Block
-
isCatchBlock
public boolean isCatchBlock()- Specified by:
isCatchBlock
in interfaceControlFlowGraph.Block
-
isDefaultBlock
public boolean isDefaultBlock()- Specified by:
isDefaultBlock
in interfaceControlFlowGraph.Block
-
addTrueSuccessor
-
addFalseSuccessor
-
addExitSuccessor
-
predecessors
- Specified by:
predecessors
in interfaceControlFlowGraph.Block
-
successors
- Specified by:
successors
in interfaceCFG.IBlock<Tree>
- Specified by:
successors
in interfaceControlFlowGraph.Block
-
exceptions
- Specified by:
exceptions
in interfaceControlFlowGraph.Block
-
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.- Specified by:
caseGroup
in interfaceControlFlowGraph.Block
-
setCaseGroup
-