aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2022-01-10 08:08:32 -0800
committerGitHub <noreply@github.com>2022-01-10 08:08:32 -0800
commit605b700abfb1cffcc3d39ae768d048bf6a8fef2a (patch)
tree368a64d840aec5bcae08ba79ff34f093d32b3b49 /org.aspectj.ajdt.core
parent254ba9e8bb201a912a326277b29a602b0054a826 (diff)
parentbe522b7e8a591ef54f71d574dd5c76799a2b5136 (diff)
downloadaspectj-605b700abfb1cffcc3d39ae768d048bf6a8fef2a.tar.gz
aspectj-605b700abfb1cffcc3d39ae768d048bf6a8fef2a.zip
Merge pull request #110 from turbanoff/use_StringBuilder_for_concatenation_in_loop
Use StringBuilder/StringJoiner for concatenation String's in loop
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
index 5ce84dca7..699ffe3e0 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java
@@ -16,6 +16,7 @@ package org.aspectj.ajdt.internal.core.builder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.StringJoiner;
import org.aspectj.ajdt.internal.compiler.ast.AdviceDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.DeclareDeclaration;
@@ -256,14 +257,11 @@ public class AsmElementFormatter {
}
private String genPrecedenceListLabel(TypePatternList list) {
- String tpList = "";
+ StringJoiner tpList = new StringJoiner(", ");
for (int i = 0; i < list.size(); i++) {
- tpList += genTypePatternLabel(list.get(i));
- if (i < list.size() - 1) {
- tpList += ", ";
- }
+ tpList.add(genTypePatternLabel(list.get(i)));
}
- return tpList;
+ return tpList.toString();
}
// private String genArguments(MethodDeclaration md) {