diff options
author | Andrey Turbanov <turbanoff@gmail.com> | 2021-12-18 15:53:24 +0300 |
---|---|---|
committer | Andrey Turbanov <turbanoff@gmail.com> | 2021-12-18 15:53:24 +0300 |
commit | be522b7e8a591ef54f71d574dd5c76799a2b5136 (patch) | |
tree | 09bbb769226a741706c4e68a794b00a49de4172b /org.aspectj.ajdt.core | |
parent | 4021ffcbfe320a1b91bb2bcee7a112f7122ef82d (diff) | |
download | aspectj-be522b7e8a591ef54f71d574dd5c76799a2b5136.tar.gz aspectj-be522b7e8a591ef54f71d574dd5c76799a2b5136.zip |
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.java | 10 |
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) { |