diff options
author | Andy Clement <aclement@pivotal.io> | 2021-11-30 07:35:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-30 07:35:20 -0800 |
commit | 5abc2f1dce1e97b92acc5562b3c5fa32cf0abb5d (patch) | |
tree | f7ffca6959b94577ba07ff8f190c5b8568c357d0 /build | |
parent | 27aba3f4dfb18600f6b83e8cdf4e268d63d48ec0 (diff) | |
parent | b1c52e2f5eb624037b8c799c20fbd1b4fd611d9a (diff) | |
download | aspectj-5abc2f1dce1e97b92acc5562b3c5fa32cf0abb5d.tar.gz aspectj-5abc2f1dce1e97b92acc5562b3c5fa32cf0abb5d.zip |
Merge pull request #101 from turbanoff/use_StringBuilder_instead_of_StringBuffer
Replace uses of StringBuffer with StringBuilder.
Diffstat (limited to 'build')
11 files changed, 16 insertions, 16 deletions
diff --git a/build/src/main/java/$installer$/org/aspectj/Main.java b/build/src/main/java/$installer$/org/aspectj/Main.java index 745c9d715..e4c649094 100644 --- a/build/src/main/java/$installer$/org/aspectj/Main.java +++ b/build/src/main/java/$installer$/org/aspectj/Main.java @@ -799,7 +799,7 @@ abstract class WizardPane { public static String stringFromStream(InputStream stream) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "US-ASCII")); - StringBuffer ret = new StringBuffer(); + StringBuilder ret = new StringBuilder(); int data; while ((data = reader.read()) != -1) { ret.append((char) data); @@ -827,7 +827,7 @@ abstract class WizardPane { public static String applyProperties(String text, Map<String,String> map) { // ${name} -> map.get(name).toString() int lastIndex = 0; - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); int startIndex; while ((startIndex = text.indexOf("${", lastIndex)) != -1) { diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java index f432af159..a25d4bbe2 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AJInstaller.java @@ -148,7 +148,7 @@ public class AJInstaller extends MatchingTask { protected void writeContents(ZipOutputStream zOut) throws IOException { // write to a StringBuffer - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(contentsBytes); buf.append(NEWLINE); for (String name : contentsNames) { @@ -160,7 +160,7 @@ public class AJInstaller extends MatchingTask { protected void writeManifest(ZipOutputStream zOut) throws IOException { // write to a StringBuffer - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append("Manifest-Version: 1.0"); buf.append(NEWLINE); buf.append("Main-Class: " + MAIN_CLASS); diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java index 1bfdf8a63..f547d83e0 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java @@ -92,7 +92,7 @@ public class AntBuilder extends Builder { target.setName(resultTargetName); Result[] reqs = result.getRequired(); - StringBuffer depends = new StringBuffer(); + StringBuilder depends = new StringBuilder(); boolean first = true; for (Result reqResult : reqs) { if (!first) { @@ -616,7 +616,7 @@ public class AntBuilder extends Builder { } catch (BuildException e) { throw e; } catch (Throwable t) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("classpath="); sb.append(url); throw new BuildException(sb.toString(), t); diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java index 20b4b8353..aa3d2ba28 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/Checklics.java @@ -314,7 +314,7 @@ public class Checklics extends MatchingTask { private void list() { Iterator enu = LICENSES.keySet().iterator(); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("known license keys:"); boolean first = true; while (enu.hasNext()) { diff --git a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java index dd63ee7e8..b5b41a93b 100644 --- a/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java +++ b/build/src/main/java/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java @@ -176,7 +176,7 @@ public class StripNonBodyHtml extends MatchingTask { String stripTags(String input, final String SOURCE, final String START, final String END) { if (null == input) return input; - StringBuffer buffer = new StringBuffer(input.length()); + StringBuilder buffer = new StringBuilder(input.length()); String result = input; int curLoc = 0; while (true) { diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Builder.java b/build/src/main/java/org/aspectj/internal/tools/build/Builder.java index 94e8c7997..71cb3bac2 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Builder.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Builder.java @@ -473,7 +473,7 @@ public abstract class Builder { // copy binaries (but not module flag files) String excludes = null; { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); for (ProductModule productModule : productModules) { if (0 < buf.length()) { buf.append(","); diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Module.java b/build/src/main/java/org/aspectj/internal/tools/build/Module.java index 07743a5db..622625872 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Module.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Module.java @@ -610,7 +610,7 @@ public class Module { final String DELIM = " \n\t\\<>\"="; StringTokenizer st = new StringTokenizer(line, DELIM, true); ArrayList<String> result = new ArrayList<>(); - StringBuffer quote = new StringBuffer(); + StringBuilder quote = new StringBuilder(); boolean inQuote = false; while (st.hasMoreTokens()) { String s = st.nextToken(); diff --git a/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java b/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java index 6ac1f45eb..29468af65 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/SampleGatherer.java @@ -167,7 +167,7 @@ public class SampleGatherer { Reader reader = null; try { String author = null; - StringBuffer sampleCode = new StringBuffer(); + StringBuilder sampleCode = new StringBuilder(); String anchorName = null; String anchorTitle = null; ArrayList<String> flags = new ArrayList<>(); @@ -747,7 +747,7 @@ class HTMLSamplesRenderer extends SamplesRenderer { } } // build up prefix - StringBuffer branchAnchor = new StringBuffer(); + StringBuilder branchAnchor = new StringBuilder(); for (int i = 0; i < firstDiff;) { branchAnchor.append(parts[i]); i++; @@ -991,7 +991,7 @@ class SampleUtil { if (from.length != to.length) { throw new IllegalArgumentException("unmatched from/to"); } - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); int LEN = source.length(); int start = 0; for (int i = 0; i < LEN; i++) { diff --git a/build/src/main/java/org/aspectj/internal/tools/build/Util.java b/build/src/main/java/org/aspectj/internal/tools/build/Util.java index 071826b47..69582bb0a 100644 --- a/build/src/main/java/org/aspectj/internal/tools/build/Util.java +++ b/build/src/main/java/org/aspectj/internal/tools/build/Util.java @@ -151,7 +151,7 @@ public class Util { } public static String path(String[] segments) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); if ((null != segments)) { for (int i = 0; i < segments.length; i++) { if (0 < i) { diff --git a/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java b/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java index f8f0b4bde..b8a6c6d15 100644 --- a/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java +++ b/build/src/test/java/org/aspectj/internal/build/BuildModuleTest.java @@ -107,7 +107,7 @@ public class BuildModuleTest extends TestCase { if (!Util.delete(file)) { File[] list = file.listFiles(); if (!Util.isEmpty(list)) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append("warning: BuildModuleTest unable to delete "); sb.append(file.toString()); sb.append("\n"); // XXX platform diff --git a/build/src/test/java/org/aspectj/internal/build/ModulesTest.java b/build/src/test/java/org/aspectj/internal/build/ModulesTest.java index 52f6f48dc..5b1692570 100644 --- a/build/src/test/java/org/aspectj/internal/build/ModulesTest.java +++ b/build/src/test/java/org/aspectj/internal/build/ModulesTest.java @@ -115,7 +115,7 @@ public class ModulesTest extends TestCase { } } if (!badModules.isEmpty()) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); for (Module module: badModules) { System.err.println(module.toLongString()); sb.append("\n"); |