Package org.eclipse.jdt.internal.compiler.lookup

Examples of org.eclipse.jdt.internal.compiler.lookup.VariableBinding.constant()


            this.bits |= Binding.LOCAL;
            if (!variable.isFinal() && (this.bits & ASTNode.DepthMASK) != 0) {
              scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
            }
            variableType = variable.type;
            this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant() : Constant.NotAConstant;
          } else {
            // a field
            variableType = checkFieldAccess(scope);
          }
          // perform capture conversion if read access
View Full Code Here


            this.bits |= Binding.LOCAL;
            if (!variable.isFinal() && (this.bits & ASTNode.DepthMASK) != 0) {
              scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
            }
            variableType = variable.type;
            this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant() : Constant.NotAConstant;
          } else {
            // a field
            variableType = checkFieldAccess(scope);
          }
          // perform capture conversion if read access
View Full Code Here

  }

  @Override
  public Object getConstantValue() {
    VariableBinding variableBinding = (VariableBinding) _binding;
    Constant constant = variableBinding.constant();
    if (constant == null || constant == Constant.NotAConstant) return null;
    TypeBinding type = variableBinding.type;
    switch (type.id) {
      case TypeIds.T_boolean:
        return constant.booleanValue();
View Full Code Here

            this.bits |= Binding.LOCAL;
            if (!variable.isFinal() && (this.bits & ASTNode.DepthMASK) != 0) {
              scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
            }
            variableType = variable.type;
            this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant() : Constant.NotAConstant;
          } else {
            // a field
            variableType = checkFieldAccess(scope);
          }
          // perform capture conversion if read access
View Full Code Here

            if (!variable.isFinal() && (this.bits & ASTNode.IsCapturedOuterLocal) != 0) {
              if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8) // for 8, defer till effective finality could be ascertained.
                scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
            }
            variableType = variable.type;
            this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant() : Constant.NotAConstant;
          } else {
            // a field
            variableType = checkFieldAccess(scope);
          }
          // perform capture conversion if read access
View Full Code Here

            this.bits |= Binding.LOCAL;
            if (!variable.isFinal() && (this.bits & ASTNode.DepthMASK) != 0) {
              scope.problemReporter().cannotReferToNonFinalOuterLocal((LocalVariableBinding)variable, this);
            }
            variableType = variable.type;
            this.constant = (this.bits & ASTNode.IsStrictlyAssigned) == 0 ? variable.constant() : Constant.NotAConstant;
          } else {
            // a field
            variableType = checkFieldAccess(scope);
          }
          // perform capture conversion if read access
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.