< prev index next >

src/com/sun/javatest/util/DynamicArray.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg

*** 105,115 **** return array2; if (array2 == null) return array1; ! Class type = array1.getClass().getComponentType(); int size = array1.length + array2.length; T[] newArray = (T[]) Array.newInstance(type, size); System.arraycopy(array1, 0, newArray, 0, array1.length); System.arraycopy(array2, 0, newArray, array1.length, array2.length); return newArray; --- 105,115 ---- return array2; if (array2 == null) return array1; ! Class<?> type = array1.getClass().getComponentType(); int size = array1.length + array2.length; T[] newArray = (T[]) Array.newInstance(type, size); System.arraycopy(array1, 0, newArray, 0, array1.length); System.arraycopy(array2, 0, newArray, array1.length, array2.length); return newArray;
*** 259,269 **** * Get the type of objects that the array is declared to hold. * * @param arr The array to examine. * @return The class of objects that the given array can hold. */ ! protected static Class getArrayClass(Object[] arr) { if(arr != null) { return arr.getClass().getComponentType(); } else { return null; } --- 259,269 ---- * Get the type of objects that the array is declared to hold. * * @param arr The array to examine. * @return The class of objects that the given array can hold. */ ! protected static Class<?> getArrayClass(Object[] arr) { if(arr != null) { return arr.getClass().getComponentType(); } else { return null; }
< prev index next >