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

Examples of org.eclipse.jdt.internal.compiler.lookup.VariableBinding


          VariableBinding[] vars = currentMethodScope.getEmulationPath(localBinding);
          if (vars == null) {
            return null;
          }
          assert (vars.length == 1);
          VariableBinding varBinding = vars[0];

          // See if there's an available parameter
          if (varBinding instanceof SyntheticArgumentBinding) {
            JType type = (JType) typeMap.get(varBinding.type);
            String name = String.valueOf(varBinding.name);
View Full Code Here


*/
public void complainOnDeferredChecks(FlowInfo flowInfo, BlockScope scope) {

  // check redundant final assignments
  for (int i = 0; i < this.assignCount; i++) {
    VariableBinding variable = this.finalVariables[i];
    if (variable == null) continue;

    boolean complained = false; // remember if have complained on this final assignment
    if (variable instanceof FieldBinding) {
      // final field
View Full Code Here

* @param flowInfo the flow info against which checks must be performed
*/
public void complainOnDeferredFinalChecks(BlockScope scope, FlowInfo flowInfo) {
  // complain on final assignments in loops
  for (int i = 0; i < this.assignCount; i++) {
    VariableBinding variable = this.finalVariables[i];
    if (variable == null) continue;
    boolean complained = false; // remember if have complained on this final assignment
    if (variable instanceof FieldBinding) {
      if (flowInfo.isPotentiallyAssigned((FieldBinding) variable)) {
        complained = true;
View Full Code Here

  if (this.binding.isValidBinding()) {
    switch (this.bits & ASTNode.RestrictiveFlagMASK) {
      case Binding.VARIABLE : // =========only variable============
      case Binding.VARIABLE | Binding.TYPE : //====both variable and type============
        if (this.binding instanceof VariableBinding) {
          VariableBinding variable = (VariableBinding) this.binding;
          TypeBinding variableType;
          if (this.binding instanceof LocalVariableBinding) {
            this.bits &= ~ASTNode.RestrictiveFlagMASK;  // clear bits
            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

    return ((VariableBinding)_binding).getAnnotations();
  }

  @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

*/
public void complainOnDeferredChecks(FlowInfo flowInfo, BlockScope scope) {

  // check redundant final assignments
  for (int i = 0; i < this.assignCount; i++) {
    VariableBinding variable = this.finalVariables[i];
    if (variable == null) continue;

    boolean complained = false; // remember if have complained on this final assignment
    if (variable instanceof FieldBinding) {
      // final field
View Full Code Here

* @param flowInfo the flow info against which checks must be performed
*/
public void complainOnDeferredFinalChecks(BlockScope scope, FlowInfo flowInfo) {
  // complain on final assignments in loops
  for (int i = 0; i < this.assignCount; i++) {
    VariableBinding variable = this.finalVariables[i];
    if (variable == null) continue;
    boolean complained = false; // remember if have complained on this final assignment
    if (variable instanceof FieldBinding) {
      if (flowInfo.isPotentiallyAssigned((FieldBinding)variable)) {
        complained = true;
View Full Code Here

*/
public void complainOnDeferredChecks(FlowInfo flowInfo, BlockScope scope) {

  // check redundant final assignments
  for (int i = 0; i < this.assignCount; i++) {
    VariableBinding variable = this.finalVariables[i];
    if (variable == null) continue;

    boolean complained = false; // remember if have complained on this final assignment
    if (variable instanceof FieldBinding) {
      // final field
View Full Code Here

  if ((nullStatus & FlowInfo.NULL) != 0) {
    nullityMismatchIsNull(expression, requiredType, annotationName);
    return;
  }
  if ((nullStatus & FlowInfo.POTENTIALLY_NULL) != 0) {
    VariableBinding var = expression.localVariableBinding();
    if (var == null && expression instanceof Reference) {
      var = ((Reference)expression).lastFieldBinding();
    }
    if (var != null && var.isNullable()) {
      nullityMismatchSpecdNullable(expression, requiredType, annotationName);
      return;
    }
    nullityMismatchPotentiallyNull(expression, requiredType, annotationName);
    return;
View Full Code Here

  if (this.binding.isValidBinding()) {
    switch (this.bits & ASTNode.RestrictiveFlagMASK) {
      case Binding.VARIABLE : // =========only variable============
      case Binding.VARIABLE | Binding.TYPE : //====both variable and type============
        if (this.binding instanceof VariableBinding) {
          VariableBinding variable = (VariableBinding) this.binding;
          TypeBinding variableType;
          if (this.binding instanceof LocalVariableBinding) {
            this.bits &= ~ASTNode.RestrictiveFlagMASK;  // clear bits
            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

Related Classes of org.eclipse.jdt.internal.compiler.lookup.VariableBinding

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.