Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2019-05-24 11:21:37 -0400
committerLars Vogel2019-06-11 06:38:40 -0400
commitd18024c8e8073f3a28f3fb5013ae3d0e6af7ceb9 (patch)
tree11ddb7b9bc65206dabc487f91e8853709978ad94
parent8900dabed95e06188f88cf4af709bf2793c982ec (diff)
downloadeclipse.platform.text-d18024c8e8073f3a28f3fb5013ae3d0e6af7ceb9.tar.gz
eclipse.platform.text-d18024c8e8073f3a28f3fb5013ae3d0e6af7ceb9.tar.xz
eclipse.platform.text-d18024c8e8073f3a28f3fb5013ae3d0e6af7ceb9.zip
Use StringBuilder instead of StringBuffer where possible.
Change-Id: Ifee0c0b2ecbdaad31ea628c4fbe87cec89897012 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de>
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/util/DisplayHelper.java2
-rw-r--r--org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionDocumentTest.java66
-rw-r--r--org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionMappingTest.java4
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java2
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java2
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java12
-rw-r--r--org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateVariablesWordSelectionTest.java4
-rw-r--r--org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java2
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java4
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java2
10 files changed, 50 insertions, 50 deletions
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/util/DisplayHelper.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/util/DisplayHelper.java
index 695f56c10..662dde682 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/util/DisplayHelper.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/util/DisplayHelper.java
@@ -558,7 +558,7 @@ final class DisplayWaiter {
* @return a string representation of the states
*/
private String name(int states) {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
boolean comma= false;
if ((states & RUNNING) == RUNNING) {
buf.append("RUNNING");
diff --git a/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionDocumentTest.java b/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionDocumentTest.java
index 6414fa5ae..94e676a6a 100644
--- a/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionDocumentTest.java
+++ b/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionDocumentTest.java
@@ -352,7 +352,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.replace(85, 90, "~");
buffer.replace(65, 70, "~");
buffer.replace(45, 50, "~");
@@ -498,7 +498,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.insert(40, '~');
assertSlaveContents(buffer.toString());
}
@@ -515,7 +515,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.deleteCharAt(40);
assertSlaveContents(buffer.toString());
}
@@ -532,7 +532,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.replace(40, 41, "~");
assertSlaveContents(buffer.toString());
}
@@ -559,7 +559,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.deleteCharAt(59);
assertSlaveContents(buffer.toString());
}
@@ -577,7 +577,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.replace(59, 60, "~");
assertSlaveContents(buffer.toString());
}
@@ -707,7 +707,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(30, 40);
assertSlaveContents(buffer.toString());
}
@@ -734,7 +734,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.replace(30, 40, "~~~~~");
assertSlaveContents(buffer.toString());
}
@@ -751,7 +751,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(40, 50);
assertSlaveContents(buffer.toString());
}
@@ -778,7 +778,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.replace(40, 50, "~~~~~");
assertSlaveContents(buffer.toString());
}
@@ -866,7 +866,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
assertSlaveContents("~~~~~");
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
buffer.replace(20, 160, "~~~~~");
assertMasterContents(buffer.toString());
}
@@ -919,7 +919,7 @@ public class ProjectionDocumentTest {
}
assertSlaveContents("~~~~~");
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
buffer.replace(160, 180, "~");
buffer.replace(120, 140, "~");
buffer.replace(80, 100, "~");
@@ -1176,7 +1176,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(60, 70);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1203,7 +1203,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(70, 80);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1231,7 +1231,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(65, 75);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1257,7 +1257,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(60, 80);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1284,7 +1284,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(70, 80);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1311,7 +1311,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(60, 70);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1337,7 +1337,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(60, 80);
buffer.insert(40, addition);
assertSlaveContents(buffer.toString());
@@ -1364,7 +1364,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
String addition= getOriginalMasterContents().substring(100, 110);
buffer.insert(60, addition);
addition= getOriginalMasterContents().substring(70, 80);
@@ -1393,7 +1393,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(20, 30);
assertSlaveContents(buffer.toString());
}
@@ -1419,7 +1419,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(30, 40);
assertSlaveContents(buffer.toString());
}
@@ -1446,7 +1446,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(45, 55);
assertSlaveContents(buffer.toString());
}
@@ -1471,7 +1471,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(20, 40);
assertSlaveContents(buffer.toString());
}
@@ -1497,7 +1497,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(30, 40);
assertSlaveContents(buffer.toString());
}
@@ -1523,7 +1523,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(40, 50);
assertSlaveContents(buffer.toString());
}
@@ -1548,7 +1548,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(40, 60);
assertSlaveContents(buffer.toString());
}
@@ -1574,7 +1574,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getProjectionASlaveContents());
+ StringBuilder buffer= new StringBuilder(getProjectionASlaveContents());
buffer.delete(30, 50);
assertSlaveContents(buffer.toString());
}
@@ -1597,7 +1597,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
buffer.delete(50, 90);
assertSlaveContents(buffer.toString());
}
@@ -1621,7 +1621,7 @@ public class ProjectionDocumentTest {
};
assertFragmentation(expected);
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
buffer.delete(80, 180);
assertSlaveContents(buffer.toString());
}
@@ -1666,7 +1666,7 @@ public class ProjectionDocumentTest {
DocumentEvent[] actual= new DocumentEvent[receivedEvents.size()];
receivedEvents.toArray(actual);
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
DocumentEvent[] expected= new DocumentEvent[] {
new DocumentEvent(fSlaveDocument, 0, 0, buffer.substring(0, 20)),
new DocumentEvent(fSlaveDocument, 20, 0, buffer.substring(40, 60)),
@@ -2012,7 +2012,7 @@ public class ProjectionDocumentTest {
assertTrue(false);
}
assertSlaveContents("");
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
buffer.delete(20, 160);
assertMasterContents(buffer.toString());
@@ -2046,7 +2046,7 @@ public class ProjectionDocumentTest {
assertFragmentation(expected);
assertSlaveContents("~~~~~");
- StringBuffer buffer= new StringBuffer(getOriginalMasterContents());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContents());
buffer.replace(20, 160, "~~~~~");
assertMasterContents(buffer.toString());
}
diff --git a/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionMappingTest.java b/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionMappingTest.java
index 6b506e2e4..e342babfe 100644
--- a/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionMappingTest.java
+++ b/org.eclipse.text.tests/projection/org/eclipse/text/tests/ProjectionMappingTest.java
@@ -56,7 +56,7 @@ public class ProjectionMappingTest {
}
private String getOriginalSlaveContent() {
- StringBuffer buffer= new StringBuffer(getOriginalMasterContent());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContent());
buffer.delete(80, 180);
buffer.delete(40, 60);
buffer.delete(0, 20);
@@ -64,7 +64,7 @@ public class ProjectionMappingTest {
}
private String getLineWrappingSlaveContent() {
- StringBuffer buffer= new StringBuffer(getOriginalMasterContent());
+ StringBuilder buffer= new StringBuilder(getOriginalMasterContent());
buffer.delete(80, 180);
buffer.delete(50, 70); // ...333444...
buffer.delete(10, 30); // ...111222...
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java
index ded09d02a..8ff6bd9cb 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/CopyOnWriteTextStoreTest.java
@@ -145,7 +145,7 @@ public class CopyOnWriteTextStoreTest {
private void checkReplace(int offset, int length, String text) {
- StringBuffer buf= new StringBuffer(fText.get());
+ StringBuilder buf= new StringBuilder(fText.get());
buf.replace(offset, offset + length, text);
fText.replace(offset, length, text);
assertEquals(buf.toString(), fText.get());
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java
index c49e91ee5..e547335c3 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/TextUtilitiesTest.java
@@ -151,7 +151,7 @@ public class TextUtilitiesTest {
int length= Math.max(index0, index1) - offset;
int stringLength= (int) (Math.random() * 10);
- StringBuffer buffer= new StringBuffer(stringLength);
+ StringBuilder buffer= new StringBuilder(stringLength);
for (int i= 0; i < stringLength; ++i)
buffer.append(character);
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java
index aefce8abe..f9abc9e82 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/GlobalTemplateVariablesDateTest.java
@@ -55,7 +55,7 @@ public class GlobalTemplateVariablesDateTest {
TemplateBuffer buffer= fTranslator.translate("Today is ${date}!");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("Today is ");
expected.append(DateFormat.getDateInstance().format(new java.util.Date()));
expected.append("!");
@@ -67,7 +67,7 @@ public class GlobalTemplateVariablesDateTest {
TemplateBuffer buffer= fTranslator.translate("This format ${d:date('dd MMM YYYY')} and not ${p:date('YYYY-MM-dd')}");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("This format ");
expected.append(new SimpleDateFormat("dd MMM YYYY").format(new java.util.Date()));
expected.append(" and not ");
@@ -80,7 +80,7 @@ public class GlobalTemplateVariablesDateTest {
TemplateBuffer buffer= fTranslator.translate("From ${d:date('dd MMM YYYY', 'fr')} to ${d}");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("From ");
expected.append(new SimpleDateFormat("dd MMM YYYY", ULocale.FRENCH).format(new java.util.Date()));
expected.append(" to ");
@@ -93,7 +93,7 @@ public class GlobalTemplateVariablesDateTest {
TemplateBuffer buffer= fTranslator.translate("France ${d:date('EEEE dd MMMM YYYY', 'fr_FR')} and Germany ${p:date('EEEE dd. MMMM YYYY', 'de_DE')}");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("France ");
expected.append(new SimpleDateFormat("EEEE dd MMMM YYYY", ULocale.FRANCE).format(new java.util.Date()));
expected.append(" and Germany ");
@@ -106,7 +106,7 @@ public class GlobalTemplateVariablesDateTest {
TemplateBuffer buffer= fTranslator.translate("Today is ${d:date('invalid')}!");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("Today is ");
expected.append(DateFormat.getDateInstance().format(new java.util.Date()));
expected.append("!");
@@ -118,7 +118,7 @@ public class GlobalTemplateVariablesDateTest {
TemplateBuffer buffer= fTranslator.translate("Today is ${d:date('YYYY-MM-dd', 'this_invalid_locale')}!");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("Today is ");
expected.append(new SimpleDateFormat("YYYY-MM-dd", new ULocale("this_invalid_locale")).format(new java.util.Date()));
expected.append("!");
diff --git a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateVariablesWordSelectionTest.java b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateVariablesWordSelectionTest.java
index 27ca0cb1f..df8be9092 100644
--- a/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateVariablesWordSelectionTest.java
+++ b/org.eclipse.text.tests/src/org/eclipse/text/tests/templates/TemplateVariablesWordSelectionTest.java
@@ -50,7 +50,7 @@ public class TemplateVariablesWordSelectionTest {
TemplateBuffer buffer= fTranslator.translate("Selected word is ${word_selection}!");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("Selected word is !");
assertBufferStringAndVariables(expected.toString(), buffer);
}
@@ -60,7 +60,7 @@ public class TemplateVariablesWordSelectionTest {
TemplateBuffer buffer= fTranslator.translate("No selection results in the ${w:word_selection('default')} text.");
fType.resolve(buffer, fContext);
- StringBuffer expected= new StringBuffer();
+ StringBuilder expected= new StringBuilder();
expected.append("No selection results in the default text.");
assertBufferStringAndVariables(expected.toString(), buffer);
}
diff --git a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java
index 7d6fe7d61..ad18843a6 100644
--- a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java
+++ b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/SegmentedModeTest.java
@@ -87,7 +87,7 @@ public class SegmentedModeTest {
int caret= styledText.getCaretOffset();
styledText.replaceTextRange(caret, 0, "really ");
- StringBuffer buffer= new StringBuffer(getOriginalContent());
+ StringBuilder buffer= new StringBuilder(getOriginalContent());
buffer.insert(5, "really ");
IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput());
assertEquals(buffer.toString(), document.get());
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
index f8eeb6e80..9956e1dd5 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaAutoIndentStrategy.java
@@ -221,7 +221,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
int p= (command.offset == docLength ? command.offset - 1 : command.offset);
int line= document.getLineOfOffset(p);
- StringBuffer buf= new StringBuffer(command.text);
+ StringBuilder buf= new StringBuilder(command.text);
if (command.offset < docLength && document.getChar(command.offset) == '}') {
int indLine= findMatchingOpenBracket(document, line, command.offset, 0);
if (indLine == -1) {
@@ -264,7 +264,7 @@ public class JavaAutoIndentStrategy extends DefaultIndentLineAutoEditStrategy {
int indLine= findMatchingOpenBracket(document, line, command.offset, 1);
if (indLine != -1 && indLine != line) {
// take the indent of the found line
- StringBuffer replaceText= new StringBuffer(getIndentOfLine(document, indLine));
+ StringBuilder replaceText= new StringBuilder(getIndentOfLine(document, indLine));
// add the rest of the current line including the just added close bracket
replaceText.append(document.get(whiteend, command.offset - whiteend));
replaceText.append(command.text);
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 497865c87..aecfa6e56 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -2976,7 +2976,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
private void triggerAction(String actionID, MouseEvent e) {
// ActionId can be prefixed with modifiers
- StringBuffer newActionId = new StringBuffer(""); //$NON-NLS-1$
+ StringBuilder newActionId = new StringBuilder(""); //$NON-NLS-1$
if ((e.stateMask & SWT.MOD1) > 0) {
newActionId.append("M1+"); //$NON-NLS-1$
}

Back to the top