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

Method newArrayType

output/java_guava/1.4.17/Types.java:68–82  ·  view source on GitHub ↗

Returns the array type of componentType.

(Type componentType)

Source from the content-addressed store, hash-verified

66 /** Returns the array type of {@code componentType}. */
67
68 static Type newArrayType(Type componentType) {
69 if (componentType instanceof WildcardType) {
70 WildcardType wildcard = (WildcardType) componentType;
71 Type[] lowerBounds = wildcard.getLowerBounds();
72 checkArgument(lowerBounds.length <= 1, "Wildcard cannot have more than one lower bounds.");
73 if (lowerBounds.length == 1) {
74 return supertypeOf(newArrayType(lowerBounds[0]));
75 } else {
76 Type[] upperBounds = wildcard.getUpperBounds();
77 checkArgument(upperBounds.length == 1, "Wildcard should have only one upper bound.");
78 return subtypeOf(newArrayType(upperBounds[0]));
79 }
80 }
81 return JavaVersion.CURRENT.newArrayType(componentType);
82 }
83
84 /**
85 * Returns a type where {@code rawType} is parameterized by {@code arguments} and is owned by

Callers 5

toGenericTypeMethod · 0.95
captureMethod · 0.95
newArrayTypeMethod · 0.45

Calls 5

supertypeOfMethod · 0.95
subtypeOfMethod · 0.95
getLowerBoundsMethod · 0.45
checkArgumentMethod · 0.45
getUpperBoundsMethod · 0.45

Tested by

no test coverage detected