/** * <p> * Returns an array containing the sole value of {@link Object} if {@link WildcardType#getUpperBounds()} returns an * empty array. Otherwise, it returns the result of <code>WildcardType.getUpperBounds()</code> passed into * {@link #normalizeUpperBounds}. * </p> * * @param wildcardType the subject wildcard type * @return a non-empty array containing the upper bounds of the wildcard type. */ static Type[] getImplicitUpperBounds(WildcardType wildcardType) { Type[] bounds = wildcardType.getUpperBounds(); return bounds.length == 0 ? new Type[] { Object.class } : normalizeUpperBounds(bounds); }
/** * <p> * Returns an array containing the sole type of {@link Object} if {@link TypeVariable#getBounds()} returns an empty * array. Otherwise, it returns the result of <code>TypeVariable.getBounds()</code> passed into * {@link #normalizeUpperBounds}. * </p> * * @param typeVariable the subject type variable * @return a non-empty array containing the bounds of the type variable. */ static Type[] getImplicitBounds(TypeVariable<?> typeVariable) { Type[] bounds = typeVariable.getBounds(); return bounds.length == 0 ? new Type[] { Object.class } : normalizeUpperBounds(bounds); }