Skip to main content
summaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorAlex Blewitt2016-04-21 18:35:17 -0400
committerSergey Prigogin2016-04-21 23:17:03 -0400
commit2356a29c7015ad41cfe8630568a1c3ab5c3c5eb3 (patch)
tree834bab2dc4a5287047b0ee87c96903bb9d4f20e2 /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')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java8
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelText.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPane.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterGroupVMNode.java6
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java4
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java6
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java4
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java16
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAExpressions.java8
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src_ant/org/eclipse/cdt/examples/ant/tasks/PreProcessor.java6
-rw-r--r--dsf/org.eclipse.cdt.examples.dsf/src_preprocess/org/eclipse/cdt/examples/dsf/requestmonitor/AsyncQuicksort.java4
-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
17 files changed, 50 insertions, 50 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java
index 00dee41f8b..0c837a918d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AddressRulerColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 Wind River Systems and others.
+ * Copyright (c) 2007, 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
@@ -124,7 +124,7 @@ public class AddressRulerColumn extends DisassemblyRulerColumn implements IVerti
}
private String getAddressText(BigInteger address) {
- StringBuffer buf = new StringBuffer(fNumberOfDigits + 3);
+ StringBuilder buf = new StringBuilder(fNumberOfDigits + 3);
if (fRadixPrefix != null) {
buf.append(fRadixPrefix);
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java
index b32e408809..b680f7d12f 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/model/DisassemblyDocument.java
@@ -908,9 +908,9 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
if (DEBUG) {
String escapedText = null;
if (text != null) {
- escapedText = text.replace(new StringBuffer("\n"), new StringBuffer("\\n")); //$NON-NLS-1$ //$NON-NLS-2$
- escapedText = escapedText.replace(new StringBuffer("\r"), new StringBuffer("\\r")); //$NON-NLS-1$ //$NON-NLS-2$
- escapedText = escapedText.replace(new StringBuffer("\t"), new StringBuffer("\\t")); //$NON-NLS-1$ //$NON-NLS-2$
+ escapedText = text.replace(new StringBuilder("\n"), new StringBuilder("\\n")); //$NON-NLS-1$ //$NON-NLS-2$
+ escapedText = escapedText.replace(new StringBuilder("\r"), new StringBuilder("\\r")); //$NON-NLS-1$ //$NON-NLS-2$
+ escapedText = escapedText.replace(new StringBuilder("\t"), new StringBuilder("\\t")); //$NON-NLS-1$ //$NON-NLS-2$
}
System.out.println("Calling AbstractDocument.replace("+insertPos.offset+','+replaceLength+",\""+escapedText+"\")"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
}
@@ -1037,7 +1037,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
* @param instruction
*/
private String buildDisassemblyLine(BigInteger address, String functionOffset, String instruction) {
- StringBuffer buf = new StringBuffer(40);
+ StringBuilder buf = new StringBuilder(40);
if (fShowAddresses) {
if (fRadixPrefix != null) {
buf.append(fRadixPrefix);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java
index 97149c4d86..1fb78c6b59 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/numberformat/detail/NumberFormatDetailPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation 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
@@ -334,7 +334,7 @@ public class NumberFormatDetailPane implements IDetailPane2, IAdaptable, IProper
new DataRequestMonitor<Map<String,Object>>(executor, null) {
@Override
protected void handleSuccess() {
- StringBuffer finalResult = new StringBuffer();
+ StringBuilder finalResult = new StringBuilder();
finalResult.append(NAME).append(getData().get(IElementPropertiesProvider.PROP_NAME)).append(CRLF);
if (formats != null) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelText.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelText.java
index 4a69139f11..692ef4324c 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelText.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/ErrorLabelText.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 Wind River Systems and others.
+ * Copyright (c) 2008, 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
@@ -46,7 +46,7 @@ public class ErrorLabelText extends LabelText {
if (status.getChildren().length < 2) {
return replaceNewlines(status.getMessage());
} else {
- StringBuffer buf = new StringBuffer( status.getMessage() );
+ StringBuilder buf = new StringBuilder( status.getMessage() );
for (IStatus childStatus : status.getChildren()) {
buf.append(MessagesForDebugVM.ErrorLabelText_Error_message__text_page_break_delimiter);
buf.append( replaceNewlines(childStatus.getMessage()) );
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPane.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPane.java
index 10f5839b85..5ba4ac5f1d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPane.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/modules/detail/ModuleDetailPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 IBM Corporation 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
@@ -431,7 +431,7 @@ public class ModuleDetailPane extends ModulesAbstractDetailPane implements IAdap
* @return
*/
private String getModuleDetail( IModuleDMData module ) {
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
// Type
String type = null;
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterGroupVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterGroupVMNode.java
index 6de2cbfc60..83a3a84599 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterGroupVMNode.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/register/RegisterGroupVMNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Wind River Systems and others.
+ * Copyright (c) 2006, 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
@@ -129,7 +129,7 @@ public class RegisterGroupVMNode extends AbstractExpressionVMNode
public String createWatchExpression(Object element) throws CoreException {
IRegisterGroupDMData groupData = getSyncRegisterDataAccess().getRegisterGroupDMData(element);
if (groupData != null) {
- StringBuffer exprBuf = new StringBuffer();
+ StringBuilder exprBuf = new StringBuilder();
exprBuf.append("GRP( "); //$NON-NLS-1$
exprBuf.append(groupData.getName());
exprBuf.append(" )"); //$NON-NLS-1$
@@ -625,4 +625,4 @@ public class RegisterGroupVMNode extends AbstractExpressionVMNode
}
}
}
-} \ No newline at end of file
+}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java
index ccf3b7a5da..e323756192 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/variable/SyncVariableDataAccess.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Wind River Systems and others.
+ * Copyright (c) 2007, 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
@@ -70,7 +70,7 @@ public class SyncVariableDataAccess {
}
private String getServiceFilter() {
- StringBuffer filter = new StringBuffer();
+ StringBuilder filter = new StringBuilder();
filter.append("(&"); //$NON-NLS-1$
filter.append("(OBJECTCLASS="); //$NON-NLS-1$
filter.append(IExpressions.class.getName());
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java
index c37146cd56..9f627b9141 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/ui/viewmodel/properties/VMPropertiesUpdate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 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
@@ -160,4 +160,4 @@ public class VMPropertiesUpdate extends VMViewerUpdate implements IPropertiesUpd
public String toString() {
return "VMPropertiesUpdate:" + getElement() + " " + fProperties; //$NON-NLS-1$ //$NON-NLS-2$/
}
-} \ No newline at end of file
+}
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java
index bbc324ec51..b08d97c9de 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/concurrent/CountingRequestMonitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 Wind River Systems and others.
+ * Copyright (c) 2006, 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
@@ -57,7 +57,7 @@ public class CountingRequestMonitor extends RequestMonitor {
super.setStatus(new DsfMultiStatus(DsfPlugin.PLUGIN_ID, 0, "", null) { //$NON-NLS-1$
@Override
public String getMessage() {
- StringBuffer message = new StringBuffer();
+ StringBuilder message = new StringBuilder();
IStatus[] children = getChildren();
for (int i = 0; i < children.length; i++) {
message.append(children[i].getMessage());
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java
index 7c1a458b32..26846a3eec 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/service/AbstractDsfService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 Wind River Systems and others.
+ * Copyright (c) 2006, 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
@@ -223,7 +223,7 @@ abstract public class AbstractDsfService
*/
@SuppressWarnings({ "rawtypes" })
private String generateFilter(Dictionary properties) {
- StringBuffer filter = new StringBuffer();
+ StringBuilder filter = new StringBuilder();
filter.append("(&"); //$NON-NLS-1$
for (Enumeration keys = properties.keys(); keys.hasMoreElements();) {
@@ -266,4 +266,4 @@ abstract public class AbstractDsfService
/** Returns the registration object that was obtained when this service was registered */
protected ServiceRegistration<?> getServiceRegistration() { return fRegistration; }
-} \ No newline at end of file
+}
diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java
index ae3cbea2bc..f1ab843b2a 100644
--- a/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java
+++ b/dsf/org.eclipse.cdt.examples.dsf.pda.ui/src/org/eclipse/cdt/examples/dsf/pda/ui/editor/PDAContentAssistProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation 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
@@ -28,7 +28,7 @@ public class PDAContentAssistProcessor implements IContentAssistProcessor {
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
int index = offset - 1;
- StringBuffer prefix = new StringBuffer();
+ StringBuilder prefix = new StringBuilder();
IDocument document = viewer.getDocument();
while (index > 0) {
try {
diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java b/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java
index abb860bd57..b306e844e9 100644
--- a/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java
+++ b/dsf/org.eclipse.cdt.examples.dsf.pda/pdavm/src/org/eclipse/cdt/examples/pdavm/PDAVirtualMachine.java
@@ -790,7 +790,7 @@ public class PDAVirtualMachine {
}
}
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
for (String child : children) {
result.append(child);
result.append('|');
@@ -816,7 +816,7 @@ public class PDAVirtualMachine {
return;
}
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
for (Object val : thread.fStack) {
result.append(val);
result.append('|');
@@ -871,7 +871,7 @@ public class PDAVirtualMachine {
System.arraycopy(fCode, 0, thread.fThreadCode, 0, fCode.length);
for (int i = 0; i < numEvalLines; i++) {
String line = tokenizer.nextToken();
- StringBuffer lineBuf = new StringBuffer(line.length());
+ StringBuilder lineBuf = new StringBuilder(line.length());
Matcher matcher = fPackPattern.matcher(line);
int lastMatchEnd = 0;
while (matcher.find()) {
@@ -937,7 +937,7 @@ public class PDAVirtualMachine {
for (Register reg : fRegisters.values()) {
groups.add(reg.fGroup);
}
- StringBuffer response = new StringBuffer();
+ StringBuilder response = new StringBuilder();
for (String group : groups) {
response.append(group);
response.append('|');
@@ -972,7 +972,7 @@ public class PDAVirtualMachine {
void debugRegisters(Args args) {
String group = args.getNextStringArg();
- StringBuffer response = new StringBuffer();
+ StringBuilder response = new StringBuilder();
for (Register reg : fRegisters.values()) {
if (group.equals(reg.fGroup)) {
response.append(reg.fName);
@@ -1074,7 +1074,7 @@ public class PDAVirtualMachine {
return;
}
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
for (Frame frame : thread.fFrames) {
result.append(printFrame(frame));
result.append('#');
@@ -1099,7 +1099,7 @@ public class PDAVirtualMachine {
* filename | line number | function name | var | var | var | var ...
*/
private String printFrame(Frame frame) {
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append(fFilename);
buf.append('|');
buf.append(frame.fPC);
@@ -1205,7 +1205,7 @@ public class PDAVirtualMachine {
}
void debugThreads() {
- StringBuffer response = new StringBuffer();
+ StringBuilder response = new StringBuilder();
for (int threadId : fThreads.keySet()) {
response.append(threadId);
response.append(' ');
diff --git a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAExpressions.java b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAExpressions.java
index de4451d8a5..acfc4518b6 100644
--- a/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAExpressions.java
+++ b/dsf/org.eclipse.cdt.examples.dsf.pda/src/org/eclipse/cdt/examples/dsf/pda/service/PDAExpressions.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Wind River Systems and others.
+ * Copyright (c) 2008, 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
@@ -414,7 +414,7 @@ public class PDAExpressions extends AbstractDsfService implements ICachingServic
String formattedResult = "";
if (HEX_FORMAT.equals(formatId)) {
formattedResult = Integer.toHexString(intResult);
- StringBuffer prefix = new StringBuffer("0x");
+ StringBuilder prefix = new StringBuilder("0x");
for (int i = 0; i < 8 - formattedResult.length(); i++) {
prefix.append('0');
}
@@ -422,7 +422,7 @@ public class PDAExpressions extends AbstractDsfService implements ICachingServic
formattedResult = prefix.toString();
} else if (OCTAL_FORMAT.equals(formatId)) {
formattedResult = Integer.toOctalString(intResult);
- StringBuffer prefix = new StringBuffer("0c");
+ StringBuilder prefix = new StringBuilder("0c");
for (int i = 0; i < 16 - formattedResult.length(); i++) {
prefix.append('0');
}
@@ -430,7 +430,7 @@ public class PDAExpressions extends AbstractDsfService implements ICachingServic
formattedResult = prefix.toString();
} else if (BINARY_FORMAT.equals(formatId)) {
formattedResult = Integer.toBinaryString(intResult);
- StringBuffer prefix = new StringBuffer("0b");
+ StringBuilder prefix = new StringBuilder("0b");
for (int i = 0; i < 32 - formattedResult.length(); i++) {
prefix.append('0');
}
diff --git a/dsf/org.eclipse.cdt.examples.dsf/src_ant/org/eclipse/cdt/examples/ant/tasks/PreProcessor.java b/dsf/org.eclipse.cdt.examples.dsf/src_ant/org/eclipse/cdt/examples/ant/tasks/PreProcessor.java
index 0b2f78e152..3b2ddcfaa1 100644
--- a/dsf/org.eclipse.cdt.examples.dsf/src_ant/org/eclipse/cdt/examples/ant/tasks/PreProcessor.java
+++ b/dsf/org.eclipse.cdt.examples.dsf/src_ant/org/eclipse/cdt/examples/ant/tasks/PreProcessor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 IBM Corporation 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
@@ -115,7 +115,7 @@ public class PreProcessor extends Task {
if (!fDestDir.exists()) {
throw new BuildException("destdir does not exist: " + fDestDir.getAbsolutePath());
}
- StringBuffer buf = new StringBuffer("Symbols: ");
+ StringBuilder buf = new StringBuilder("Symbols: ");
String[] symbols = fSymbols.toArray(new String[fSymbols.size()]);
for (int i = 0; i < symbols.length; i++) {
String symbol = symbols[i];
@@ -189,7 +189,7 @@ public class PreProcessor extends Task {
*/
public String preProcessFile(File srcFile, String strip) {
try (BufferedReader reader = new BufferedReader(new FileReader(srcFile))) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
String line = reader.readLine();
String activeSymbol = null;
int state = STATE_OUTSIDE_CONDITION;
diff --git a/dsf/org.eclipse.cdt.examples.dsf/src_preprocess/org/eclipse/cdt/examples/dsf/requestmonitor/AsyncQuicksort.java b/dsf/org.eclipse.cdt.examples.dsf/src_preprocess/org/eclipse/cdt/examples/dsf/requestmonitor/AsyncQuicksort.java
index bde31ae19d..d17e8a6318 100644
--- a/dsf/org.eclipse.cdt.examples.dsf/src_preprocess/org/eclipse/cdt/examples/dsf/requestmonitor/AsyncQuicksort.java
+++ b/dsf/org.eclipse.cdt.examples.dsf/src_preprocess/org/eclipse/cdt/examples/dsf/requestmonitor/AsyncQuicksort.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Wind River Systems and others.
+ * Copyright (c) 2008, 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
@@ -121,7 +121,7 @@ public class AsyncQuicksort {
}
static void printArray(int[] array, int left, int right, int pivot) {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (int i = 0; i < array.length; i++ ) {
if (i == left) {
buffer.append('>');
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 b89e34f3b1..cdba4027e3 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 a28d96a57b..034a55d86b 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