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

Method getArrayClass

output/java_guava/1.4.18/Types.java:547–552  ·  view source on GitHub ↗

Returns the Class object of arrays with componentType.

(Class<?> componentType)

Source from the content-addressed store, hash-verified

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

Callers 2

visitGenericArrayTypeMethod · 0.95
newArrayTypeMethod · 0.45

Calls 1

newInstanceMethod · 0.45

Tested by

no test coverage detected