Class Statement

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode
org.aspectj.org.eclipse.jdt.internal.compiler.ast.Statement
  • Field Details

  • Constructor Details

    • Statement

      public Statement()
  • Method Details

    • isKnowDeadCodePattern

      protected static boolean isKnowDeadCodePattern(Expression expression)
      Answers true if the if is identified as a known coding pattern which should be tolerated by dead code analysis. e.g. if (DEBUG) print(); // no complaint Only invoked when overall condition is known to be optimizeable into false/true.
    • analyseCode

      public abstract FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo)
    • doesNotCompleteNormally

      public boolean doesNotCompleteNormally()
      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.)
      See Also:
    • completesByContinue

      public boolean completesByContinue()
      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.
    • analyseArguments

      protected void analyseArguments(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo, MethodBinding methodBinding, Expression[] arguments)
      Analysing arguments of MessageSend, ExplicitConstructorCall, AllocationExpression.
    • checkAgainstNullTypeAnnotation

      protected void checkAgainstNullTypeAnnotation(BlockScope scope, TypeBinding requiredType, Expression expression, FlowContext flowContext, FlowInfo flowInfo)
    • enclosingSwitchExpression

      public SwitchExpression enclosingSwitchExpression(Scope current)
      Returns the immediately enclosing switch expression (carried by closest blockScope),
    • branchChainTo

      public void branchChainTo(BranchLabel label)
      INTERNAL USE ONLY. This is used to redirect inter-statements jumps.
    • breaksOut

      public boolean breaksOut(char[] label)
    • continuesAtOuterLabel

      public boolean continuesAtOuterLabel()
    • complainIfUnreachable

      public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previousComplaintLevel, boolean endOfBlock)
    • generateArguments

      public void generateArguments(MethodBinding binding, Expression[] arguments, BlockScope currentScope, CodeStream codeStream)
      Generate invocation arguments, considering varargs methods
    • generateCode

      public abstract void generateCode(BlockScope currentScope, CodeStream codeStream)
    • isBoxingCompatible

      public boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope)
    • isEmptyBlock

      public boolean isEmptyBlock()
    • isTrulyExpression

      public boolean isTrulyExpression()
    • isValidJavaStatement

      public boolean isValidJavaStatement()
    • print

      public StringBuilder print(int indent, StringBuilder output)
      Specified by:
      print in class ASTNode
    • printStatement

      public abstract StringBuilder printStatement(int indent, StringBuilder output)
    • resolve

      public abstract void resolve(BlockScope scope)
    • bindingsWhenTrue

      public LocalVariableBinding[] bindingsWhenTrue()
    • bindingsWhenFalse

      public LocalVariableBinding[] bindingsWhenFalse()
    • bindingsWhenComplete

      public LocalVariableBinding[] bindingsWhenComplete()
    • resolveWithBindings

      public void resolveWithBindings(LocalVariableBinding[] bindings, BlockScope scope)
    • containsPatternVariable

      public boolean containsPatternVariable()
    • containsPatternVariable

      public boolean containsPatternVariable(boolean includeUnnamedOnes)
    • invocationTargetType

      public TypeBinding invocationTargetType()
      Implementation of InvocationSite.invocationTargetType() suitable at this level. Subclasses should override as necessary.
      See Also:
      • invalid reference
        org.eclipse.jdt.internal.compiler.lookup.InvocationSite#invocationTargetType()
    • expectedType

      public TypeBinding expectedType()
      Simpler notion of expected type, suitable for code assist purposes.
    • getExpressionContext

      public ExpressionContext getExpressionContext()
    • findConstructorBinding

      protected MethodBinding findConstructorBinding(BlockScope scope, Invocation site, ReferenceBinding receiverType, TypeBinding[] argumentTypes)
      For all constructor invocations: find the constructor binding; if site.innersNeedUpdate() perform some post processing for those and produce any updates as side-effects into 'argumentTypes'.