aboutsummaryrefslogtreecommitdiffstats
path: root/taskdefs
diff options
context:
space:
mode:
authorAndrey Turbanov <turbanoff@gmail.com>2021-12-18 15:53:24 +0300
committerAndrey Turbanov <turbanoff@gmail.com>2021-12-18 15:53:24 +0300
commitbe522b7e8a591ef54f71d574dd5c76799a2b5136 (patch)
tree09bbb769226a741706c4e68a794b00a49de4172b /taskdefs
parent4021ffcbfe320a1b91bb2bcee7a112f7122ef82d (diff)
downloadaspectj-be522b7e8a591ef54f71d574dd5c76799a2b5136.tar.gz
aspectj-be522b7e8a591ef54f71d574dd5c76799a2b5136.zip
Use StringBuilder/StringJoiner for concatenation String's in loop
Diffstat (limited to 'taskdefs')
-rw-r--r--taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
index c26c13309..e58db40f2 100644
--- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
+++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajdoc.java
@@ -20,9 +20,9 @@ import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -636,14 +636,13 @@ public class Ajdoc extends MatchingTask {
}
for (String title: groupMap.keySet()) {
List<String> packages = groupMap.get(title);
- String pkgstr = "";
- for (Iterator<String> j = packages.iterator(); j.hasNext();) {
- pkgstr += j.next();
- if (j.hasNext()) pkgstr += ",";
+ StringJoiner pkgstr = new StringJoiner(",");
+ for (String aPackage : packages) {
+ pkgstr.add(aPackage);
}
cmd.createArgument().setValue("-group");
cmd.createArgument().setValue(title);
- cmd.createArgument().setValue(pkgstr);
+ cmd.createArgument().setValue(pkgstr.toString());
}
if (argfiles != null) {
for (File file : argfiles) {