private boolean needsLocalVariableTableEntry(final Type<?> localType) { return !localType.isEquivalentTo(erase(localType)) && !localType.isCompoundType(); }
private boolean needsLocalVariableTableEntry(final Type<?> localType) { return !localType.isEquivalentTo(localType.getErasedType()) && !localType.isCompoundType(); }
private boolean needsLocalVariableTableEntry(final Type<?> localType) { return !localType.isEquivalentTo(erase(localType)) && !localType.isCompoundType(); }
@Override public boolean equals(final Object obj) { final Type<?> other; return obj instanceof Type<?> && (other = (Type<?>)obj).isGenericParameter() == this.isGenericParameter() && other.isWildcardType() == this.isWildcardType() && other.isCompoundType() == this.isCompoundType() && isEquivalentTo(other); }
@Override public boolean equals(final Object obj) { final Type<?> other; return obj instanceof Type<?> && (other = (Type<?>)obj).isGenericParameter() == this.isGenericParameter() && other.isWildcardType() == this.isWildcardType() && other.isCompoundType() == this.isCompoundType() && isEquivalentTo(other); }
@Override public Type visitTypeParameter(final Type t, final Void ignored) { final Type bound = t.getExtendsBound(); if (!bound.isCompoundType() && !bound.isInterface()) { return bound; } return superType(bound); }
@Override public Type visitTypeParameter(final Type t, final Void ignored) { final Type bound = t.getExtendsBound(); if (!bound.isCompoundType() && !bound.isInterface()) { return bound; } return superType(bound); }
@Override public Type visitTypeParameter(final Type t, final Void ignored) { final Type bound = t.getExtendsBound(); if (!bound.isCompoundType() && !bound.isInterface()) { return bound; } return superType(bound); }
@Override public Boolean visitClassType(final Type t, final Void ignored) { if (t.isCompoundType()) { return Boolean.FALSE; } else { if (!t.isGenericType()) { return Boolean.TRUE; } for (final Type p : t.getTypeArguments()) { if (p.isUnbounded()) { return Boolean.FALSE; } } return Boolean.TRUE; } }
@Override public Boolean visitClassType(final Type t, final Void ignored) { if (t.isCompoundType()) { return Boolean.FALSE; } else { if (!t.isGenericType()) { return Boolean.TRUE; } for (final Type p : t.getTypeArguments()) { if (p.isUnbounded()) { return Boolean.FALSE; } } return Boolean.TRUE; } }
@Override public Boolean visitClassType(final Type t, final Void ignored) { if (t.isCompoundType()) { return Boolean.FALSE; } else { if (!t.isGenericType()) { return Boolean.TRUE; } for (final Type p : t.getTypeArguments()) { if (p.isUnbounded()) { return Boolean.FALSE; } } return Boolean.TRUE; } }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
public static ImmutableList<Type<?>> closure(final Type<?> t) { ImmutableList<Type<?>> cl = closureCache.get(t); if (cl == null) { final Type st = superType(t); if (!t.isCompoundType()) { if (st != null && st.getKind() == TypeKind.DECLARED) { cl = insert(closure(st), t); } else if (st != null && st.getKind() == TypeKind.TYPEVAR) { cl = closure(st).prepend(t); } else { cl = ImmutableList.<Type<?>>of(t); } } else { cl = closure(superType(t)); } for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { cl = union(cl, closure(l.head)); } closureCache.put(t, cl); } return cl; }
public static ImmutableList<Type<?>> closure(final Type<?> t) { ImmutableList<Type<?>> cl = closureCache.get(t); if (cl == null) { final Type st = superType(t); if (!t.isCompoundType()) { if (st != null && st.getKind() == TypeKind.DECLARED) { cl = insert(closure(st), t); } else if (st != null && st.getKind() == TypeKind.TYPEVAR) { cl = closure(st).prepend(t); } else { cl = ImmutableList.<Type<?>>of(t); } } else { cl = closure(superType(t)); } for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { cl = union(cl, closure(l.head)); } closureCache.put(t, cl); } return cl; }
public static ImmutableList<Type<?>> closure(final Type<?> t) { ImmutableList<Type<?>> cl = closureCache.get(t); if (cl == null) { final Type st = superType(t); if (!t.isCompoundType()) { if (st != null && st.getKind() == TypeKind.DECLARED) { cl = insert(closure(st), t); } else if (st != null && st.getKind() == TypeKind.TYPEVAR) { cl = closure(st).prepend(t); } else { cl = ImmutableList.<Type<?>>of(t); } } else { cl = closure(superType(t)); } for (ImmutableList<Type<?>> l = interfaces(t); l.nonEmpty(); l = l.tail) { cl = union(cl, closure(l.head)); } closureCache.put(t, cl); } return cl; }
public static boolean isSubtype(final Type t, final Type p, final boolean capture) { if (t == p) { return true; } if (p == null) { return false; } if (p == Types.Object) { return true; } if (p.isCompoundType()) { final Type baseType = p.getBaseType(); if (baseType != null && !isSubtype(t, baseType, capture)) { return false; } final TypeList interfaces = p.getExplicitInterfaces(); for (int i = 0, n = interfaces.size(); i < n; i++) { final Type type = interfaces.get(i); if (!isSubtype(t, type, capture)) { return false; } } return true; } final Type lower = lowerBound(p); if (p != lower) { return isSubtype(capture ? capture(t) : t, lower, false); } return IsSubtypeRelation.visit(capture ? capture(t) : t, p); }
public static boolean isSubtype(final Type t, final Type p, final boolean capture) { if (t == p) { return true; } if (p == null) { return false; } if (p == Types.Object) { return true; } if (p.isCompoundType()) { final Type baseType = p.getBaseType(); if (baseType != null && !isSubtype(t, baseType, capture)) { return false; } final TypeList interfaces = p.getExplicitInterfaces(); for (int i = 0, n = interfaces.size(); i < n; i++) { final Type type = interfaces.get(i); if (!isSubtype(t, type, capture)) { return false; } } return true; } final Type lower = lowerBound(p); if (p != lower) { return isSubtype(capture ? capture(t) : t, lower, false); } return IsSubtypeRelation.visit(capture ? capture(t) : t, p); }
if (p.isCompoundType()) { final Type baseType = p.getBaseType();