Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2016-04-21 22:35:17 +0000
committerSergey Prigogin2016-04-22 03:17:03 +0000
commit2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3 (patch)
tree834bab2dc4a5287047b0ee87c96903bb9d4f20e2 /dsf/org.eclipse.cdt.tests.dsf
parente901d4a7d4298b999365288b6b5b8d018b75ae73 (diff)
downloadorg.eclipse.cdt-2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3.tar.gz
org.eclipse.cdt-2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3.tar.xz
org.eclipse.cdt-2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3.zip
Bug 492200 - Replace StringBuffer with StringBuilder
There are many opportunities for replacing `StringBuffer` with `StringBuilder` provided that the type isn't visible from the public API and is used only in internal methods. Replace these where appropriate. Change-Id: Ic2f50c5b6f3c3a4eae301bb3b40fb6faed235f79 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'dsf/org.eclipse.cdt.tests.dsf')
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java10
-rw-r--r--dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModel.java4
2 files changed, 7 insertions, 7 deletions
diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java
index b89e34f3b1f..cdba4027e3f 100644
--- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java
+++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/ViewerUpdatesListener.java
@@ -481,7 +481,7 @@ public class ViewerUpdatesListener
}
private String toString(int flags) {
- StringBuffer buf = new StringBuffer("Viewer Update Listener");
+ StringBuilder buf = new StringBuilder("Viewer Update Listener");
if (fFailOnRedundantUpdates) {
buf.append("\n\t");
@@ -603,7 +603,7 @@ public class ViewerUpdatesListener
if (set.isEmpty()) {
return "(EMPTY)";
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for (Iterator<TreePath> itr = set.iterator(); itr.hasNext(); ) {
buf.append("\n\t\t");
buf.append(toStringTreePath(itr.next()));
@@ -615,7 +615,7 @@ public class ViewerUpdatesListener
if (set.isEmpty()) {
return "(EMPTY)";
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for (Iterator<IViewerUpdate> itr = set.iterator(); itr.hasNext(); ) {
buf.append("\n\t\t");
buf.append(toStringTreePath((itr.next()).getElementPath()));
@@ -627,7 +627,7 @@ public class ViewerUpdatesListener
if (map.isEmpty()) {
return "(EMPTY)";
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for (Iterator<TreePath> itr = map.keySet().iterator(); itr.hasNext(); ) {
buf.append("\n\t\t");
TreePath path = itr.next();
@@ -643,7 +643,7 @@ public class ViewerUpdatesListener
if (path.getSegmentCount() == 0) {
return "/";
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for (int i = 0; i < path.getSegmentCount(); i++) {
buf.append("/");
buf.append(path.getSegment(i));
diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModel.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModel.java
index a28d96a57b3..034a55d86ba 100644
--- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModel.java
+++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/vm/TestModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 Wind River Systems and others.
+ * Copyright (c) 2009, 2016 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -616,7 +616,7 @@ public class TestModel extends AbstractDsfService implements IFormattedValues {
}
public String getElementString(TestElement element, String indent) {
- StringBuffer builder = new StringBuffer();
+ StringBuilder builder = new StringBuilder();
builder.append(indent);
builder.append(element.toString());
builder.append('\n');

Back to the top