Determine whether the underlying type represents a wildcard without specific bounds (i.e., equal to
{@code ? extends Object}).
422678
private boolean isWildcardWithoutBounds() {
        if (this.type instanceof WildcardType) {
            WildcardType wt = (WildcardType) this.type;
            if (wt.getLowerBounds().length == 0) {
                Type[] upperBounds = wt.getUpperBounds();
                if (upperBounds.length == 0 || (upperBounds.length == 1 && Object.class == upperBounds[0])) {
                    return true;
                }
            }
        }
        return false;
    }
234622
public boolean appliesTo(ResolvedType type) {
    return hasWildcards(original)
            && wildcardMatch(type, original)
            || exactMatch(original, type);
  }
1174474
private static boolean isAssignableFrom(Type from, ParameterizedType to,
			Map<String, Type> typeVarMap) {

		if (from == null) {
			return false;
		}

		if (to.equals(from)) {
			return true;
		}

		// First figure out the class and any type information.
		Class<?> clazz = getRawType(from);
		ParameterizedType ptype = null;
		if (from instanceof ParameterizedType) {
			ptype = (ParameterizedType) from;
		}

		// Load up parameterized variable info if it was parameterized.
		if (ptype != null) {
			Type[] tArgs = ptype.getActualTypeArguments();
			TypeVariable<?>[] tParams = clazz.getTypeParameters();
			for (int i = 0; i < tArgs.length; i++) {
				Type arg = tArgs[i];
				TypeVariable<?> var = tParams[i];
				while (arg instanceof TypeVariable) {
					TypeVariable<?> v = (TypeVariable<?>) arg;
					arg = typeVarMap.get(v.getName());
				}
				typeVarMap.put(var.getName(), arg);
			}

			// check if they are equivalent under our current mapping.
			if (typeEquals(ptype, to, typeVarMap)) {
				return true;
			}
		}

		for (Type itype : clazz.getGenericInterfaces()) {
			if (isAssignableFrom(itype, to, new HashMap<String, Type>(
					typeVarMap))) {
				return true;
			}
		}

		// Interfaces didn't work, try the superclass.
		Type sType = clazz.getGenericSuperclass();
		if (isAssignableFrom(sType, to, new HashMap<String, Type>(typeVarMap))) {
			return true;
		}

		return false;
	}
396539
public static boolean isAssignableFrom(TypeReference<?> from, TypeReference<?> to) {
		if (from == null) {
			return false;
		}

		if (to.equals(from)) {
			return true;
		}

		if (to.getType() instanceof Class) {
			return to.getRawType().isAssignableFrom(from.getRawType());
		} else if (to.getType() instanceof ParameterizedType) {
			return isAssignableFrom(from.getType(), (ParameterizedType) to
					.getType(), new HashMap<String, Type>());
		} else if (to.getType() instanceof GenericArrayType) {
			return to.getRawType().isAssignableFrom(from.getRawType())
					&& isAssignableFrom(from.getType(), (GenericArrayType) to
							.getType());
		} else {
			throw new AssertionError("Unexpected Type : " + to);
		}
	}
10505
public static <T extends MethodDescription> ElementMatcher.Junction<T> isSetter(TypeDescription type) {
        return isSetter(is(type));
    }
746115
public static <T extends ParameterDescription> ElementMatcher.Junction<T> hasGenericType(ElementMatcher<? super TypeDescription.Generic> matcher) {
        return new MethodParameterTypeMatcher<T>(matcher);
    }
195517
static void checkTypes(ImmutableList<Type> types, Iterable<? extends Expression> exprs) {
    int size = Iterables.size(exprs);
    checkArgument(
        size == types.size(),
        "Supplied the wrong number of parameters. Expected %s, got %s",
        types.size(),
        size);
    // checkIsAssignableTo is an no-op if DEBUG is false
    if (Flags.DEBUG) {
      int i = 0;
      for (Expression expr : exprs) {
        expr.checkAssignableTo(types.get(i), "Parameter %s", i);
        i++;
      }
    }
  }
662935
public static TypeMirror upperBound(Elements elements, TypeMirror type) {
    if (type.getKind() == TypeKind.WILDCARD) {
      WildcardType wildcard = (WildcardType) type;
      type = wildcard.getExtendsBound();
      if (type == null) {
        type = elements.getTypeElement(Object.class.getName()).asType();
      }
    }
    return type;
  }
