public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) { if (this.upperBounds != null && this.upperBounds.length > 1) { for (int i = 0; i < this.upperBounds.length; i++) { TypeBinding candidate = this.upperBounds[i].findSuperTypeOriginatingFrom(otherType); if (candidate != null) return candidate; // TODO: maybe we should double check about multiple candidates here, // but upper bounds should be consistent so hopefully the first non-null candidate is good enough. } } return super.findSuperTypeOriginatingFrom(otherType); }
public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) { if (this.upperBounds != null && this.upperBounds.length > 1) { for (int i = 0; i < this.upperBounds.length; i++) { TypeBinding candidate = this.upperBounds[i].findSuperTypeOriginatingFrom(otherType); if (candidate != null) return candidate; // TODO: maybe we should double check about multiple candidates here, // but upper bounds should be consistent so hopefully the first non-null candidate is good enough. } } return super.findSuperTypeOriginatingFrom(otherType); }
public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) { if (this.upperBounds != null && this.upperBounds.length > 1) { for (int i = 0; i < this.upperBounds.length; i++) { TypeBinding candidate = this.upperBounds[i].findSuperTypeOriginatingFrom(otherType); if (candidate != null) return candidate; // TODO: maybe we should double check about multiple candidates here, // but upper bounds should be consistent so hopefully the first non-null candidate is good enough. } } return super.findSuperTypeOriginatingFrom(otherType); }
public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) { if (this.upperBounds != null && this.upperBounds.length > 1) { for (int i = 0; i < this.upperBounds.length; i++) { TypeBinding candidate = this.upperBounds[i].findSuperTypeOriginatingFrom(otherType); if (candidate != null) return candidate; // TODO: maybe we should double check about multiple candidates here, // but upper bounds should be consistent so hopefully the first non-null candidate is good enough. } } return super.findSuperTypeOriginatingFrom(otherType); }
public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) { if (this.upperBounds != null && this.upperBounds.length > 1) { for (int i = 0; i < this.upperBounds.length; i++) { TypeBinding candidate = this.upperBounds[i].findSuperTypeOriginatingFrom(otherType); if (candidate != null) return candidate; // TODO: maybe we should double check about multiple candidates here, // but upper bounds should be consistent so hopefully the first non-null candidate is good enough. } } return super.findSuperTypeOriginatingFrom(otherType); }
public TypeBinding findSuperTypeOriginatingFrom(TypeBinding otherType) { if (this.upperBounds != null && this.upperBounds.length > 1) { for (int i = 0; i < this.upperBounds.length; i++) { TypeBinding candidate = this.upperBounds[i].findSuperTypeOriginatingFrom(otherType); if (candidate != null) return candidate; // TODO: maybe we should double check about multiple candidates here, // but upper bounds should be consistent so hopefully the first non-null candidate is good enough. } } return super.findSuperTypeOriginatingFrom(otherType); }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types if (s.findSuperTypeOriginatingFrom(g) == null) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (this == targetType) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (this == targetType) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types if (s.findSuperTypeOriginatingFrom(g) == null) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types final TypeBinding superType = s.findSuperTypeOriginatingFrom(g); if (superType != null && !superType.isParameterizedType()) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types final TypeBinding superType = s.findSuperTypeOriginatingFrom(g); if (superType != null && !superType.isParameterizedType()) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types final TypeBinding superType = s.findSuperTypeOriginatingFrom(g); if (superType != null && !superType.isParameterizedType()) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
private boolean superOnlyRaw(TypeBinding g, TypeBinding s, LookupEnvironment env) { if (s instanceof InferenceVariable) return false; // inference has no super types final TypeBinding superType = s.findSuperTypeOriginatingFrom(g); if (superType != null && !superType.isParameterizedType()) return s.isCompatibleWith(env.convertToRawType(g, false)); return false; }
/** * Returns the type to use for generic cast, or null if none required */ public TypeBinding genericCast(TypeBinding targetType) { if (TypeBinding.equalsEquals(this, targetType)) return null; TypeBinding targetErasure = targetType.erasure(); // type var get replaced by upper bound if (erasure().findSuperTypeOriginatingFrom(targetErasure) != null) return null; return targetErasure; }
private boolean shouldGenerateImplicitLambda(BlockScope currentScope) { // these cases are either too complicated, impossible to handle or result in significant code duplication return (this.binding.isVarargs() || (isConstructorReference() && this.receiverType.syntheticOuterLocalVariables() != null && currentScope.methodScope().isStatic) || this.expectedType instanceof IntersectionCastTypeBinding || // marker interfaces require alternate meta factory. this.expectedType.findSuperTypeOriginatingFrom(currentScope.getJavaIoSerializable()) != null || // serialization support. this.requiresBridges()); // bridges. // To fix: We should opt for direct code generation wherever possible. }