MCPcopy Create free account
hub / github.com/antlr/codebuff / subtypeOfComponentType

Method subtypeOfComponentType

output/java_guava/1.4.18/Types.java:223–240  ·  view source on GitHub ↗

Returns ? extends X if any of bounds is a subtype of X[]; or null otherwise.

(Type[] bounds)

Source from the content-addressed store, hash-verified

221 */
222
223 @Nullable
224 private static Type subtypeOfComponentType(Type[] bounds) {
225 for (Type bound : bounds) {
226 Type componentType = getComponentType(bound);
227 if (componentType != null) {
228 // Only the first bound can be a class or array.
229 // Bounds after the first can only be interfaces.
230 if (componentType instanceof Class) {
231 Class<?> componentClass = (Class<?>) componentType;
232 if (componentClass.isPrimitive()) {
233 return componentClass;
234 }
235 }
236 return subtypeOf(componentType);
237 }
238 }
239 return null;
240 }
241
242 private static final class GenericArrayTypeImpl implements GenericArrayType, Serializable {
243

Callers 2

visitTypeVariableMethod · 0.95
visitWildcardTypeMethod · 0.95

Calls 3

getComponentTypeMethod · 0.95
subtypeOfMethod · 0.95
isPrimitiveMethod · 0.45

Tested by

no test coverage detected