Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2017-06-28 13:42:32 -0400
committerLars Vogel2017-06-28 17:04:46 -0400
commit2da5c4c44f32c6db2c1b5c27c49a93846ee7eefb (patch)
tree5ac3e435e3132ceb1a7be0da68e7202d872b3c07
parent9449179a6d6fdfec8e51e80dd2fd4ea7d8586325 (diff)
downloadeclipse.platform.text-2da5c4c44f32c6db2c1b5c27c49a93846ee7eefb.tar.gz
eclipse.platform.text-2da5c4c44f32c6db2c1b5c27c49a93846ee7eefb.tar.xz
eclipse.platform.text-2da5c4c44f32c6db2c1b5c27c49a93846ee7eefb.zip
Bug 516535 - Replace StringBuffer with StringBuilder inI20170629-0425I20170629-0210I20170628-2000
eclipse.platform.text org.eclipse.search.tests changes Change-Id: If1aba20b4a014e39f97cee8d1f552ecf6e6f534a Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java6
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java12
-rw-r--r--org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java2
3 files changed, 10 insertions, 10 deletions
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java
index 2a8f62330..f0ac8c9e9 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileCharSequenceTests.java
@@ -46,7 +46,7 @@ public class FileCharSequenceTests {
@Test
public void testFileCharSequence() throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
for (int i= 0; i < 500; i++) {
buf.append(TEST_CONTENT);
}
@@ -56,7 +56,7 @@ public class FileCharSequenceTests {
@Test
public void testFileCharSequence2() throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
for (int i= 0; i < 2000; i++) {
buf.append(TEST_CONTENT);
}
@@ -66,7 +66,7 @@ public class FileCharSequenceTests {
@Test
public void testFileCharSequence3() throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
for (int i= 0; i < FileCharSequenceProvider.BUFFER_SIZE * 2; i++) {
buf.append(TEST_CONTENT);
}
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java
index 8a8502390..d0ceb1def 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/FileSearchTests.java
@@ -136,7 +136,7 @@ public class FileSearchTests {
}
private void testSimpleFiles(TestResultCollector collector) throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
buf.append("File1\n");
buf.append("hello\n");
buf.append("more hello\n");
@@ -168,7 +168,7 @@ public class FileSearchTests {
}
private void testWildCards1(TestResultCollector collector) throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
buf.append("File1\n");
buf.append("no more\n");
buf.append("mornings\n");
@@ -198,7 +198,7 @@ public class FileSearchTests {
}
private void testWildCards2(TestResultCollector collector) throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
buf.append("File1\n");
buf.append("no more\n");
buf.append("mornings\n");
@@ -272,7 +272,7 @@ public class FileSearchTests {
}
private void testWholeWord(TestResultCollector collector) throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
// nothing after
buf.append("hell\n"); // nothing before
buf.append("hill\n"); // nothing before
@@ -328,7 +328,7 @@ public class FileSearchTests {
}
private void testFileOpenInEditor(TestResultCollector collector) throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
buf.append("File1\n");
buf.append("hello\n");
buf.append("more hello\n");
@@ -366,7 +366,7 @@ public class FileSearchTests {
}
private void testDerivedFiles(TestResultCollector collector) throws Exception {
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
buf.append("hello\n");
IFolder folder1= ResourceHelper.createFolder(fProject.getFolder("folder1"));
ResourceHelper.createFile(folder1, "file1", buf.toString());
diff --git a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java
index 961316115..ec5659a00 100644
--- a/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java
+++ b/org.eclipse.search.tests/src/org/eclipse/search/tests/filesearch/PositionTrackerTest.java
@@ -101,7 +101,7 @@ public class PositionTrackerTest {
Position currentPosition= InternalSearchUI.getInstance().getPositionTracker().getCurrentPosition(matches[i]);
assertNotNull(currentPosition);
String text= doc.get(currentPosition.offset, currentPosition.length);
- StringBuffer buf= new StringBuffer();
+ StringBuilder buf= new StringBuilder();
buf.append(text.charAt(0));
buf.append(text.substring(5));
assertEquals(buf.toString(), ((FileSearchQuery) result.getQuery()).getSearchString());

Back to the top