Class CFG.Block

java.lang.Object
org.sonar.java.cfg.CFG.Block
All Implemented Interfaces:
CFG.IBlock<Tree>, ControlFlowGraph.Block
Enclosing class:
CFG

public static class CFG.Block extends Object implements CFG.IBlock<Tree>, ControlFlowGraph.Block
  • Field Details

  • Constructor Details

    • Block

      public Block(int id)
  • Method Details

    • id

      public int id()
      Specified by:
      id in interface CFG.IBlock<Tree>
      Specified by:
      id in interface ControlFlowGraph.Block
    • elements

      public List<Tree> elements()
      Specified by:
      elements in interface CFG.IBlock<Tree>
      Specified by:
      elements in interface ControlFlowGraph.Block
    • trueBlock

      public CFG.Block trueBlock()
    • falseBlock

      public CFG.Block falseBlock()
    • exitBlock

      public CFG.Block exitBlock()
    • isFinallyBlock

      public boolean isFinallyBlock()
    • isCatchBlock

      public boolean isCatchBlock()
    • isDefaultBlock

      public boolean isDefaultBlock()
    • addTrueSuccessor

      public void addTrueSuccessor(CFG.Block successor)
    • addFalseSuccessor

      public void addFalseSuccessor(CFG.Block successor)
    • addExitSuccessor

      public void addExitSuccessor(CFG.Block block)
    • predecessors

      public Set<CFG.Block> predecessors()
    • successors

      public Set<CFG.Block> successors()
      Specified by:
      successors in interface CFG.IBlock<Tree>
      Specified by:
      successors in interface ControlFlowGraph.Block
    • exceptions

      public Set<CFG.Block> exceptions()
    • terminator

      @CheckForNull public Tree terminator()
      Specified by:
      terminator in interface CFG.IBlock<Tree>
      Specified by:
      terminator in interface ControlFlowGraph.Block
    • isInactive

      public boolean isInactive()
    • isMethodExitBlock

      public boolean isMethodExitBlock()
    • successorWithoutJump

      @CheckForNull public CFG.Block 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

      @CheckForNull public CaseGroupTree 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

      public void setCaseGroup(CaseGroupTree caseGroup)