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

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


        // Fall-through to failure
      }
    }

    if (binding instanceof TypeVariableBinding) {
      TypeVariableBinding tvBinding = (TypeVariableBinding) binding;
      JTypeParameter typeParameter = tvMapper.get(tvBinding);
      if (typeParameter != null) {
        return typeParameter;
      }
View Full Code Here


    return method.getType() == get(binding.returnType);
  }

  private JNode get(Binding binding, boolean failOnNull) {
    if (binding instanceof TypeVariableBinding) {
      TypeVariableBinding tvb = (TypeVariableBinding) binding;
      return get(tvb.erasure(), failOnNull);
    } else if (binding instanceof ParameterizedTypeBinding) {
      ParameterizedTypeBinding ptb = (ParameterizedTypeBinding) binding;
      return get(ptb.erasure(), failOnNull);
    } else if (binding instanceof ParameterizedMethodBinding) {
      ParameterizedMethodBinding pmb = (ParameterizedMethodBinding) binding;
View Full Code Here

    // if method from parameterized type got found, use the original method at codegen time
    MethodBinding codegenBinding = this.binding.original();
    if (codegenBinding != this.binding) {
        // extra cast needed if method return type was type variable
        if (codegenBinding.returnType.isTypeVariable()) {
            TypeVariableBinding variableReturnType = (TypeVariableBinding) codegenBinding.returnType;
            if (TypeBinding.notEquals(variableReturnType.firstBound, this.binding.returnType)) { // no need for extra cast if same as first bound anyway
            this.valueCast = this.binding.returnType;
            }
        }
    }
View Full Code Here

  if (typeBinding.isNestedType()) {
    classFile.recordInnerClasses(typeBinding);
  }
  TypeVariableBinding[] typeVariables = typeBinding.typeVariables();
  for (int i = 0, max = typeVariables.length; i < max; i++) {
    TypeVariableBinding typeVariableBinding = typeVariables[i];
    if ((typeVariableBinding.tagBits & TagBits.ContainsNestedTypeReferences) != 0) {
      Util.recordNestedType(classFile, typeVariableBinding);
    }
  }
View Full Code Here

          }
        }
      }
    } else if (typeBinding.isTypeVariable()
        && ((typeBinding.tagBits & TagBits.ContainsNestedTypeReferences) != 0)) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) typeBinding;
      TypeBinding upperBound = typeVariableBinding.upperBound();
      if (upperBound != null && ((upperBound.tagBits & TagBits.ContainsNestedTypeReferences) != 0)) {
        recordNestedType(classFile, upperBound);
      }
      TypeBinding[] upperBounds = typeVariableBinding.otherUpperBounds();
      if (upperBounds != null) {
        for (int k = 0, max3 =  upperBounds.length; k < max3; k++) {
          TypeBinding otherUpperBound = upperBounds[k];
          if ((otherUpperBound.tagBits & TagBits.ContainsNestedTypeReferences) != 0) {
            recordNestedType(classFile, otherUpperBound);
View Full Code Here

    if (typeBinding.isNestedType()) {
      classFile.recordInnerClasses(typeBinding);
    }
    TypeVariableBinding[] typeVariables = typeBinding.typeVariables();
    for (int i = 0, max = typeVariables.length; i < max; i++) {
      TypeVariableBinding typeVariableBinding = typeVariables[i];
      if ((typeVariableBinding.tagBits & TagBits.ContainsNestedTypeReferences) != 0) {
        Util.recordNestedType(classFile, typeVariableBinding);
      }
    }
    // add its fields
View Full Code Here

    int otherLength = otherBindings.length;
    if (length != otherLength) {
      return false;
    }
    for (int i = 0; i < length; i++) {
      TypeVariableBinding typeVariableBinding = bindings[i];
      TypeVariableBinding typeVariableBinding2 = otherBindings[i];
      if (!isEqual(typeVariableBinding, typeVariableBinding2)) {
        return false;
      }
    }
    return true;
View Full Code Here

            return isEqual(captureBinding.wildcard, captureBinding2.wildcard, visitedTypes)
              && isEqual(captureBinding.sourceType, captureBinding2.sourceType, visitedTypes);
          }
          return false;
        }
        TypeVariableBinding typeVariableBinding = (TypeVariableBinding) typeBinding;
        TypeVariableBinding typeVariableBinding2 = (TypeVariableBinding) typeBinding2;
        if (CharOperation.equals(typeVariableBinding.sourceName, typeVariableBinding2.sourceName)) {
          if (visitedTypes.contains(typeBinding)) return true;
          visitedTypes.add(typeBinding);

          return isEqual(typeVariableBinding.declaringElement, typeVariableBinding2.declaringElement, visitedTypes)
          && isEqual(typeVariableBinding.superclass(), typeVariableBinding2.superclass(), visitedTypes)
          && isEqual(typeVariableBinding.superInterfaces(), typeVariableBinding2.superInterfaces(), visitedTypes);
        }
        return false;
      case Binding.GENERIC_TYPE :
        if (!typeBinding2.isGenericType()) {
          return false;
View Full Code Here

    if (typeBinding.isNestedType()) {
      classFile.recordInnerClasses(typeBinding);
    }
    TypeVariableBinding[] typeVariables = typeBinding.typeVariables();
    for (int i = 0, max = typeVariables.length; i < max; i++) {
      TypeVariableBinding typeVariableBinding = typeVariables[i];
      if ((typeVariableBinding.tagBits & TagBits.ContainsNestedTypeReferences) != 0) {
        Util.recordNestedType(classFile, typeVariableBinding);
      }
    }
    // add its fields
View Full Code Here

  /* (non-Javadoc)
   * @see javax.lang.model.type.TypeVariable#getUpperBound()
   */
  @Override
  public TypeMirror getUpperBound() {
    TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this._binding;
    TypeBinding firstBound = typeVariableBinding.firstBound;
    ReferenceBinding[] superInterfaces = typeVariableBinding.superInterfaces;
    if (firstBound == null || superInterfaces.length == 0) {
      // no explicit bound
      return _env.getFactory().newTypeMirror(typeVariableBinding.upperBound());
    }
    if (firstBound != null && superInterfaces.length == 1 && superInterfaces[0] == firstBound) {
      // only one bound that is an interface
      return _env.getFactory().newTypeMirror(typeVariableBinding.upperBound());
    }
    return this._env.getFactory().newDeclaredType((TypeVariableBinding) this._binding);
  }
View Full Code Here

TOP

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

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.