Package org.eclipse.jdt.internal.compiler.flow

Examples of org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext


    // Process the lambda, taking care not to double report diagnostics. Don't expect any from resolve, Any from code generation should surface, but not those from flow analysis.
    implicitLambda.resolve(currentScope);
    IErrorHandlingPolicy oldPolicy = currentScope.problemReporter().switchErrorHandlingPolicy(silentErrorHandlingPolicy);
    try {
      implicitLambda.analyseCode(currentScope,
          new ExceptionHandlingFlowContext(null, this, Binding.NO_EXCEPTIONS, null, currentScope, FlowInfo.DEAD_END),
          UnconditionalFlowInfo.fakeInitializedFlowInfo(currentScope.outerMostMethodScope().analysisIndex, currentScope.referenceType().maxFieldCount));
    } finally {
      currentScope.problemReporter().switchErrorHandlingPolicy(oldPolicy);
    }
    SyntheticArgumentBinding[] outerLocals = this.receiverType.syntheticOuterLocalVariables();
View Full Code Here


          if ((typeParameter.binding.modifiers  & ExtraCompilerModifiers.AccLocallyUsed) == 0) {
            this.scope.problemReporter().unusedTypeParameter(typeParameter);           
          }
        }
      }
      ExceptionHandlingFlowContext methodContext =
        new ExceptionHandlingFlowContext(
          flowContext,
          this,
          this.binding.thrownExceptions,
          null,
          this.scope,
          FlowInfo.DEAD_END);

      // nullity and mark as assigned
      analyseArguments(flowInfo);

      if (this.binding.declaringClass instanceof MemberTypeBinding && !this.binding.declaringClass.isStatic()) {
        // method of a non-static member type can't be static.
        this.bits &= ~ASTNode.CanBeStatic;
      }
      // propagate to statements
      if (this.statements != null) {
        boolean enableSyntacticNullAnalysisForFields = this.scope.compilerOptions().enableSyntacticNullAnalysisForFields;
        int complaintLevel = (flowInfo.reachMode() & FlowInfo.UNREACHABLE) == 0 ? Statement.NOT_COMPLAINED : Statement.COMPLAINED_FAKE_REACHABLE;
        for (int i = 0, count = this.statements.length; i < count; i++) {
          Statement stat = this.statements[i];
          if ((complaintLevel = stat.complainIfUnreachable(flowInfo, this.scope, complaintLevel, true)) < Statement.COMPLAINED_UNREACHABLE) {
            flowInfo = stat.analyseCode(this.scope, methodContext, flowInfo);
          }
          if (enableSyntacticNullAnalysisForFields) {
            methodContext.expireNullCheckedFieldInfo();
          }
        }
      } else {
        // method with empty body should not be flagged as static.
        this.bits &= ~ASTNode.CanBeStatic;
      }
      // check for missing returning path
      TypeBinding returnTypeBinding = this.binding.returnType;
      if ((returnTypeBinding == TypeBinding.VOID) || isAbstract()) {
        if ((flowInfo.tagBits & FlowInfo.UNREACHABLE_OR_DEAD) == 0) {
          this.bits |= ASTNode.NeedFreeReturn;
        }
      } else {
        if (flowInfo != FlowInfo.DEAD_END) {
          this.scope.problemReporter().shouldReturn(returnTypeBinding, this);
        }
      }
      // check unreachable catch blocks
      methodContext.complainIfUnusedExceptionHandlers(this);
      // check unused parameters
      this.scope.checkUnusedParameters(this.binding);
      // check if the method could have been static
      if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0) {
        if(!this.binding.isOverriding() && !this.binding.isImplementing()) {
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.flow.ExceptionHandlingFlowContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.