Class SwitchStatement

All Implemented Interfaces:
Location, TypeConstants, TypeIds
Direct Known Subclasses:
SwitchExpression

public class SwitchStatement extends Expression
  • Field Details

  • Constructor Details

    • SwitchStatement

      public SwitchStatement()
  • Method Details

    • checkRecordCoverage

      public boolean checkRecordCoverage(List<org.aspectj.org.eclipse.jdt.internal.compiler.ast.SwitchStatement.TNode> tNodeList2)
    • checkRecordCoverage

      public boolean checkRecordCoverage(org.aspectj.org.eclipse.jdt.internal.compiler.ast.SwitchStatement.TNode node)
    • resolve

      public void resolve(BlockScope upperScope)
      Overrides:
      resolve in class Expression
    • reportMissingEnumConstantCase

      protected void reportMissingEnumConstantCase(BlockScope upperScope, FieldBinding enumConstant)
    • branchChainTo

      public void branchChainTo(BranchLabel label)
      Dispatch the call on its last statement.
      Overrides:
      branchChainTo in class Statement
    • needToCheckFlowInAbsenceOfDefaultBranch

      protected boolean needToCheckFlowInAbsenceOfDefaultBranch()
    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
      Overrides:
      analyseCode in class Expression
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream)
      Description copied from class: Expression
      Expression statements are plain expressions, however they generate like normal expressions with no value required.
      Overrides:
      generateCode in class Expression
      Parameters:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
    • isTrulyExpression

      public boolean isTrulyExpression()
      Overrides:
      isTrulyExpression in class Expression
    • doesNotCompleteNormally

      public boolean doesNotCompleteNormally()
      Description copied from class: Statement
      Lambda shape analysis: *Assuming* this is reachable, analyze if this completes normally i.e control flow can reach the textually next statement. For blocks, we don't perform intra-reachability analysis. We assume the lambda body is free of intrinsic control flow errors (if such errors exist they will not be flagged by this analysis, but are guaranteed to surface later on.)
      Overrides:
      doesNotCompleteNormally in class Statement
      See Also:
    • completesByContinue

      public boolean completesByContinue()
      Description copied from class: Statement
      Lambda shape analysis: *Assuming* this is reachable, analyze if this completes by continuing i.e control flow cannot reach the textually next statement. This is necessitated by the fact that continue claims to not complete normally. So this is necessary to discriminate between do { continue; } while (false); which completes normally and do { throw new Exception(); } while (false); which does not complete normally.
      Overrides:
      completesByContinue in class Statement
    • printStatement

      public StringBuilder printStatement(int indent, StringBuilder output)
      Overrides:
      printStatement in class Expression
    • printExpression

      public StringBuilder printExpression(int indent, StringBuilder output)
      Specified by:
      printExpression in class Expression
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope blockScope)
      Description copied from class: Expression
      Traverse an expression in the context of a blockScope
      Overrides:
      traverse in class Expression