/** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method. */ public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments) { ReferenceBinding parameterizedType = this.environment.createParameterizedType(this.declaringClass, typeArguments, this.enclosingType); for (MethodBinding parameterizedMethod : parameterizedType.methods()) { if (parameterizedMethod.original() == this.staticFactoryFor) return (ParameterizedMethodBinding) parameterizedMethod; } throw new IllegalArgumentException("Type doesn't have its own method?"); //$NON-NLS-1$ } }
/** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method. */ public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments) { ReferenceBinding parameterizedType = this.environment.createParameterizedType(this.declaringClass, typeArguments, this.enclosingType); for (MethodBinding parameterizedMethod : parameterizedType.methods()) { if (parameterizedMethod.original() == this.staticFactoryFor) return (ParameterizedMethodBinding) parameterizedMethod; } throw new IllegalArgumentException("Type doesn't have its own method?"); //$NON-NLS-1$ } }
/** Apply the given type arguments on the (declaring class of the) actual constructor being represented by this factory method. */ public ParameterizedMethodBinding applyTypeArgumentsOnConstructor(TypeBinding[] typeArguments) { ReferenceBinding parameterizedType = this.environment.createParameterizedType(this.declaringClass, typeArguments, this.enclosingType); for (MethodBinding parameterizedMethod : parameterizedType.methods()) { if (parameterizedMethod.original() == this.staticFactoryFor) return (ParameterizedMethodBinding) parameterizedMethod; } throw new IllegalArgumentException("Type doesn't have its own method?"); //$NON-NLS-1$ } }
@Override public TypeBinding withoutToplevelNullAnnotation() { if (!hasNullTypeAnnotations()) return this; ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.type); AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations); return this.environment.createParameterizedType(unannotatedGenericType, this.arguments, this.enclosingType, newAnnotations); }
@Override public TypeBinding withoutToplevelNullAnnotation() { if (!hasNullTypeAnnotations()) return this; ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.type); AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations); return this.environment.createParameterizedType(unannotatedGenericType, this.arguments, this.enclosingType, newAnnotations); }
@Override public TypeBinding withoutToplevelNullAnnotation() { if (!hasNullTypeAnnotations()) return this; ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.type); AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations); return this.environment.createParameterizedType(unannotatedGenericType, this.arguments, this.enclosingType, newAnnotations); }
@Override public TypeBinding withoutToplevelNullAnnotation() { if (!hasNullTypeAnnotations()) return this; ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.type); AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations); return this.environment.createParameterizedType(unannotatedGenericType, this.arguments, this.enclosingType, newAnnotations); }
public ReferenceBinding maybeCreateParameterizedType(ReferenceBinding nonGenericType, ReferenceBinding enclosingType) { boolean canSeeEnclosingTypeParameters = enclosingType != null && (enclosingType.isParameterizedType() | enclosingType.isRawType()) && !nonGenericType.isStatic(); if (canSeeEnclosingTypeParameters) return createParameterizedType(nonGenericType, null, enclosingType); return nonGenericType; }
@Override public TypeBinding withoutToplevelNullAnnotation() { if (!hasNullTypeAnnotations()) return this; ReferenceBinding unannotatedGenericType = (ReferenceBinding) this.environment.getUnannotatedType(this.type); AnnotationBinding[] newAnnotations = this.environment.filterNullTypeAnnotations(this.typeAnnotations); return this.environment.createParameterizedType(unannotatedGenericType, this.arguments, this.enclosingType, newAnnotations); }
public ReferenceBinding maybeCreateParameterizedType(ReferenceBinding nonGenericType, ReferenceBinding enclosingType) { boolean canSeeEnclosingTypeParameters = enclosingType != null && (enclosingType.isParameterizedType() | enclosingType.isRawType()) && !nonGenericType.isStatic(); if (canSeeEnclosingTypeParameters) return createParameterizedType(nonGenericType, null, enclosingType); return nonGenericType; }
/** * Perform capture deconversion for a parameterized type with captured wildcard arguments * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#uncapture(Scope) */ public TypeBinding uncapture(Scope scope) { if ((this.tagBits & TagBits.HasCapturedWildcard) == 0) return this; int length = this.arguments == null ? 0 : this.arguments.length; TypeBinding[] freeTypes = new TypeBinding[length]; for (int i = 0; i < length; i++) { freeTypes[i] = this.arguments[i].uncapture(scope); } return scope.environment().createParameterizedType(this.type, freeTypes, (ReferenceBinding) (this.enclosingType != null ? this.enclosingType.uncapture(scope) : null), this.typeAnnotations); }
/** * Perform capture deconversion for a parameterized type with captured wildcard arguments * @see org.eclipse.jdt.internal.compiler.lookup.TypeBinding#uncapture(Scope) */ public TypeBinding uncapture(Scope scope) { if ((this.tagBits & TagBits.HasCapturedWildcard) == 0) return this; int length = this.arguments == null ? 0 : this.arguments.length; TypeBinding[] freeTypes = new TypeBinding[length]; for (int i = 0; i < length; i++) { freeTypes[i] = this.arguments[i].uncapture(scope); } return scope.environment().createParameterizedType(this.type, freeTypes, (ReferenceBinding) (this.enclosingType != null ? this.enclosingType.uncapture(scope) : null), this.typeAnnotations); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, withWildCards.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, withWildCards.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, genericType.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, withWildCards.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, withWildCards.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, withWildCards.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, genericType.enclosingType()); }
public ReferenceBinding findGroundTargetTypeForElidedLambda(BlockScope blockScope, ParameterizedTypeBinding withWildCards) { // non-wildcard parameterization (9.8) of the target type TypeBinding[] types = withWildCards.getNonWildcardParameterization(blockScope); if (types == null) return null; ReferenceBinding genericType = withWildCards.genericType(); return blockScope.environment().createParameterizedType(genericType, types, genericType.enclosingType()); }