155443
public boolean containsOfType(final Class<? extends Tag> type) {
	read.lock();
	try {
	    return tags.containsKey(type);
	} finally {
	    read.unlock();
	}
    }
1019959
static String getTypeVariableDefinition(TypeVariable variable)
      throws NoSourceNameException {
    Type[] bounds = variable.getBounds();
    if (bounds.length == 0 || (bounds.length == 1 && bounds[0].equals(Object.class))) {
      return variable.getName();
    }
    return getBoundedSourceName(variable.getName(), bounds, "extends");
  }
265153
@Override
    public boolean containsWithinBounds(Object value) {
        if (value instanceof Comparable) {
            final int result = compareTo(from, (Comparable) value);
            return result == 0 || result < 0 && compareTo(to, (Comparable) value) >= 0;
        }
        return contains(value);
    }
1235828
@Override
    public boolean isEligibleFor(Object value) {
        return Class.class.isInstance(value)
            && ((Class<?>) value)
                .isAssignableFrom((Class<?>) defaultCriterion());
    }
1219161
public com.sun.javadoc.Type[] extendsBounds() {
        return TypeMaker.getTypes(env, getExtendsBounds((Type.WildcardType)type));
    }
1351686
private boolean isCollection(Class<?> rawType) {

    // this sucks... is there really no way to work around this in GWT?
    // http://code.google.com/p/google-web-toolkit/issues/detail?id=4663
    if (rawType == Collection.class) {
      return true;
    }
    if (rawType == List.class) {
      return true;
    }
    if (rawType == Set.class) {
      return true;
    }
    Class<?> superType = rawType;
    while (superType != null) {
      if (superType == AbstractCollection.class) {
        return true;
      }
      superType = superType.getSuperclass();
    }
    return false;
  }
664463
private boolean compareTypesOld(Type parmType, Type argType) {
        // XXX equality not implemented for GenericObjectType
        // if (parmType.equals(argType)) return true;
        // Compare type signatures instead
        if (GenericUtilities.getString(parmType).equals(GenericUtilities.getString(argType))) {
            return true;
        }

        if (parmType instanceof GenericObjectType) {
            GenericObjectType o = (GenericObjectType) parmType;
            if (o.getTypeCategory() == GenericUtilities.TypeCategory.WILDCARD_EXTENDS) {
                return compareTypesOld(o.getExtension(), argType);
            }
        }
        // ignore type variables for now
        if (parmType instanceof GenericObjectType && !((GenericObjectType) parmType).hasParameters()) {
            return true;
        }
        if (argType instanceof GenericObjectType && !((GenericObjectType) argType).hasParameters()) {
            return true;
        }

        // Case: Both are generic containers
        if (parmType instanceof GenericObjectType && argType instanceof GenericObjectType) {
            return true;
        } else {
            // Don't consider non reference types (should not be possible)
            if (!(parmType instanceof ReferenceType && argType instanceof ReferenceType)) {
                return true;
            }

            // Don't consider non object types (for now)
            if (!(parmType instanceof ObjectType && argType instanceof ObjectType)) {
                return true;
            }

            // Otherwise, compare base types ignoring generic information
            try {
                return Repository.instanceOf(((ObjectType) argType).getClassName(), ((ObjectType) parmType).getClassName());
            } catch (ClassNotFoundException e) {
            }
        }

        return true;
    }
744162
protected boolean needsNumberTypePattern(List<Class<?>> pathParamTypeList, Map<Integer, Class<?>> optionalGenericTypeMap,
            int parameterIndex) {
        if (pathParamTypeList.size() <= parameterIndex) {
            return false; // different count of parameters will be checked later so only avoid out-of-index here
        }
        final Class<?> parameterType = pathParamTypeList.get(parameterIndex);
        if (Number.class.isAssignableFrom(parameterType)) {
            return true;
        }
        if (parameterType.isPrimitive() && Stream.of(long.class, int.class, short.class, byte.class, double.class, float.class)
                .anyMatch(numType -> numType.isAssignableFrom(parameterType))) { // from pull request #55 (thanks!)
            return true;
        }
        final Class<?> genericType = optionalGenericTypeMap.get(parameterIndex);
        return genericType != null && Number.class.isAssignableFrom(genericType);
    }
946391
public static <T extends MethodDescription> ElementMatcher.Junction<T> isGetter(Class<?> type) {
        return isGetter(TypeDescription.ForLoadedType.of(type));
    }