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

Method subtypeOfComponentType

output/java_guava/1.4.19/Types.java:222–239  ·  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

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

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