Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2018-05-03 03:44:23 -0400
committerLars Vogel2018-05-03 03:44:23 -0400
commitb77c7abd8cafb310aea09a2508ec008cc89a4ce7 (patch)
tree53800a1cf75fe0593f1af8870893b745a7821955 /org.eclipse.debug.examples.ui
parent4009f6e53aad406a09a623e9427213abe019f09f (diff)
downloadeclipse.platform.debug-b77c7abd8cafb310aea09a2508ec008cc89a4ce7.tar.gz
eclipse.platform.debug-b77c7abd8cafb310aea09a2508ec008cc89a4ce7.tar.xz
eclipse.platform.debug-b77c7abd8cafb310aea09a2508ec008cc89a4ce7.zip
Use StringBuilder instead of StringBuffer in debug examples
Change-Id: I638c69c33868c22b89d4212ceaa764f99d516380 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
Diffstat (limited to 'org.eclipse.debug.examples.ui')
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java2
3 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java
index 39f3a4a8f..47b088724 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java
@@ -38,7 +38,7 @@ public class MidiEventLabelProvider extends ElementLabelProvider {
return Long.toString(event.getTick());
} else if (TrackColumnPresentation.COL_BYTES.equals(columnId)) {
byte[] bytes = message.getMessage();
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
for (int i = 0; i < message.getLength(); i++) {
buffer.append(' ');
appendByte(buffer, bytes[i]);
@@ -47,7 +47,7 @@ public class MidiEventLabelProvider extends ElementLabelProvider {
} else if (TrackColumnPresentation.COL_COMMAND.equals(columnId)) {
if (message instanceof ShortMessage) {
ShortMessage sm = (ShortMessage) message;
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
appendByte(buf, (byte)sm.getCommand());
return buf.toString();
}
@@ -76,7 +76,7 @@ public class MidiEventLabelProvider extends ElementLabelProvider {
* @param buffer
* @param b
*/
- private void appendByte(StringBuffer buffer, byte b) {
+ private void appendByte(StringBuilder buffer, byte b) {
String hex = Integer.toHexString(b & 0xFF).toUpperCase();
for (int i = hex.length(); i < 2; i++) {
buffer.append('0');
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java
index a1b854795..fd6b60f7a 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java
@@ -39,7 +39,7 @@ public class TrackLabelProvider extends ElementLabelProvider {
break;
}
}
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append("Track "); //$NON-NLS-1$
buf.append(i);
buf.append(" ["); //$NON-NLS-1$
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java
index 5a95dca64..4325e8fd8 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java
@@ -28,7 +28,7 @@ public class PDAContentAssistProcessor implements IContentAssistProcessor {
@Override
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 {

Back to the top