This commit is contained in:
Gary Gregory 2021-07-27 12:50:18 -04:00
parent e9e041b791
commit f5bc042503
1 changed files with 4 additions and 3 deletions

View File

@ -4206,14 +4206,15 @@ public static int indexOf(final int[] array, final int valueToFind, int startInd
* Delegates to {@link Array#newInstance(Class,int)} using generics.
*
* @param <T> The array type.
* @param type The array class.
* @param componentType The array class.
* @param length the array length
* @return The new array.
* @exception NullPointerException if the specified {@code componentType} parameter is null.
* @since 3.13.0
*/
@SuppressWarnings("unchecked") // OK, because array and values are of type T
public static <T> T[] newInstance(final Class<T> type, final int length) {
return (T[]) Array.newInstance(type, length);
public static <T> T[] newInstance(final Class<T> componentType, final int length) {
return (T[]) Array.newInstance(componentType, length);
}
/**