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

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


            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

   */
  public String getBinaryName() {
    if (this.binding.isCapture()) {
      return null; // no binary name for capture binding
    } else if (this.binding.isTypeVariable()) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      org.eclipse.jdt.internal.compiler.lookup.Binding declaring = typeVariableBinding.declaringElement;
      StringBuffer binaryName = new StringBuffer();
      switch(declaring.kind()) {
        case org.eclipse.jdt.internal.compiler.lookup.Binding.METHOD :
          MethodBinding methodBinding = (MethodBinding) declaring;
View Full Code Here

           */
          org.eclipse.jdt.internal.core.util.Util.log(e, "Could not retrieve declaring method"); //$NON-NLS-1$
        }
      }
    } else if (this.binding.isTypeVariable()) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      Binding declaringElement = typeVariableBinding.declaringElement;
      if (declaringElement instanceof MethodBinding) {
        try {
          return this.resolver.getMethodBinding((MethodBinding)declaringElement);
        } catch (RuntimeException e) {
View Full Code Here

           */
          org.eclipse.jdt.internal.core.util.Util.log(e, "Could not retrieve declaring class"); //$NON-NLS-1$
        }
      }
    } else if (this.binding.isTypeVariable()) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      Binding declaringElement = typeVariableBinding.isCapture() ? ((CaptureBinding) typeVariableBinding).sourceType : typeVariableBinding.declaringElement;
      if (declaringElement instanceof ReferenceBinding) {
        try {
          return this.resolver.getTypeBinding((ReferenceBinding)declaringElement);
        } catch (RuntimeException e) {
          /* in case a method cannot be resolvable due to missing jars on the classpath
View Full Code Here

      case Binding.TYPE_PARAMETER :
        if (isCapture()) {
          return NO_NAME;
        }
        TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
        return new String(typeVariableBinding.sourceName);

      case Binding.PARAMETERIZED_TYPE :
        ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBinding) this.binding;
        buffer = new StringBuffer();
View Full Code Here

      case Binding.TYPE_PARAMETER :
        if (isCapture()) {
          return NO_NAME;
        }
        TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
        return new String(typeVariableBinding.sourceName);

      case Binding.PARAMETERIZED_TYPE :
        if (this.binding.isLocalType()) {
          return NO_NAME;
View Full Code Here

  public ITypeBinding[] getTypeBounds() {
    if (this.bounds != null) {
      return this.bounds;
    }
    if (this.binding instanceof TypeVariableBinding) {
      TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      ReferenceBinding varSuperclass = typeVariableBinding.superclass();
      org.eclipse.jdt.internal.compiler.lookup.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

        return false;
      } else {
        return !referenceBinding.isBinaryBinding();
      }
    } else if (isTypeVariable()) {
      final TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding;
      final Binding declaringElement = typeVariableBinding.declaringElement;
      if (declaringElement instanceof MethodBinding) {
        MethodBinding methodBinding = (MethodBinding) declaringElement;
        return !methodBinding.declaringClass.isBinaryBinding();
      } else {
View Full Code Here

       typeVariableBindings = this.typeBinding.typeVariables();
     } else {
       return;
     }
     for (int i = 0, length = typeVariableBindings.length; i < length; i++) {
      TypeVariableBinding typeVariableBinding = typeVariableBindings[i];
      if (CharOperation.equals(typeVariableName, typeVariableBinding.sourceName())) {
        this.typeBinding = typeVariableBinding;
        return;
      }
    }
  }
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.