private Type L(Type t) { while (t.isWildcardType()) { if (t.hasExtendsBound()) { return Type.Bottom; } else { t = t.getSuperBound(); } } return t; }
private Type L(Type t) { while (t.isWildcardType()) { if (t.hasExtendsBound()) { return Type.Bottom; } else { t = t.getSuperBound(); } } return t; }
private Type L(Type t) { while (t.isWildcardType()) { if (t.hasExtendsBound()) { return Type.Bottom; } else { t = t.getSuperBound(); } } return t; }
@Override public Type visitWildcardType(final Type t, final Void ignored) { return t.hasExtendsBound() ? Type.Bottom : visit(t.getSuperBound()); }
@Override public Type visitWildcardType(final Type t, final Void ignored) { return t.hasExtendsBound() ? Type.Bottom : visit(t.getSuperBound()); }
@Override public Boolean visitWildcardType(final Type type, final Type parameter) { return parameter.hasSuperBound() && !parameter.hasExtendsBound() && visit(type, upperBound(parameter)); }
@Override public Boolean visitWildcardType(final Type type, final Type parameter) { return parameter.hasSuperBound() && !parameter.hasExtendsBound() && visit(type, upperBound(parameter)); }
@Override public Boolean visitWildcardType(final Type type, final Type parameter) { return parameter.hasSuperBound() && !parameter.hasExtendsBound() && visit(type, upperBound(parameter)); }
private Type U(Type t) { while (t.isWildcardType()) { if (t.hasSuperBound()) { final Type lowerBound = t.getSuperBound(); if (lowerBound.hasExtendsBound()) { return lowerBound.getExtendsBound(); } return Types.Object; } t = t.getExtendsBound(); } return t; }
@Override public Type visitWildcardType(final Type t, final Void ignored) { if (t.hasSuperBound()) { final Type lowerBound = t.getSuperBound(); if (lowerBound.hasExtendsBound()) { return visit(lowerBound.getExtendsBound()); } return Types.Object; } else { return visit(t.getExtendsBound()); } }
@Override public Type visitWildcardType(final Type t, final Void ignored) { if (t.hasSuperBound()) { final Type lowerBound = t.getSuperBound(); if (lowerBound.hasExtendsBound()) { return visit(lowerBound.getExtendsBound()); } return Types.Object; } else { return visit(t.getExtendsBound()); } }
public static boolean isSameWildcard(final Type t, final Type p) { if (!p.isWildcardType() || !t.isWildcardType()) { return false; } if (p.isUnbounded()) { return t.isUnbounded(); } if (p.hasSuperBound()) { return t.hasSuperBound() && isSameType(p.getSuperBound(), t.getSuperBound()); } return p.hasExtendsBound() && t.hasExtendsBound() && isSameType(p.getExtendsBound(), t.getExtendsBound()); }
@Override public Type visitWildcardType(final Type t, final Void ignored) { if (t.hasSuperBound()) { final Type lowerBound = t.getSuperBound(); if (lowerBound.hasExtendsBound()) { return visit(lowerBound.getExtendsBound()); } return Types.Object; } else { return visit(t.getExtendsBound()); } }
@NotNull protected Type getUnderlyingTypeCore() { if (hasElementType()) { return getElementType(); } if (isGenericType()) { return getGenericTypeDefinition(); } if (hasExtendsBound()) { return getExtendsBound(); } return this; }
@Override public Void visitWildcardType(final Type source, final Type target) throws AdaptFailure { if (source.hasExtendsBound()) { adaptRecursive(upperBound(source), upperBound(target)); } else if (source.hasSuperBound()) { adaptRecursive(lowerBound(source), lowerBound(target)); } return null; }
@Override public Void visitWildcardType(final Type source, final Type target) throws AdaptFailure { if (source.hasExtendsBound()) { adaptRecursive(upperBound(source), upperBound(target)); } else if (source.hasSuperBound()) { adaptRecursive(lowerBound(source), lowerBound(target)); } return null; }
@Override public Void visitWildcardType(final Type source, final Type target) throws AdaptFailure { if (source.hasExtendsBound()) { adaptRecursive(upperBound(source), upperBound(target)); } else if (source.hasSuperBound()) { adaptRecursive(lowerBound(source), lowerBound(target)); } return null; }
@Override public Boolean visitWildcardType(final Type t, final Type p) { return isSameWildcard(t, p) || isCaptureOf(p, t) || ((t.hasExtendsBound() || isSubtypeNoCapture(L(t), lowerBound(p))) && (t.hasSuperBound() || isSubtypeNoCapture(upperBound(p), U(t)))); } };
@Override public Boolean visitWildcardType(final Type t, final Type p) { return isSameWildcard(t, p) || isCaptureOf(p, t) || ((t.hasExtendsBound() || isSubtypeNoCapture(L(t), lowerBound(p))) && (t.hasSuperBound() || isSubtypeNoCapture(upperBound(p), U(t)))); } };
@Override public Boolean visitWildcardType(final Type t, final Type p) { return isSameWildcard(t, p) || isCaptureOf(p, t) || ((t.hasExtendsBound() || isSubtypeNoCapture(L(t), lowerBound(p))) && (t.hasSuperBound() || isSubtypeNoCapture(upperBound(p), U(t)))); } };