/**
   * When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound
   * lazily)
   */
  public WildcardBinding(
      ReferenceBinding genericType,
      int rank,
      TypeBinding bound,
      TypeBinding[] otherBounds,
      int boundKind,
      LookupEnvironment environment) {
    this.rank = rank;
    this.boundKind = boundKind;
    this.modifiers =
        ClassFileConstants.AccPublic
            | ExtraCompilerModifiers.AccGenericSignature; // treat wildcard as public
    this.environment = environment;
    initialize(genericType, bound, otherBounds);

    //		if (!genericType.isGenericType() && !(genericType instanceof UnresolvedReferenceBinding)) {
    //			RuntimeException e = new RuntimeException("WILDCARD with NON GENERIC");
    //			e.printStackTrace();
    //			throw e;
    //		}
    if (genericType instanceof UnresolvedReferenceBinding)
      ((UnresolvedReferenceBinding) genericType).addWrapper(this, environment);
    if (bound instanceof UnresolvedReferenceBinding)
      ((UnresolvedReferenceBinding) bound).addWrapper(this, environment);
    this.tagBits |= TagBits.HasUnresolvedTypeVariables; // cleared in resolve()
  }
Ejemplo n.º 2
0
 /**
  * When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound
  * lazily)
  */
 public WildcardBinding(
     ReferenceBinding genericType,
     int rank,
     TypeBinding bound,
     TypeBinding[] otherBounds,
     int boundKind,
     LookupEnvironment environment) {
   this.rank = rank;
   this.boundKind = boundKind;
   this.modifiers =
       ClassFileConstants.AccPublic
           | ExtraCompilerModifiers.AccGenericSignature; // treat wildcard as public
   this.environment = environment;
   initialize(genericType, bound, otherBounds);
   if (genericType instanceof UnresolvedReferenceBinding)
     ((UnresolvedReferenceBinding) genericType).addWrapper(this, environment);
   if (bound instanceof UnresolvedReferenceBinding)
     ((UnresolvedReferenceBinding) bound).addWrapper(this, environment);
   this.tagBits |= TagBits.HasUnresolvedTypeVariables; // cleared in resolve()
   this.typeBits = TypeIds.BitUninitialized;
 }
Ejemplo n.º 3
0
 public ArrayBinding(TypeBinding type, int dimensions, LookupEnvironment environment) {
   this.tagBits |= TagBits.IsArrayType;
   this.leafComponentType = type;
   this.dimensions = dimensions;
   this.environment = environment;
   if (type instanceof UnresolvedReferenceBinding)
     ((UnresolvedReferenceBinding) type).addWrapper(this, environment);
   else
     this.tagBits |=
         type.tagBits
             & (TagBits.HasTypeVariable | TagBits.HasDirectWildcard | TagBits.HasMissingType);
 }