Class ReturnStatement

All Implemented Interfaces:
TypeConstants, TypeIds
Direct Known Subclasses:
CodeSnippetReturnStatement, JavadocReturnStatement

public class ReturnStatement extends Statement
  • Field Details

  • Constructor Details

    • ReturnStatement

      public ReturnStatement(Expression expression, int sourceStart, int sourceEnd)
    • ReturnStatement

      public ReturnStatement(Expression expression, int sourceStart, int sourceEnd, boolean implicitReturn)
  • Method Details

    • analyseCode

      public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
      Specified by:
      analyseCode in class Statement
    • anylizeCloseableReturnExpression

      public static FlowInfo anylizeCloseableReturnExpression(Expression returnExpression, BlockScope scope, long owningTagBits, FlowContext flowContext, FlowInfo flowInfo)
    • 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:
    • generateCode

      public void generateCode(BlockScope currentScope, CodeStream codeStream)
      Return statement code generation generate the finallyInvocationSequence.
      Specified by:
      generateCode in class Statement
      Parameters:
      currentScope - org.eclipse.jdt.internal.compiler.lookup.BlockScope
      codeStream - org.eclipse.jdt.internal.compiler.codegen.CodeStream
    • generateReturnBytecode

      public void generateReturnBytecode(CodeStream codeStream)
      Dump the suitable return bytecode for a return statement
    • generateStoreSaveValueIfNecessary

      public void generateStoreSaveValueIfNecessary(Scope scope, CodeStream codeStream)
    • needValue

      public boolean needValue()
    • prepareSaveValueLocation

      public void prepareSaveValueLocation(TryStatement targetTryStatement)
    • printStatement

      public StringBuilder printStatement(int tab, StringBuilder output)
      Specified by:
      printStatement in class Statement
    • resolve

      public void resolve(BlockScope scope)
      Specified by:
      resolve in class Statement
    • traverse

      public void traverse(ASTVisitor visitor, BlockScope scope)
      Overrides:
      traverse in class ASTNode