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

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


          }
        }
      }
    } 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


  /* (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().newTypeMirror((TypeVariableBinding) this._binding);
  }
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

    return _bounds;
  }
 
  // This code is drawn from org.eclipse.jdt.core.dom.TypeBinding.getTypeBounds()
  private List<? extends TypeMirror> calculateBounds() {
    TypeVariableBinding typeVariableBinding = (TypeVariableBinding)_binding;
    ReferenceBinding varSuperclass = typeVariableBinding.superclass();
    TypeBinding firstClassOrArrayBound = typeVariableBinding.firstBound;
    int boundsLength = 0;
    boolean isFirstBoundATypeVariable = false;
    if (firstClassOrArrayBound != null) {
      if (firstClassOrArrayBound.isTypeVariable()) {
        isFirstBoundATypeVariable = true;
      }
      if (firstClassOrArrayBound == varSuperclass) {
        boundsLength++;
        if (firstClassOrArrayBound.isTypeVariable()) {
          isFirstBoundATypeVariable = true;
        }
      } else if (firstClassOrArrayBound.isArrayType()) { // capture of ? extends/super arrayType
        boundsLength++;
      } else {
        firstClassOrArrayBound = null;
      }
    }
    ReferenceBinding[] superinterfaces = typeVariableBinding.superInterfaces();
    int superinterfacesLength = 0;
    if (superinterfaces != null) {
      superinterfacesLength = superinterfaces.length;
      boundsLength += superinterfacesLength;
    }
View Full Code Here

      problemConstructor = (ProblemMethodBinding) targetConstructor;
      ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch;
      shownConstructor = substitutedConstructor.original();
      int augmentedLength = problemConstructor.parameters.length;
      TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2];
      TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1];
      TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
      System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2);
      this.handle(
        IProblem.GenericConstructorTypeArgumentMismatch,
        new String[] {
View Full Code Here

      problemMethod = (ProblemMethodBinding) method;
      ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
      shownMethod = substitutedMethod.original();
      int augmentedLength = problemMethod.parameters.length;
      TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2];
      TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1];
      TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
      System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2);
      this.handle(
        IProblem.GenericMethodTypeArgumentMismatch,
        new String[] {
View Full Code Here

      ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch;
      shownConstructor = substitutedConstructor.original();

      int augmentedLength = problemConstructor.parameters.length;
      TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2];
      TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1];
      TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
      System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2);

      this.handle(
        IProblem.JavadocGenericConstructorTypeArgumentMismatch,
View Full Code Here

      problemMethod = (ProblemMethodBinding) method;
      ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
      shownMethod = substitutedMethod.original();
      int augmentedLength = problemMethod.parameters.length;
      TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2];
      TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1];
      TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
      System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2);
      this.handle(
        IProblem.JavadocGenericMethodTypeArgumentMismatch,
        new String[] {
View Full Code Here

      problemConstructor = (ProblemMethodBinding) targetConstructor;
      ParameterizedGenericMethodBinding substitutedConstructor = (ParameterizedGenericMethodBinding) problemConstructor.closestMatch;
      shownConstructor = substitutedConstructor.original();
      int augmentedLength = problemConstructor.parameters.length;
      TypeBinding inferredTypeArgument = problemConstructor.parameters[augmentedLength-2];
      TypeVariableBinding typeParameter = (TypeVariableBinding) problemConstructor.parameters[augmentedLength-1];
      TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
      System.arraycopy(problemConstructor.parameters, 0, invocationArguments, 0, augmentedLength-2);
      this.handle(
        IProblem.GenericConstructorTypeArgumentMismatch,
        new String[] {
View Full Code Here

      problemMethod = (ProblemMethodBinding) method;
      ParameterizedGenericMethodBinding substitutedMethod = (ParameterizedGenericMethodBinding) problemMethod.closestMatch;
      shownMethod = substitutedMethod.original();
      int augmentedLength = problemMethod.parameters.length;
      TypeBinding inferredTypeArgument = problemMethod.parameters[augmentedLength-2];
      TypeVariableBinding typeParameter = (TypeVariableBinding) problemMethod.parameters[augmentedLength-1];
      TypeBinding[] invocationArguments = new TypeBinding[augmentedLength-2]; // remove extra info from the end
      System.arraycopy(problemMethod.parameters, 0, invocationArguments, 0, augmentedLength-2);
      this.handle(
        IProblem.GenericMethodTypeArgumentMismatch,
        new String[] {
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.