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

Examples of org.eclipse.jdt.internal.compiler.lookup.ElementValuePair$UnresolvedEnumConstant


  }

  public void resolveTypeExpecting(BlockScope scope, TypeBinding requiredType) {

    if (this.value == null) {
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }
    if (requiredType == null) {
      // fault tolerance: keep resolving
      if (this.value instanceof ArrayInitializer) {
        this.value.resolveTypeExpecting(scope, null);
      } else {
        this.value.resolveType(scope);
      }
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }

    this.value.setExpectedType(requiredType); // needed in case of generic method invocation
    TypeBinding valueType;
    if (this.value instanceof ArrayInitializer) {
      ArrayInitializer initializer = (ArrayInitializer) this.value;
      valueType = initializer.resolveTypeExpecting(scope, this.binding.returnType);
    } else if (this.value instanceof ArrayAllocationExpression) {
      scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
      this.value.resolveType(scope);
      valueType = null; // no need to pursue
    } else {
      valueType = this.value.resolveType(scope);
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248897
      ASTVisitor visitor = new ASTVisitor() {
        public boolean visit(SingleNameReference reference, BlockScope scop) {
          if (reference.binding instanceof LocalVariableBinding) {
            ((LocalVariableBinding) reference.binding).useFlag = LocalVariableBinding.USED;
          }
          return true;
        }
      };
      this.value.traverse(visitor, scope);
    }
    this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
    if (valueType == null)
      return;

    TypeBinding leafType = requiredType.leafComponentType();
    if (!(this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType)
View Full Code Here


    ElementValuePair[] internalPairs = this.binding.getElementValuePairs();
    int length = internalPairs.length;
    IMemberValuePairBinding[] pairs = length == 0 ? MemberValuePairBinding.NoPair : new MemberValuePairBinding[length];
    int counter = 0;
    for (int i = 0; i < length; i++) {
      ElementValuePair valuePair = internalPairs[i];
      if (valuePair.binding == null) continue;
      pairs[counter++] = this.bindingResolver.getMemberValuePairBinding(valuePair);
    }
    if (counter == 0) return MemberValuePairBinding.NoPair;
    if (counter != length) {
View Full Code Here

  }

  public void resolveTypeExpecting(BlockScope scope, TypeBinding requiredType) {

    if (this.value == null) {
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }
    if (requiredType == null) {
      // fault tolerance: keep resolving
      if (this.value instanceof ArrayInitializer) {
        this.value.resolveTypeExpecting(scope, null);
      } else {
        this.value.resolveType(scope);
      }
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }

    this.value.setExpectedType(requiredType); // needed in case of generic method invocation
    TypeBinding valueType;
    if (this.value instanceof ArrayInitializer) {
      ArrayInitializer initializer = (ArrayInitializer) this.value;
      valueType = initializer.resolveTypeExpecting(scope, this.binding.returnType);
    } else if (this.value instanceof ArrayAllocationExpression) {
      scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
      this.value.resolveType(scope);
      valueType = null; // no need to pursue
    } else {
      valueType = this.value.resolveType(scope);
    }
    this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
    if (valueType == null)
      return;

    TypeBinding leafType = requiredType.leafComponentType();
    if (!(this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType)
View Full Code Here

    final ElementValuePair[] elementValuePairs = annotationBinding.getElementValuePairs();
    final ElementValuePair[] elementValuePairs2 = annotationBinding2.getElementValuePairs();
    final int length = elementValuePairs.length;
    if (length != elementValuePairs2.length) return false;
    loop: for (int i = 0; i < length; i++) {
      ElementValuePair pair = elementValuePairs[i];
      // loop on the given pair to make sure one will match
      for (int j = 0; j < length; j++) {
        ElementValuePair pair2 = elementValuePairs2[j];
        if (pair.binding == pair2.binding) {
          if (pair.value == null) {
            if (pair2.value == null) {
              continue loop;
            }
View Full Code Here

    final ElementValuePair[] elementValuePairs = annotationBinding.getElementValuePairs();
    final ElementValuePair[] elementValuePairs2 = annotationBinding2.getElementValuePairs();
    final int length = elementValuePairs.length;
    if (length != elementValuePairs2.length) return false;
    loop: for (int i = 0; i < length; i++) {
      ElementValuePair pair = elementValuePairs[i];
      // loop on the given pair to make sure one will match
      for (int j = 0; j < length; j++) {
        ElementValuePair pair2 = elementValuePairs2[j];
        if (pair.binding == pair2.binding) {
          if (pair.value == null) {
            if (pair2.value == null) {
              continue loop;
            }
View Full Code Here

  }

  public void resolveTypeExpecting(final BlockScope scope, final TypeBinding requiredType) {

    if (this.value == null) {
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }
    if (requiredType == null) {
      // fault tolerance: keep resolving
      if (this.value instanceof ArrayInitializer) {
        this.value.resolveTypeExpecting(scope, null);
      } else {
        this.value.resolveType(scope);
      }
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }

    this.value.setExpectedType(requiredType); // needed in case of generic method invocation - looks suspect, generic method invocation here ???
    final TypeBinding valueType;
    if (this.value instanceof ArrayInitializer) {
      ArrayInitializer initializer = (ArrayInitializer) this.value;
      valueType = initializer.resolveTypeExpecting(scope, this.binding.returnType);
    } else if (this.value instanceof ArrayAllocationExpression) {
      scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
      this.value.resolveType(scope);
      valueType = null; // no need to pursue
    } else {
      valueType = this.value.resolveType(scope);
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248897
      ASTVisitor visitor = new ASTVisitor() {
        public boolean visit(SingleNameReference reference, BlockScope scop) {
          if (reference.binding instanceof LocalVariableBinding) {
            ((LocalVariableBinding) reference.binding).useFlag = LocalVariableBinding.USED;
          }
          return true;
        }
      };
      this.value.traverse(visitor, scope);
    }
    this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
    if (valueType == null)
      return;

    final TypeBinding leafType = requiredType.leafComponentType();
    // the next check may need deferring:
View Full Code Here

  }

  public void resolveTypeExpecting(BlockScope scope, TypeBinding requiredType) {

    if (this.value == null) {
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }
    if (requiredType == null) {
      // fault tolerance: keep resolving
      if (this.value instanceof ArrayInitializer) {
        this.value.resolveTypeExpecting(scope, null);
      } else {
        this.value.resolveType(scope);
      }
      this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
      return;
    }

    this.value.setExpectedType(requiredType); // needed in case of generic method invocation
    TypeBinding valueType;
    if (this.value instanceof ArrayInitializer) {
      ArrayInitializer initializer = (ArrayInitializer) this.value;
      valueType = initializer.resolveTypeExpecting(scope, this.binding.returnType);
    } else if (this.value instanceof ArrayAllocationExpression) {
      scope.problemReporter().annotationValueMustBeArrayInitializer(this.binding.declaringClass, this.name, this.value);
      this.value.resolveType(scope);
      valueType = null; // no need to pursue
    } else {
      valueType = this.value.resolveType(scope);
      // https://bugs.eclipse.org/bugs/show_bug.cgi?id=248897
      ASTVisitor visitor = new ASTVisitor() {
        public boolean visit(SingleNameReference reference, BlockScope scop) {
          if (reference.binding instanceof LocalVariableBinding) {
            ((LocalVariableBinding) reference.binding).useFlag = LocalVariableBinding.USED;
          }
          return true;
        }
      };
      this.value.traverse(visitor, scope);
    }
    this.compilerElementPair = new ElementValuePair(this.name, this.value, this.binding);
    if (valueType == null)
      return;

    TypeBinding leafType = requiredType.leafComponentType();
    if (!(this.value.isConstantValueOfTypeAssignableToType(valueType, requiredType)
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.lookup.ElementValuePair$UnresolvedEnumConstant

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.