Class FinalLocalVariableCheck.ThrowingBranch

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.coding.FinalLocalVariableCheck.ThrowingBranch
Enclosing class:
FinalLocalVariableCheck

private static final class FinalLocalVariableCheck.ThrowingBranch extends Object
Assignment state for a conditional branch that cannot complete normally.
  • Field Details

  • Constructor Details

  • Method Details

    • isThrowingBranch

      private static boolean isThrowingBranch(DetailAST ast)
      Checks for a block ending in a throw outside exception handlers. Enclosing try statements are excluded because a handler can resume execution.
      Parameters:
      ast - block to inspect
      Returns:
      whether assignments in the block cannot reach following statements
    • restore

      private void restore()
      Restores assignment state on the path that does not enter the branch.