ArrayUtil provides copySubArray() as replacement of Array.copyOf and Array.copyOfRange (with better bounds check). Unfortunately ArrayUtil does not provide copyArray(), so it is weird for callers to have to call a method named copySubArray() when we want to copy the full array.
This PR adds ArrayUtil.copyArray(), and replaces the calls to ArrayUtil.copySubArray(array, 0, array.length) with calls to ArrayUtil.copyArray(array).
I used the following regex to match all calls:
copyOfSubArray\(([^,]+), 0, \1\.length\)
and this one to replace
copyArray($1)
ArrayUtil provides copySubArray() as replacement of Array.copyOf and Array.copyOfRange (with better bounds check). Unfortunately ArrayUtil does not provide copyArray(), so it is weird for callers to have to call a method named copySubArray() when we want to copy the full array.
This PR adds ArrayUtil.copyArray(), and replaces the calls to ArrayUtil.copySubArray(array, 0, array.length) with calls to ArrayUtil.copyArray(array). I used the following regex to match all calls:
copyOfSubArray\(([^,]+), 0, \1\.length\)
and this one to replacecopyArray($1)