Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-05-23 03:37:21 -0400
committerAlexander Kurtakov2019-05-23 04:20:48 -0400
commit580d96e6cbdac2e14d24620676b5073a6fd0e20f (patch)
treebc91366a0e0016b97d97425b6efc8cc29ed709cc
parent5c190198ba49a9e6cb03a0b4c233c1223f65e410 (diff)
downloadorg.eclipse.linuxtools-580d96e6cbdac2e14d24620676b5073a6fd0e20f.tar.gz
org.eclipse.linuxtools-580d96e6cbdac2e14d24620676b5073a6fd0e20f.tar.xz
org.eclipse.linuxtools-580d96e6cbdac2e14d24620676b5073a6fd0e20f.zip
Use StringBuilder instead of StringBuffer where possible.
Change-Id: Ib62a825af23774e09f51c50113aded3e9e2b8695 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/142647 Tested-by: Linux Tools Bot <linuxtools-bot@eclipse.org>
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUFileEntryRule.java2
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/tests/ChangeLogWriterTest.java4
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java4
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ProcessLauncher.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ShellConnectionSettingsProvider.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/TarInputStream.java6
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ConfigureLabelsCommandHandler.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/RunImageVolumesTab.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/DataVolumeModel.java2
-rw-r--r--containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRunSelectionModel.java2
-rw-r--r--containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ImageQuery.java2
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/utils/GcovStringReader.java4
-rw-r--r--gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/STJunitUtils.java2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java2
-rw-r--r--libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/CDoxygenLibhoverGen.java2
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/opxml/OprofileSAXHandler.java4
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java2
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java12
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java4
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java4
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/internal/profiling/tests/CProjectHelper.java2
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java2
-rw-r--r--profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java2
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/compare/SpecStructureCreator.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/internal/callgraph/core/SystemTapTextParser.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/LaunchStapGraph.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/SystemTapOptionsTab.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPToggleCommentTest.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/CommentRemover.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/StringOutputStream.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/AddStapProbeHandler.java2
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java14
-rw-r--r--vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java2
-rw-r--r--vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/SWTImagesFactory.java2
-rw-r--r--vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/commands/CreateVmCommandHandler.java2
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java6
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifHeapTreeNode.java6
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifParser.java2
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionKindRule.java4
45 files changed, 71 insertions, 71 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUFileEntryRule.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUFileEntryRule.java
index 066cb48a01..78dc113bc0 100644
--- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUFileEntryRule.java
+++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/editors/GNUFileEntryRule.java
@@ -48,7 +48,7 @@ public class GNUFileEntryRule implements IPredicateRule {
protected static final int UNDEFINED = -1;
/** Buffer used for pattern detection */
- private StringBuffer fBuffer = new StringBuffer();
+ private StringBuilder fBuffer = new StringBuilder();
private String fStartingSequence = "* ";
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/tests/ChangeLogWriterTest.java b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/tests/ChangeLogWriterTest.java
index 7f8ba84186..5e0a564b83 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/tests/ChangeLogWriterTest.java
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/core/tests/ChangeLogWriterTest.java
@@ -205,7 +205,7 @@ public class ChangeLogWriterTest {
String expectedContent = expectedChangeLogEntry + changeLogContent;
// Read in content written to file
- StringBuffer actualContent = new StringBuffer();
+ StringBuilder actualContent = new StringBuilder();
try (BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(changelogFile.getLocation().toFile())))) {
String line;
@@ -273,7 +273,7 @@ public class ChangeLogWriterTest {
+ defaultContent + "\n";
// Read in content written to file
- StringBuffer actualContent = new StringBuffer();
+ StringBuilder actualContent = new StringBuilder();
try (BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(emptyChangeLogFile.getLocation().toFile())))) {
String line;
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
index 8deef22b8f..471ce400ca 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerConnection.java
@@ -869,7 +869,7 @@ public class DockerConnection
// to do a kludge and put in control chars ourselves and pretend
// we have a label with no value.
String separator = ""; //$NON-NLS-1$
- StringBuffer labelString = new StringBuffer();
+ StringBuilder labelString = new StringBuilder();
for (Entry<String, String> entry : labels.entrySet()) {
labelString.append(separator);
if (entry.getValue() == null || "".equals(entry.getValue())) //$NON-NLS-1$
@@ -1776,7 +1776,7 @@ public class DockerConnection
return "";
}
List<String> cmd = info.config().cmd();
- StringBuffer b = new StringBuffer();
+ StringBuilder b = new StringBuilder();
cmd.stream().forEach(s -> b.append(s + " "));
b.deleteCharAt(b.length() - 1);
return b.toString();
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
index 37ca14a614..6030a9c3d9 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/DockerContainerConfig.java
@@ -615,7 +615,7 @@ public class DockerContainerConfig implements IDockerContainerConfig {
boolean insideQuote1 = false; // single-quote
boolean insideQuote2 = false; // double-quote
boolean escaped = false;
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
// Parse the string and break it up into chunks that are
// separated by white-space or are quoted. Ignore characters
// that have been escaped, including the escape character.
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ProcessLauncher.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ProcessLauncher.java
index b025894cbf..f37aa23419 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ProcessLauncher.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ProcessLauncher.java
@@ -182,7 +182,7 @@ public class ProcessLauncher {
}
return result.toArray(new String[0]);
} else {
- final StringBuffer errorMessage = new StringBuffer();
+ final StringBuilder errorMessage = new StringBuilder();
try (final InputStream errorStream = process.getErrorStream();
final BufferedReader buff = new BufferedReader(
new InputStreamReader(errorStream))) {
diff --git a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ShellConnectionSettingsProvider.java b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ShellConnectionSettingsProvider.java
index 8c70a81125..a0a00c8d6b 100644
--- a/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ShellConnectionSettingsProvider.java
+++ b/containers/org.eclipse.linuxtools.docker.core/src/org/eclipse/linuxtools/internal/docker/core/ShellConnectionSettingsProvider.java
@@ -146,7 +146,7 @@ public class ShellConnectionSettingsProvider implements IDockerConnectionSetting
private String streamToString(InputStream stream) {
BufferedReader buff = new BufferedReader(new InputStreamReader(stream));
- StringBuffer res = new StringBuffer();
+ StringBuilder res = new StringBuilder();
String line = ""; //$NON-NLS-1$
try {
while ((line = buff.readLine()) != null) {
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
index 0f834a9696..657cc34c40 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
@@ -1845,7 +1845,7 @@ public class ContainerLauncher {
boolean insideQuote1 = false; // single-quote
boolean insideQuote2 = false; // double-quote
boolean escaped = false;
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
// Parse the string and break it up into chunks that are
// separated by white-space or are quoted. Ignore characters
// that have been escaped, including the escape character.
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java
index 55b5451d59..363d410a96 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/SWTImagesFactory.java
@@ -245,7 +245,7 @@ public class SWTImagesFactory {
}
private static URL makeIconFileURL(String prefix, String name) {
- StringBuffer buffer = new StringBuffer(prefix);
+ StringBuilder buffer = new StringBuilder(prefix);
buffer.append(name);
try {
return new URL(fgIconBaseURL, buffer.toString());
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/TarInputStream.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/TarInputStream.java
index c8bff647b9..89ee280f15 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/TarInputStream.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/TarInputStream.java
@@ -119,7 +119,7 @@ public class TarInputStream extends FilterInputStream {
int pos, i;
pos = 148;
- StringBuffer checksumString = new StringBuffer();
+ StringBuilder checksumString = new StringBuilder();
for (i = 0; i < 8; i++) {
if (header[pos + i] == ' ') {
continue;
@@ -232,7 +232,7 @@ public class TarInputStream extends FilterInputStream {
}
pos = 100;
- StringBuffer mode = new StringBuffer();
+ StringBuilder mode = new StringBuilder();
for (i = 0; i < 8; i++) {
if (header[pos + i] == 0) {
break;
@@ -254,7 +254,7 @@ public class TarInputStream extends FilterInputStream {
}
pos = 100 + 24;
- StringBuffer size = new StringBuffer();
+ StringBuilder size = new StringBuilder();
for (i = 0; i < 12; i++) {
if (header[pos + i] == 0) {
break;
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ConfigureLabelsCommandHandler.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ConfigureLabelsCommandHandler.java
index e1b63785be..3e21df352c 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ConfigureLabelsCommandHandler.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/commands/ConfigureLabelsCommandHandler.java
@@ -37,7 +37,7 @@ public class ConfigureLabelsCommandHandler extends AbstractHandler {
HandlerUtil.getActiveShell(event));
if (configureLabels) {
Map<String, String> labels = wizard.getConfigureLabels();
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (Entry<String, String> entry : labels.entrySet()) {
buffer.append(entry.getKey());
buffer.append('='); // $NON-NLS-1$
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/RunImageVolumesTab.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/RunImageVolumesTab.java
index 9bfd792879..4acc32e864 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/RunImageVolumesTab.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/launch/RunImageVolumesTab.java
@@ -458,7 +458,7 @@ public class RunImageVolumesTab extends AbstractLaunchConfigurationTab {
Set<String> selectedVolumesSet = new TreeSet<>();
for (DataVolumeModel volume : volumes) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
volumesList.add(volume.toString());
switch (volume.getMountType()) {
case HOST_FILE_SYSTEM:
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/DataVolumeModel.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/DataVolumeModel.java
index 8b365ef958..a1554edf85 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/DataVolumeModel.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/DataVolumeModel.java
@@ -276,7 +276,7 @@ public class DataVolumeModel extends BaseDatabindingModel
// FIXME we should have a dedicated method to serialize the bean
@Override
public String toString() {
- final StringBuffer buffer = new StringBuffer();
+ final StringBuilder buffer = new StringBuilder();
buffer.append(
this.containerPath + SEPARATOR + getMountType() + SEPARATOR);
switch (getMountType()) {
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRunSelectionModel.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRunSelectionModel.java
index 8489622538..94af1f57fe 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRunSelectionModel.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/internal/docker/ui/wizards/ImageRunSelectionModel.java
@@ -648,7 +648,7 @@ public class ImageRunSelectionModel extends BaseDatabindingModel {
// FIXME we should have a dedicated method to serialize the bean
@Override
public String toString() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
buffer.append(containerPort + CONTAINER_TYPE_SEPARATOR + portType
+ SEPARATOR + (hostAddress != null ? hostAddress : "")
+ SEPARATOR + hostPort
diff --git a/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ImageQuery.java b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ImageQuery.java
index 0d824792c5..47a9890cad 100644
--- a/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ImageQuery.java
+++ b/containers/org.eclipse.linuxtools.jdt.docker.launcher/src/org/eclipse/linuxtools/jdt/docker/launcher/ImageQuery.java
@@ -64,7 +64,7 @@ public class ImageQuery {
ExecCreateParam.attachStdout(), ExecCreateParam.attachStderr(), ExecCreateParam.detach(),
ExecCreateParam.attachStdin()); // needed to avoid connection reset on unix socket
stream = client.execStart(exeCr.id());
- StringBuffer res = new StringBuffer();
+ StringBuilder res = new StringBuilder();
while (stream.hasNext()) {
ByteBuffer b = stream.next().content();
byte[] buffer = new byte[b.remaining()];
diff --git a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/utils/GcovStringReader.java b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/utils/GcovStringReader.java
index 86a2e2afe1..9e84fde6a9 100644
--- a/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/utils/GcovStringReader.java
+++ b/gcov/org.eclipse.linuxtools.gcov.core/src/org/eclipse/linuxtools/internal/gcov/utils/GcovStringReader.java
@@ -1,6 +1,6 @@
/*******************************************************************************
* Copyright (c) 2009, 2018 STMicroelectronics and others.
- *
+ *
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
@@ -24,7 +24,7 @@ public class GcovStringReader {
int ln = ((int) length) << 2;
byte[] name = new byte[ln];
stream.readFully(name);
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
for (int j = 0; j < ln; j++) {
if (name[j] != 0) {
char c = (char) name[j];
diff --git a/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/STJunitUtils.java b/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/STJunitUtils.java
index db06534c1b..fe82d837df 100644
--- a/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/STJunitUtils.java
+++ b/gprof/org.eclipse.linuxtools.gprof.test/src/org/eclipse/linuxtools/internal/gprof/test/STJunitUtils.java
@@ -146,7 +146,7 @@ public class STJunitUtils {
is1.close();
is2.close();
if (!equals) {
- StringBuffer msg = new StringBuffer(message + ": not correspond ");
+ StringBuilder msg = new StringBuilder(message + ": not correspond ");
msg.append("\n========= begin dump file =========\n");
try (FileReader fr = new FileReader(dumpFile)) {
int c;
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
index 687a70658d..b1cce0b3ff 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover.libstdcxx/src/org/eclipse/linuxtools/internal/cdt/libhover/libstdcxx/DoxygenCPPInfo.java
@@ -91,7 +91,7 @@ public class DoxygenCPPInfo {
}
private String getElementText(Node node) {
- StringBuffer d = new StringBuffer();
+ StringBuilder d = new StringBuilder();
NodeList nl = node.getChildNodes();
for (int x = 0; x < nl.getLength(); ++x) {
Node text = nl.item(x);
diff --git a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/CDoxygenLibhoverGen.java b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/CDoxygenLibhoverGen.java
index 49559e87cc..a1ab978d00 100644
--- a/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/CDoxygenLibhoverGen.java
+++ b/libhover/org.eclipse.linuxtools.cdt.libhover/src/org/eclipse/linuxtools/internal/cdt/libhover/utils/CDoxygenLibhoverGen.java
@@ -112,7 +112,7 @@ public class CDoxygenLibhoverGen extends LibhoverInfoGenerator{
}
private String getElementText(Node node) {
- StringBuffer d = new StringBuffer();
+ StringBuilder d = new StringBuilder();
NodeList nl = node.getChildNodes();
for (int x = 0; x < nl.getLength(); ++x) {
Node text = nl.item(x);
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/opxml/OprofileSAXHandler.java b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/opxml/OprofileSAXHandler.java
index 7045e42ba0..6f7b977308 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/opxml/OprofileSAXHandler.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core/src/org/eclipse/linuxtools/internal/oprofile/core/opxml/OprofileSAXHandler.java
@@ -53,7 +53,7 @@ public class OprofileSAXHandler extends DefaultHandler {
// handle this properly, it is needed to accumulate the text returned in each
// call
// until it recieves a callback that isn't characters.
- private StringBuffer charactersBuffer;
+ private StringBuilder charactersBuffer;
// A convenience class for specifying XMLProcessors
private static class ProcessorItem {
@@ -147,7 +147,7 @@ public class OprofileSAXHandler extends DefaultHandler {
processor.startElement(qName, attrs, callData);
// Clean up the characters buffer
- charactersBuffer = new StringBuffer();
+ charactersBuffer = new StringBuilder();
}
@Override
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
index 8b908846fa..c77b3bc529 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.launch/src/org/eclipse/linuxtools/internal/oprofile/launch/launching/AbstractOprofileLaunchConfigurationDelegate.java
@@ -240,7 +240,7 @@ public abstract class AbstractOprofileLaunchConfigurationDelegate extends Abstra
process.waitFor();
// Put the OCount data in a separate view
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
// Use remote file proxy to operate resources since the project may be either local or remote
IRemoteFileProxy proxy = RemoteProxyManager.getInstance().getFileProxy(OprofileProject.getProject());
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java
index d01a7031a7..90f5a0f561 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/AbstractDataManipulator.java
@@ -80,8 +80,8 @@ public abstract class AbstractDataManipulator extends BaseDataManipulator
Process proc = null;
IFileStore workDirStore = getWorkingDirStore();
proc = RuntimeProcessFactory.getFactory().exec(cmd, null, workDirStore, project);
- StringBuffer data = new StringBuffer();
- StringBuffer temp = new StringBuffer();
+ StringBuilder data = new StringBuilder();
+ StringBuilder temp = new StringBuilder();
switch (fd) {
case 2:
@@ -132,7 +132,7 @@ public abstract class AbstractDataManipulator extends BaseDataManipulator
DebugPlugin.newProcess(launch, proc, ""); //$NON-NLS-1$
proc.waitFor();
- StringBuffer data = new StringBuffer();
+ StringBuilder data = new StringBuilder();
try (BufferedReader buffData = new BufferedReader(
new InputStreamReader(
fileProxy.getResource(file).openInputStream(EFS.NONE, null)))) {
@@ -148,13 +148,13 @@ public abstract class AbstractDataManipulator extends BaseDataManipulator
}
/**
- * Write entire contents of BufferedReader into given StringBuffer.
+ * Write entire contents of BufferedReader into given StringBuilder.
*
* @param buff BufferedReader to read from.
- * @param strBuff StringBuffer to write to.
+ * @param strBuff StringBuilder to write to.
*/
private void readStream(final BufferedReader buff,
- final StringBuffer strBuff) {
+ final StringBuilder strBuff) {
Thread readThread = new Thread(() -> strBuff.append(getBufferContents(buff)));
readThread.start();
threads.add(readThread);
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
index 465ff622f1..10b36a4897 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
@@ -53,7 +53,7 @@ public class PerfCore {
private static String spitStream(BufferedReader br, String blockTitle, PrintStream print) {
- StringBuffer strBuf = new StringBuffer();
+ StringBuilder strBuf = new StringBuilder();
String line = null;
try {
while (( line = br.readLine()) != null){
@@ -574,7 +574,7 @@ public class PerfCore {
if(project==null) {
p = Runtime.getRuntime().exec(annotateCmd);
} else {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
ArrayList<String> al = new ArrayList<>();
/*
* Wrap the whole Perf annotate line as a single argument of sh command
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
index b45e518719..5bc3e34975 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/launch/PerfLaunchConfigDelegate.java
@@ -256,7 +256,7 @@ public class PerfLaunchConfigDelegate extends AbstractCLaunchDelegate {
// Get working directory
int runCount = config.getAttribute(PerfPlugin.ATTR_StatRunCount,
PerfPlugin.ATTR_StatRunCount_default);
- StringBuffer args = new StringBuffer();
+ StringBuilder args = new StringBuilder();
for (String arg : arguments) {
args.append(arg);
args.append(" "); //$NON-NLS-1$
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
index a7d257fe8d..ebbaa00b9b 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
@@ -289,7 +289,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
public String getText(Object element) {
if (element instanceof IBinary) {
IBinary bin = (IBinary) element;
- StringBuffer name = new StringBuffer();
+ StringBuilder name = new StringBuilder();
name.append(bin.getPath().lastSegment());
return name.toString();
}
@@ -321,7 +321,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
public String getText(Object element) {
if (element instanceof IBinary) {
IBinary bin = (IBinary) element;
- StringBuffer name = new StringBuffer();
+ StringBuilder name = new StringBuilder();
name.append(bin.getCPU()
+ (bin.isLittleEndian() ? "le" : "be")); //$NON-NLS-1$ //$NON-NLS-2$
name.append(" - "); //$NON-NLS-1$
diff --git a/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/internal/profiling/tests/CProjectHelper.java b/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/internal/profiling/tests/CProjectHelper.java
index c88aa389e0..3e5a315eb6 100644
--- a/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/internal/profiling/tests/CProjectHelper.java
+++ b/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/internal/profiling/tests/CProjectHelper.java
@@ -95,7 +95,7 @@ public class CProjectHelper {
private static String getMessage(IStatus status) {
- StringBuffer message = new StringBuffer("[");
+ StringBuilder message = new StringBuilder("[");
message.append(status.getMessage());
if (status.isMultiStatus()) {
IStatus children[] = status.getChildren();
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java
index e28e1138ea..066b8431c1 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java
@@ -209,7 +209,7 @@ public class RDTCommandLauncher implements IRemoteCommandLauncher {
}
private String getCommandLine(String[] commandArgs) {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
if (fCommandArgs != null) {
for (String commandArg : commandArgs) {
buf.append(commandArg);
diff --git a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java
index ec8bbceac4..b019789620 100644
--- a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java
+++ b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/LinuxtoolsProcessFactory.java
@@ -93,7 +93,7 @@ public abstract class LinuxtoolsProcessFactory {
systemPath = envMap.get(PATH);
}
- StringBuffer newPath = new StringBuffer();
+ StringBuilder newPath = new StringBuilder();
newPath.append(PATH_EQUAL);
if (ltPath != null && !ltPath.isEmpty()) {
diff --git a/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/compare/SpecStructureCreator.java b/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/compare/SpecStructureCreator.java
index c5b0c9240b..c0cccc8346 100644
--- a/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/compare/SpecStructureCreator.java
+++ b/rpm/org.eclipse.linuxtools.rpm.ui.editor/src/org/eclipse/linuxtools/internal/rpm/ui/editor/compare/SpecStructureCreator.java
@@ -182,7 +182,7 @@ public class SpecStructureCreator extends StructureCreator {
if (is == null) {
return null;
}
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
char[] part = new char[2048];
int read = 0;
try (BufferedReader reader = new BufferedReader(new InputStreamReader(is, encoding))) {
diff --git a/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/internal/callgraph/core/SystemTapTextParser.java b/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/internal/callgraph/core/SystemTapTextParser.java
index 691ea5900e..582ef49370 100644
--- a/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/internal/callgraph/core/SystemTapTextParser.java
+++ b/systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/internal/callgraph/core/SystemTapTextParser.java
@@ -36,7 +36,7 @@ public class SystemTapTextParser extends SystemTapParser{
@Override
public IStatus realTimeParsing() {
BufferedReader buff = internalData;
- StringBuffer text = new StringBuffer();
+ StringBuilder text = new StringBuilder();
String line;
try {
diff --git a/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/LaunchStapGraph.java b/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/LaunchStapGraph.java
index 6a8f54b3f6..3c83dd8970 100644
--- a/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/LaunchStapGraph.java
+++ b/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/LaunchStapGraph.java
@@ -127,7 +127,7 @@ public class LaunchStapGraph extends SystemTapLaunchShortcut {
return null;
}
- StringBuffer output = new StringBuffer();
+ StringBuilder output = new StringBuilder();
for (String func : toWrite.split(" ")) { //$NON-NLS-1$
if (!func.isEmpty()
diff --git a/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/SystemTapOptionsTab.java b/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/SystemTapOptionsTab.java
index dc82f4a65b..c02151062c 100644
--- a/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/SystemTapOptionsTab.java
+++ b/systemtap/org.eclipse.linuxtools.callgraph.launch/src/org/eclipse/linuxtools/internal/callgraph/launch/SystemTapOptionsTab.java
@@ -648,7 +648,7 @@ public class SystemTapOptionsTab extends CLaunchConfigurationTab{
public String getText(Object element) {
if (element instanceof IBinary) {
IBinary bin = (IBinary)element;
- StringBuffer name = new StringBuffer();
+ StringBuilder name = new StringBuilder();
name.append(bin.getPath().lastSegment());
return name.toString();
}
@@ -661,7 +661,7 @@ public class SystemTapOptionsTab extends CLaunchConfigurationTab{
public String getText(Object element) {
if (element instanceof IBinary) {
IBinary bin = (IBinary)element;
- StringBuffer name = new StringBuffer();
+ StringBuilder name = new StringBuilder();
name.append(bin.getCPU() + (bin.isLittleEndian() ? "le" : "be")); //$NON-NLS-1$ //$NON-NLS-2$
name.append(" - "); //$NON-NLS-1$
name.append(bin.getPath().toString());
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPToggleCommentTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPToggleCommentTest.java
index 6234a04dbe..a17f75e596 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPToggleCommentTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPToggleCommentTest.java
@@ -45,7 +45,7 @@ public class STPToggleCommentTest {
@BeforeClass
public static void setUp() {
- StringBuffer stpScriptBuff = new StringBuffer();
+ StringBuilder stpScriptBuff = new StringBuilder();
for (String scriptLine : PARTITIONED_SCRIPT) {
stpScriptBuff.append(scriptLine);
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/CommentRemover.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/CommentRemover.java
index cd9e01b3bc..5ccd9b4097 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/CommentRemover.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/CommentRemover.java
@@ -32,7 +32,7 @@ public final class CommentRemover {
*/
public static String execWithFile(String filename) {
try (BufferedReader br = new BufferedReader(new FileReader(filename))) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
String line;
while ((line = br.readLine()) != null) {
buffer.append(line.concat("\n")); //$NON-NLS-1$
@@ -66,7 +66,7 @@ public final class CommentRemover {
boolean inComment = false;
int c = 0;
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
do {
curchar = contents.charAt(c++);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/StringOutputStream.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/StringOutputStream.java
index bc17b15ce3..7760c2a5df 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/StringOutputStream.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/StringOutputStream.java
@@ -16,7 +16,7 @@ package org.eclipse.linuxtools.internal.systemtap.ui.ide;
import java.io.OutputStream;
public class StringOutputStream extends OutputStream {
- private StringBuffer str = new StringBuffer();
+ private StringBuilder str = new StringBuilder();
@Override
public String toString() {
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java
index 6a4f6efc9e..b0721f5f76 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPEditor.java
@@ -129,7 +129,7 @@ public class STPEditor extends TextEditor {
if (selection instanceof ITextSelection) {
ITextSelection s = (ITextSelection) selection;
- StringBuffer sb = new StringBuffer(doc.get().substring(0, s.getOffset()));
+ StringBuilder sb = new StringBuilder(doc.get().substring(0, s.getOffset()));
sb.append(text.trim());
sb.append(doc.get().substring(s.getOffset() + s.getLength(), doc.get().length()));
doc.set(sb.toString());
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
index e078201141..535b070768 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/editors/stp/STPReconcilingStrategy.java
@@ -216,7 +216,7 @@ public class STPReconcilingStrategy implements IReconcilingStrategy,
}
private boolean matchKeyWord(String word) throws BadLocationException {
- StringBuffer keyWord = new StringBuffer();
+ StringBuilder keyWord = new StringBuilder();
int location = nextCharPosition;
while (location < endOfDocumentPostion) {
char ch = currentDocument.getChar(location);
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/AddStapProbeHandler.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/AddStapProbeHandler.java
index 969c74ae51..8eeab98967 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/AddStapProbeHandler.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/handlers/AddStapProbeHandler.java
@@ -128,7 +128,7 @@ public class AddStapProbeHandler extends AbstractHandler {
String filepath = input.getURI().getPath();
String kernrelative = filepath.substring(
kernroot.length() + 1, filepath.length());
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append("probe kernel.statement(\"*@" + kernrelative + ":" + (lineno + 1) + "\")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java
index 74e4d6ee0c..4bcdbba028 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide/src/org/eclipse/linuxtools/internal/systemtap/ui/ide/preferences/ListEditor.java
@@ -31,15 +31,15 @@ public class ListEditor extends org.eclipse.jface.preference.ListEditor {
}
/**
- * Creates and populates a StringBuffer with the supplied items.
- *
- * @param items An array of strings to make the StringBuffer with.
- *
- * @return Returns the StringBuffer.
- */
+ * Creates and populates a StringBuilder with the supplied items.
+ *
+ * @param items An array of strings to make the StringBuilder with.
+ *
+ * @return Returns the StringBuilder.
+ */
@Override
protected String createList(String[] items) {
- StringBuffer path = new StringBuffer();
+ StringBuilder path = new StringBuilder();
for (String item: items) {
path.append(item);
diff --git a/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java b/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java
index 436e5c87c5..bcfdbd1051 100644
--- a/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java
+++ b/vagrant/org.eclipse.linuxtools.vagrant.core/src/org/eclipse/linuxtools/internal/vagrant/core/VagrantConnection.java
@@ -288,7 +288,7 @@ public class VagrantConnection implements IVagrantConnection, Closeable {
}
private String removeFromKeys(String keys, String key) {
- StringBuffer res = new StringBuffer();
+ StringBuilder res = new StringBuilder();
for (String k : keys.split(",")) {
if (!key.equals(k)) {
res.append(","); //$NON-NLS-1$
diff --git a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/SWTImagesFactory.java b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/SWTImagesFactory.java
index 2723e773fe..4f42c1b9c4 100644
--- a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/SWTImagesFactory.java
+++ b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/SWTImagesFactory.java
@@ -204,7 +204,7 @@ public class SWTImagesFactory {
}
private static URL makeIconFileURL(String prefix, String name) {
- StringBuffer buffer = new StringBuffer(prefix);
+ StringBuilder buffer = new StringBuilder(prefix);
buffer.append(name);
try {
return new URL(fgIconBaseURL, buffer.toString());
diff --git a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/commands/CreateVmCommandHandler.java b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/commands/CreateVmCommandHandler.java
index 364ac8bf11..cdeb54d90e 100644
--- a/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/commands/CreateVmCommandHandler.java
+++ b/vagrant/org.eclipse.linuxtools.vagrant.ui/src/org/eclipse/linuxtools/internal/vagrant/ui/commands/CreateVmCommandHandler.java
@@ -192,7 +192,7 @@ public class CreateVmCommandHandler extends AbstractHandler {
Path vagrantFilePath = Paths.get(stateLoc, vmName, "Vagrantfile"); //$NON-NLS-1$
String defaultContent;
- StringBuffer bcontent = new StringBuffer();
+ StringBuilder bcontent = new StringBuilder();
try {
defaultContent = new String(Files.readAllBytes(vagrantFilePath),
StandardCharsets.UTF_8);
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
index 8fc5b922f8..79063affab 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
@@ -51,7 +51,7 @@ public class ValgrindCommand {
Process p = RuntimeProcessFactory.getFactory()
.exec(new String[] { getValgrindCommand(), CommandLineConstants.OPT_VERSION }, project);
try {
- StringBuffer out = new StringBuffer();
+ StringBuilder out = new StringBuilder();
readIntoBuffer(out, p);
return out.toString().trim();
} catch (IOException e) {
@@ -94,7 +94,7 @@ public class ValgrindCommand {
* @return process
*/
public String getCommandLine() {
- StringBuffer ret = new StringBuffer();
+ StringBuilder ret = new StringBuilder();
for (String arg : args) {
ret.append(arg).append(" "); //$NON-NLS-1$
}
@@ -112,7 +112,7 @@ public class ValgrindCommand {
}
}
- private void readIntoBuffer(StringBuffer out, Process p) throws IOException {
+ private void readIntoBuffer(StringBuilder out, Process p) throws IOException {
if (p == null) {
throw new IOException("Null Process object: unabled to read input into buffer"); //$NON-NLS-1$
}
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifHeapTreeNode.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifHeapTreeNode.java
index 6b3b275bd7..15a6a04db2 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifHeapTreeNode.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifHeapTreeNode.java
@@ -30,7 +30,7 @@ public class MassifHeapTreeNode {
public MassifHeapTreeNode(MassifHeapTreeNode parent, double percent, long bytes, String address, String function, String filename, int line) {
this.parent = parent;
- StringBuffer nodeText = new StringBuffer();
+ StringBuilder nodeText = new StringBuilder();
formatBytes(percent, bytes, nodeText);
nodeText.append(address).append(":"); //$NON-NLS-1$
if (function.length() > 0) {
@@ -57,7 +57,7 @@ public class MassifHeapTreeNode {
public MassifHeapTreeNode(MassifHeapTreeNode parent, double percent, long bytes, String text) {
this.parent = parent;
- StringBuffer nodeText = new StringBuffer();
+ StringBuilder nodeText = new StringBuilder();
formatBytes(percent, bytes, nodeText);
nodeText.append(text);
this.percent = percent;
@@ -70,7 +70,7 @@ public class MassifHeapTreeNode {
children = new ArrayList<>();
}
- private void formatBytes(double percent, long bytes, StringBuffer buffer) {
+ private void formatBytes(double percent, long bytes, StringBuilder buffer) {
buffer.append(new DecimalFormat("0.##").format(percent) + "%"); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append(" ("); //$NON-NLS-1$
buffer.append(new DecimalFormat("#,##0").format(bytes) + "B"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifParser.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifParser.java
index 9674b7b9cb..6449b2b5f5 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifParser.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifParser.java
@@ -155,7 +155,7 @@ public class MassifParser {
node = new MassifHeapTreeNode(parent, percentage, numBytes, address, function, filename, lineNo);
} else {
// concatenate the rest
- StringBuffer text = new StringBuffer();
+ StringBuilder text = new StringBuilder();
for (int i = 2; i < parts.length; i++) {
text.append(parts[i]);
text.append(" "); //$NON-NLS-1$
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionKindRule.java b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionKindRule.java
index b50e0bba6e..1b3fb33d10 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionKindRule.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.ui.editor/src/org/eclipse/linuxtools/internal/valgrind/ui/editor/SuppressionKindRule.java
@@ -68,8 +68,8 @@ public class SuppressionKindRule implements IRule {
@Override
public IToken evaluate(ICharacterScanner scanner) {
IToken result = subrule.evaluate(scanner);
- StringBuffer tool = new StringBuffer();
- StringBuffer kind = new StringBuffer();
+ StringBuilder tool = new StringBuilder();
+ StringBuilder kind = new StringBuilder();
if (!result.isUndefined()) {
boolean match = true;

Back to the top