diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-15 16:35:54 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-15 16:35:54 +0200 |
commit | d66bec041a857bc3076a20dfeb1aa6037b020db1 (patch) | |
tree | ab29bd5c21811b4d3564e549e820bd518ceb2680 /testing/src | |
parent | efa2e5ce8c9cc2d20ab7479d1caa4a2ae1de6e8a (diff) | |
download | aspectj-d66bec041a857bc3076a20dfeb1aa6037b020db1.tar.gz aspectj-d66bec041a857bc3076a20dfeb1aa6037b020db1.zip |
Manual array copy
Reports the manual copying of array contents which may be replaced by calls to System.arraycopy().
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'testing/src')
-rw-r--r-- | testing/src/test/java/org/aspectj/testing/util/options/Values.java | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/util/options/Values.java b/testing/src/test/java/org/aspectj/testing/util/options/Values.java index 608d4a610..af81692b7 100644 --- a/testing/src/test/java/org/aspectj/testing/util/options/Values.java +++ b/testing/src/test/java/org/aspectj/testing/util/options/Values.java @@ -698,9 +698,7 @@ public class Values { private void add(int i) { if (insert >= input.length) { int[] temp = new int[insert + 256]; - for (int j = 0; j < input.length; j++) { - temp[j] = input[j]; - } + System.arraycopy(input, 0, temp, 0, input.length); input = temp; } input[insert++] = i; @@ -708,9 +706,7 @@ public class Values { private int[] getList() { int[] result = new int[insert]; - for (int i = 0; i < result.length; i++) { - result[i] = input[i]; - } + if (result.length >= 0) System.arraycopy(input, 0, result, 0, result.length); return result; } } |