Returns a new array of the given length with the specified component type. @param type the component type @param length the length of the new array
(Class<T> type, int length)
| 45 | */ |
| 46 | |
| 47 | @GwtIncompatible // Array.newInstance(Class, int) |
| 48 | @SuppressWarnings("unchecked") |
| 49 | public static <T> T[] newArray(Class<T> type, int length) { |
| 50 | return (T[]) Array.newInstance(type, length); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Returns a new array of the given length with the same type as a reference |
no test coverage detected