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

Method getArrayClass

output/java_guava/1.4.19/Types.java:546–551  ·  view source on GitHub ↗

Returns the Class object of arrays with componentType.

(Class<?> componentType)

Source from the content-addressed store, hash-verified

544
545
546 static Class<?> getArrayClass(Class<?> componentType) {
547 // TODO(user): This is not the most efficient way to handle generic
548 // arrays, but is there another way to extract the array class in a
549 // non-hacky way (i.e. using String value class names- "[L...")?
550 return Array.newInstance(componentType, 0).getClass();
551 }
552
553 // TODO(benyu): Once we are on Java 8, delete this abstraction
554

Callers 2

visitGenericArrayTypeMethod · 0.95
newArrayTypeMethod · 0.45

Calls 1

newInstanceMethod · 0.45

Tested by

no test coverage detected