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

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


  }
 
  @Override
  public TypeKind getKind()
  {
    TypeVariableBinding variableBinding = (TypeVariableBinding) _binding;
    if ((!variableBinding.isValidBinding() || ((variableBinding.tagBits & TagBits.HasMissingType) != 0))) {
      return TypeKind.ERROR;
    }
    return TypeKind.TYPEVAR;
  }
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

      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

    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;
    if (firstClassOrArrayBound != null) {
      if (firstClassOrArrayBound == varSuperclass) {
        boundsLength++;
      } 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

    // 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 (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

    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

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.