aboutsummaryrefslogtreecommitdiffstats
path: root/ajdoc/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:06:32 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-15 16:06:32 +0200
commita85308ec103a69a86a8e02adf02112d472b00568 (patch)
treea1fe0ef9fe221292774ef280e4d8f0d55cf1555c /ajdoc/src
parent9cab74717265239e03d1aec53c5ec60a6d7d9718 (diff)
downloadaspectj-a85308ec103a69a86a8e02adf02112d472b00568.tar.gz
aspectj-a85308ec103a69a86a8e02adf02112d472b00568.zip
Manual array to collection copy
Reports the copying of array contents to a collection where each element is added individually using a for loop. Such constructs may be replaced by a call to Collection.addAll(Arrays.asList()) or Collections.addAll(). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'ajdoc/src')
-rw-r--r--ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
index 26857b41c..57b7bce6e 100644
--- a/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
+++ b/ajdoc/src/main/java/org/aspectj/tools/ajdoc/Main.java
@@ -22,14 +22,7 @@ import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.*;
import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
@@ -262,9 +255,7 @@ public class Main implements Config {
javadocargs[numExtraArgs + options.size() + packageList.size() + k] = fileList.elementAt(k);
}
options = new Vector<>();
- for (String a: javadocargs) {
- options.add(a);
- }
+ Collections.addAll(options, javadocargs);
} else {
javadocargs = new String[options.size() + signatureFiles.length];
for (int k = 0; k < options.size(); k++) {