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

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ElementValuePair


  }
 
  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

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ElementValuePair

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.