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

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


      return get(pmb.original());
    } else if (binding instanceof ParameterizedFieldBinding) {
      ParameterizedFieldBinding pfb = (ParameterizedFieldBinding) binding;
      return get(pfb.original());
    } else if (binding instanceof WildcardBinding) {
      WildcardBinding wcb = (WildcardBinding) binding;
      return get(wcb.erasure());
    }
    JNode result = internalGet(binding);
    if (result == null) {
      InternalCompilerException ice = new InternalCompilerException(
          "Failed to get JNode");
View Full Code Here


      // Fall-through to failure
    }

    if (binding instanceof WildcardBinding) {
      WildcardBinding wcBinding = (WildcardBinding) binding;

      assert (wcBinding.otherBounds == null);

      BoundType boundType;
      JClassType typeBound;

      switch (wcBinding.boundKind) {
        case Wildcard.EXTENDS: {
          assert (wcBinding.bound != null);
          boundType = BoundType.EXTENDS;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.SUPER: {
          assert (wcBinding.bound != null);
          boundType = BoundType.SUPER;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.UNBOUND: {
          boundType = BoundType.UNBOUND;
          typeBound = (JClassType) resolveType(logger, wcBinding.erasure());
        }
          break;
        default:
          assert false : "WildcardBinding of unknown boundKind???";
          return null;
View Full Code Here

      // Fall-through to failure
    }

    if (binding instanceof WildcardBinding) {
      WildcardBinding wcBinding = (WildcardBinding) binding;

      assert (wcBinding.otherBounds == null);

      BoundType boundType;
      JClassType typeBound;

      switch (wcBinding.boundKind) {
        case Wildcard.EXTENDS: {
          assert (wcBinding.bound != null);
          boundType = BoundType.EXTENDS;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.SUPER: {
          assert (wcBinding.bound != null);
          boundType = BoundType.SUPER;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.UNBOUND: {
          boundType = BoundType.UNBOUND;
          typeBound = (JClassType) resolveType(logger, wcBinding.erasure());
        }
          break;
        default:
          assert false : "WildcardBinding of unknown boundKind???";
          return null;
View Full Code Here

      return get(pmb.original());
    } else if (binding instanceof ParameterizedFieldBinding) {
      ParameterizedFieldBinding pfb = (ParameterizedFieldBinding) binding;
      return get(pfb.original());
    } else if (binding instanceof WildcardBinding) {
      WildcardBinding wcb = (WildcardBinding) binding;
      return get(wcb.erasure());
    }
    JNode result = internalGet(binding);
    if (result == null) {
      InternalCompilerException ice = new InternalCompilerException(
          "Failed to get JNode");
View Full Code Here

      // Fall-through to failure
    }

    if (binding instanceof WildcardBinding) {
      WildcardBinding wcBinding = (WildcardBinding) binding;

      assert (wcBinding.otherBounds == null);

      BoundType boundType;
      JClassType typeBound;

      switch (wcBinding.boundKind) {
        case Wildcard.EXTENDS: {
          assert (wcBinding.bound != null);
          boundType = BoundType.EXTENDS;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.SUPER: {
          assert (wcBinding.bound != null);
          boundType = BoundType.SUPER;
          typeBound = (JClassType) resolveType(logger, wcBinding.bound);
        }
          break;
        case Wildcard.UNBOUND: {
          boundType = BoundType.UNBOUND;
          typeBound = (JClassType) resolveType(logger, wcBinding.erasure());
        }
          break;
        default:
          assert false : "WildcardBinding of unknown boundKind???";
          return null;
View Full Code Here

      return get(pmb.original(), failOnNull);
    } else if (binding instanceof ParameterizedFieldBinding) {
      ParameterizedFieldBinding pfb = (ParameterizedFieldBinding) binding;
      return get(pfb.original(), failOnNull);
    } else if (binding instanceof WildcardBinding) {
      WildcardBinding wcb = (WildcardBinding) binding;
      return get(wcb.erasure(), failOnNull);
    }
    JNode result = internalGet(binding, failOnNull);
    if (result == null && failOnNull) {
      InternalCompilerException ice = new InternalCompilerException(
          "Failed to get JNode");
View Full Code Here

      TypeBinding[] arguments = parameterizedTypeBinding.arguments;
      if (arguments != null) {
        for (int j = 0, max2 = arguments.length; j < max2; j++) {
          TypeBinding argument = arguments[j];
          if (argument.isWildcard()) {
            WildcardBinding wildcardBinding = (WildcardBinding) argument;
            TypeBinding bound = wildcardBinding.bound;
            if (bound != null
                && ((bound.tagBits & TagBits.ContainsNestedTypeReferences) != 0)) {
              recordNestedType(classFile, bound);
            }
            ReferenceBinding superclass = wildcardBinding.superclass();
            if (superclass != null
                && ((superclass.tagBits & TagBits.ContainsNestedTypeReferences) != 0)) {
              recordNestedType(classFile, superclass);
            }
            ReferenceBinding[] superInterfaces = wildcardBinding.superInterfaces();
            if (superInterfaces != null) {
              for (int k = 0, max3 =  superInterfaces.length; k < max3; k++) {
                ReferenceBinding superInterface = superInterfaces[k];
                if ((superInterface.tagBits & TagBits.ContainsNestedTypeReferences) != 0) {
                  recordNestedType(classFile, superInterface);
View Full Code Here

      case Binding.WILDCARD_TYPE :
        if (typeBinding2.kind() != Binding.WILDCARD_TYPE) {
          return false;
        }
        WildcardBinding wildcardBinding = (WildcardBinding) typeBinding;
        WildcardBinding wildcardBinding2 = (WildcardBinding) typeBinding2;
        return isEqual(wildcardBinding.bound, wildcardBinding2.bound, visitedTypes)
          && wildcardBinding.boundKind == wildcardBinding2.boundKind;

      case Binding.INTERSECTION_TYPE:
        if (typeBinding2.kind() != Binding.INTERSECTION_TYPE) {
          return false;
        }
        WildcardBinding intersectionBinding = (WildcardBinding) typeBinding;
        WildcardBinding intersectionBinding2 = (WildcardBinding) typeBinding2;
        return isEqual(intersectionBinding.bound, intersectionBinding2.bound, visitedTypes)
          && isEqual(intersectionBinding.otherBounds, intersectionBinding2.otherBounds, visitedTypes);

      case Binding.TYPE_PARAMETER :
        if (!(typeBinding2.isTypeVariable())) {
View Full Code Here

  /* (non-Javadoc)
   * @see javax.lang.model.type.WildcardType#getExtendsBound()
   */
  @Override
  public TypeMirror getExtendsBound() {
    WildcardBinding wildcardBinding = (WildcardBinding) this._binding;
    if (wildcardBinding.boundKind != Wildcard.EXTENDS) return null;
    TypeBinding bound = wildcardBinding.bound;
    if (bound == null) return null;
    return _env.getFactory().newTypeMirror(bound);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see javax.lang.model.type.TypeMirror#getKind()
   */
  @Override
  public TypeKind getKind() {
    WildcardBinding wildcardBinding = (WildcardBinding) _binding;
    if ((!wildcardBinding.isValidBinding() || ((wildcardBinding.tagBits & TagBits.HasMissingType) != 0))) {
      return TypeKind.ERROR;
    }
    return TypeKind.WILDCARD;
  }
View Full Code Here

TOP

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

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.