Back to Intellij Community

ManualArrayCopy

java/java-impl/resources/inspectionDescriptions/ManualArrayCopy.html

2025.3-rc-2291 B
Original Source

Reports manual copying of array contents that can be replaced with a call to System.arraycopy().

Example:

for (int i = 0; i < array.length; i++) {
    newArray[i] = array[i];
  }

After the quick-fix is applied:

System.arraycopy(array, 0, newArray, 0, array.length);