From cc3dd07d9648cd5b2174c526ff613aa85b0c6233 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 22 Jun 2021 09:45:54 +0200 Subject: [PATCH] Bug 574376 - [dogfooding][cleanup] Use new StringBuffer -> StringBuilder cleanup for test code Runs the new StringBuffer-> StringBuilder This help to determine that it works correctly for clients we should run it also on our own code base. This help to ensure that the cleanup works fine and helps us to cleanup our own code base. From the commit message of the cleanup: - create a cleanup to replace usage of StringBuffer with StringBuilder. The two are equivalent, but StringBuffer is thread-safe and synchronized which makes it slower than StringBuilder which was introduced in Java 1.5. This uses the local variable change only. Change-Id: I6e4de0112ab8183243d80c4a34c5281529d9f170 Signed-off-by: Lars Vogel Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.ui/+/182328 Tested-by: JDT Bot Reviewed-by: Jeff Johnston --- .../tests/refactoring/ValidateEditTests.java | 30 +- .../ui/tests/refactoring/ccp/MoveTest.java | 24 +- .../nls/NLSSourceModifierTest.java | 44 +- .../nls/NlsRefactoringCreateChangeTest.java | 110 +- .../jdt/junit/tests/JUnit3TestFinderTest.java | 38 +- .../jdt/junit/tests/JUnit4TestFinderTest.java | 36 +- .../jdt/ui/tests/core/AddImportTest.java | 146 +- .../jdt/ui/tests/core/BindingsNameTest.java | 4 +- .../jdt/ui/tests/core/CodeFormatterTest.java | 10 +- .../ui/tests/core/CodeFormatterUtilTest.java | 56 +- .../jdt/ui/tests/core/ImportOrganizeTest.java | 350 ++-- .../ui/tests/core/ImportOrganizeTest1d8.java | 48 +- .../jdt/ui/tests/core/PartialASTTest.java | 24 +- .../jdt/ui/tests/core/ScopeAnalyzerTest.java | 12 +- .../AddUnimplementedConstructorsTest.java | 6 +- .../source/AddUnimplementedMethodsTest.java | 18 +- .../GenerateConstructorUsingFieldsTest.java | 4 +- .../source/GenerateDelegateMethodsTest.java | 4 +- .../quickfix/AdvancedQuickAssistTest.java | 588 +++---- .../quickfix/AdvancedQuickAssistTest1d7.java | 44 +- .../quickfix/AdvancedQuickAssistTest1d8.java | 8 +- .../ui/tests/quickfix/AssistQuickFixTest.java | 1048 ++++++------ .../tests/quickfix/AssistQuickFixTest10.java | 56 +- .../tests/quickfix/AssistQuickFixTest12.java | 12 +- .../tests/quickfix/AssistQuickFixTest14.java | 52 +- .../tests/quickfix/AssistQuickFixTest1d7.java | 76 +- .../tests/quickfix/AssistQuickFixTest1d8.java | 398 ++--- .../quickfix/ChangeNonStaticToStaticTest.java | 78 +- .../ui/tests/quickfix/CleanUpActionTest.java | 4 +- .../tests/quickfix/CleanUpAnnotationTest.java | 16 +- .../jdt/ui/tests/quickfix/CleanUpTest.java | 18 +- .../quickfix/ContributedQuickFixTest.java | 8 +- .../quickfix/GetterSetterQuickFixTest.java | 28 +- .../tests/quickfix/JavadocQuickFixTest.java | 138 +- .../LocalCorrectionsQuickFixTest.java | 1462 ++++++++--------- .../LocalCorrectionsQuickFixTest1d7.java | 92 +- .../LocalCorrectionsQuickFixTest1d8.java | 102 +- .../tests/quickfix/MarkerResolutionTest.java | 8 +- .../ModifierCorrectionsQuickFixTest.java | 538 +++--- .../ModifierCorrectionsQuickFixTest1d7.java | 46 +- .../ModifierCorrectionsQuickFixTest9.java | 26 +- .../NullAnnotationsCleanUpTest1d8.java | 8 +- .../quickfix/NullAnnotationsQuickFixTest.java | 220 +-- .../NullAnnotationsQuickFixTest1d8.java | 158 +- .../NullAnnotationsQuickFixTest1d8Mix.java | 14 +- .../NullAnnotationsQuickFixTest9.java | 28 +- .../PropertiesFileQuickAssistTest.java | 76 +- .../quickfix/QuickFixEnablementTest.java | 8 +- .../jdt/ui/tests/quickfix/QuickFixTest14.java | 2 +- .../ui/tests/quickfix/QuickFixTest1d8.java | 224 +-- .../ui/tests/quickfix/ReorgQuickFixTest.java | 104 +- .../quickfix/ReturnTypeQuickFixTest.java | 132 +- .../quickfix/SerialVersionQuickFixTest.java | 36 +- .../quickfix/SurroundWithTemplateTest.java | 16 +- .../quickfix/TypeMismatchQuickFixTests.java | 314 ++-- .../quickfix/TypeParameterMismatchTest.java | 12 +- .../UnresolvedMethodsQuickFixTest.java | 748 ++++----- .../UnresolvedMethodsQuickFixTest1d8.java | 54 +- .../quickfix/UnresolvedTypesQuickFixTest.java | 242 +-- .../UnresolvedVariablesQuickFixTest.java | 366 ++--- .../jdt/ui/tests/search/NLSSearchTest.java | 90 +- .../ui/tests/wizardapi/NewTypeWizardTest.java | 26 +- .../history/MockRefactoringDescriptor.java | 2 +- 63 files changed, 4345 insertions(+), 4345 deletions(-) diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ValidateEditTests.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ValidateEditTests.java index 12e4f5e3595..ff2765f6ffa 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ValidateEditTests.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ValidateEditTests.java @@ -76,14 +76,14 @@ public void tearDown() throws Exception { public void testPackageRename1() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("class A {\n"); buf.append("}\n"); ICompilationUnit cu1= fragment.createCompilationUnit("A.java", buf.toString(), true, null); setReadOnly(cu1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("class B {\n"); buf.append("}\n"); @@ -110,14 +110,14 @@ public void testPackageRename2() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class A {\n"); buf.append("}\n"); ICompilationUnit cu1= fragment.createCompilationUnit("A.java", buf.toString(), true, null); setReadOnly(cu1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class B {\n"); buf.append("}\n"); @@ -126,7 +126,7 @@ public void testPackageRename2() throws Exception { IPackageFragment fragment2= getRoot().createPackageFragment("org.other", true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.other;\n"); buf.append("public class C extends org.test.A {\n"); buf.append("}\n"); @@ -219,14 +219,14 @@ public void testCURename() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); ICompilationUnit cu1= fragment.createCompilationUnit("MyClass.java", buf.toString(), true, null); setReadOnly(cu1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class C extends MyClass {\n"); buf.append("}\n"); @@ -252,14 +252,14 @@ public void testTypeRename() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); ICompilationUnit cu1= fragment.createCompilationUnit("MyClass.java", buf.toString(), true, null); setReadOnly(cu1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class C extends MyClass {\n"); buf.append("}\n"); @@ -287,7 +287,7 @@ public void testMoveCU2() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); IPackageFragment otherFragment= getRoot().createPackageFragment("org.test1", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); @@ -299,7 +299,7 @@ public void testMoveCU2() throws Exception { file.create(getStream(content), true, null); setReadOnly(file); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class C extends MyClass {\n"); buf.append("}\n"); @@ -361,7 +361,7 @@ public void testMoveCuWithReplace() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); IPackageFragment otherFragment= getRoot().createPackageFragment("org.test1", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); @@ -369,7 +369,7 @@ public void testMoveCuWithReplace() throws Exception { setReadOnly(cu1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test1;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); @@ -400,14 +400,14 @@ public void testCopyCuWithReplace() throws Exception { IPackageFragment fragment= getRoot().createPackageFragment("org.test", true, null); IPackageFragment otherFragment= getRoot().createPackageFragment("org.test1", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package org.test;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); ICompilationUnit cu1= fragment.createCompilationUnit("MyClass.java", buf.toString(), true, null); setReadOnly(cu1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package org.test1;\n"); buf.append("public class MyClass {\n"); buf.append("}\n"); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/MoveTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/MoveTest.java index 29d93f00951..f663e702faf 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/MoveTest.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ccp/MoveTest.java @@ -972,7 +972,7 @@ public void testDestination_yes_cuToOtherPackage() throws Exception { public void testDestination_yes_cuToOtherPackageBug549674() throws Exception { ParticipantTesting.reset(); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import q.Class1;\n"); @@ -986,13 +986,13 @@ public void testDestination_yes_cuToOtherPackageBug549674() throws Exception { buf.append("}\n"); ICompilationUnit toMove= getPackageP().createCompilationUnit("Class2.java", buf.toString(), false, new NullProgressMonitor()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package q;\n"); buf.append("public class Class1 {\n"); buf.append("}\n"); getPackageQ().createCompilationUnit("Class1.java", buf.toString(), false, new NullProgressMonitor()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package q;\n"); buf.append("public class Class3 {\n"); buf.append(" public interface InnerClass3 {\n"); @@ -1012,7 +1012,7 @@ public void testDestination_yes_cuToOtherPackageBug549674() throws Exception { ICompilationUnit newCu= getPackageQ().getCompilationUnit(toMove.getElementName()); assertTrue("new file does not exist after moving", newCu.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package q;\n"); buf.append("\n"); buf.append("import q.Class3.InnerClass3;\n"); @@ -1036,7 +1036,7 @@ public void testDestination_yes_cuToOtherPackageBug549674() throws Exception { public void testDestination_yes_cuToOtherPackageBug21008() throws Exception { ParticipantTesting.reset(); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import q.*;\n"); @@ -1048,13 +1048,13 @@ public void testDestination_yes_cuToOtherPackageBug21008() throws Exception { buf.append("}\n"); ICompilationUnit toMove= getPackageP().createCompilationUnit("Class2.java", buf.toString(), false, new NullProgressMonitor()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package q;\n"); buf.append("public class Class1 {\n"); buf.append("}\n"); getPackageQ().createCompilationUnit("Class1.java", buf.toString(), false, new NullProgressMonitor()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package q;\n"); buf.append("public class Class3 {\n"); buf.append(" public interface InnerClass3 {\n"); @@ -1074,7 +1074,7 @@ public void testDestination_yes_cuToOtherPackageBug21008() throws Exception { ICompilationUnit newCu= getPackageQ().getCompilationUnit(toMove.getElementName()); assertTrue("new file does not exist after moving", newCu.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package q;\n"); buf.append("\n"); buf.append("public class Class2 {\n"); @@ -1135,7 +1135,7 @@ public void testDestination_yes_cuToOtherPackageWithMultiRoot() throws Exception public void testDestination_yes_cuToOtherPackageWithMultiRootBug109145() throws Exception { ParticipantTesting.reset(); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class Class2 {\n"); buf.append(" Class1 c;\n"); @@ -1144,7 +1144,7 @@ public void testDestination_yes_cuToOtherPackageWithMultiRootBug109145() throws IPackageFragmentRoot testSrc= JavaProjectHelper.addSourceContainer(rts.getProject(), "testSrc"); IPackageFragment testP= testSrc.createPackageFragment("p", true, new NullProgressMonitor()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class Class1 {\n"); buf.append("}\n"); @@ -1163,7 +1163,7 @@ public void testDestination_yes_cuToOtherPackageWithMultiRootBug109145() throws ICompilationUnit newCu= destination.getCompilationUnit(toMove.getElementName()); assertTrue("new file does not exist after moving", newCu.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p2;\n"); buf.append("\n"); buf.append("import p.Class1;\n"); @@ -1173,7 +1173,7 @@ public void testDestination_yes_cuToOtherPackageWithMultiRootBug109145() throws buf.append("}\n"); assertEqualLines(buf.toString(), newCu.getSource()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class Class1 {\n"); buf.append("}\n"); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSSourceModifierTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSSourceModifierTest.java index c5e5e81519e..faf074f7b0d 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSSourceModifierTest.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NLSSourceModifierTest.java @@ -471,7 +471,7 @@ public void fromTranslatedToNotTranslatedEclipse() throws Exception { " private String str=Accessor.k_0;\n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -517,7 +517,7 @@ public void fromTranslatedToNotTranslatedEclipse() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -586,7 +586,7 @@ public void fromTranslatedToSkippedEclipse() throws Exception { " private String str=Accessor.key_0;\n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -632,7 +632,7 @@ public void fromTranslatedToSkippedEclipse() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -698,7 +698,7 @@ public void replacementOfKeyEclipse() throws Exception { " private String str=Accessor.key_0; \n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -745,7 +745,7 @@ public void replacementOfKeyEclipse() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -775,7 +775,7 @@ public void replacementOfKeysBug223865() throws Exception { " private String str=Accessor.key_1;\n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -829,7 +829,7 @@ public void replacementOfKeysBug223865() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -910,7 +910,7 @@ public void bug95708_2() throws Exception { " private String str2=Accessor.key_0;\n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -956,7 +956,7 @@ public void bug95708_2() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -986,7 +986,7 @@ public void insertionOrder1() throws Exception { " private String str5=\"z\";\n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1043,7 +1043,7 @@ public void insertionOrder1() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1076,7 +1076,7 @@ public void insertionOrder2() throws Exception { " private String str5=\"z\";\n" + "}\n"; - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1135,7 +1135,7 @@ public void insertionOrder2() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1159,7 +1159,7 @@ public void insertionOrder2() throws Exception { @Test public void insertionOrder3() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" private String str1= Accessor.Test_A_1;\n"); @@ -1168,7 +1168,7 @@ public void insertionOrder3() throws Exception { buf.append("}\n"); String klazz= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1210,7 +1210,7 @@ public void insertionOrder3() throws Exception { Document doc = new Document(klazz); change.getEdit().apply(doc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" private String str1= Accessor.Test_A_1;\n"); @@ -1225,7 +1225,7 @@ public void insertionOrder3() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1251,7 +1251,7 @@ public void insertionOrder3() throws Exception { @Test public void insertionOrder4() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" private String str1= Accessor.Test_A_a;\n"); @@ -1263,7 +1263,7 @@ public void insertionOrder4() throws Exception { buf.append("}\n"); String klazz= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -1314,7 +1314,7 @@ public void insertionOrder4() throws Exception { Document doc = new Document(klazz); change.getEdit().apply(doc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" private String str1= Accessor.Test_A_a;\n"); @@ -1332,7 +1332,7 @@ public void insertionOrder4() throws Exception { Document accessorDoc= new Document(accessorKlazz); accessorChange.getEdit().apply(accessorDoc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); diff --git a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCreateChangeTest.java b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCreateChangeTest.java index f4c8fb630c1..4753fa0a435 100644 --- a/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCreateChangeTest.java +++ b/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/nls/NlsRefactoringCreateChangeTest.java @@ -73,7 +73,7 @@ public void withoutPreviousNlsing() throws Exception { fHelper.createPackageFragment("p2", "/TestSetupProject/src2"); //$NON-NLS-1$//$NON-NLS-2$ // class to NLS - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\r\n"); buf.append("class Test {\n"); buf.append(" String hello=\"helloworld\";\n"); @@ -86,7 +86,7 @@ public void withoutPreviousNlsing() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\r\n\r\n"); buf.append("import p2.Messages;\r\n\r\n"); buf.append("class Test {\n"); @@ -94,7 +94,7 @@ public void withoutPreviousNlsing() throws Exception { buf.append("}"); checkContentOfCu("manipulated class", cu, buf.toString()); //$NON-NLS-1$ - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("test0=helloworld\n"); checkContentOfFile("properties", fHelper.getFile("/TestSetupProject/src2/p/test.properties"), buf.toString()); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -103,7 +103,7 @@ public void withoutPreviousNlsing() throws Exception { @Test public void createChangeWithCollidingImport() throws Exception { //class to NLS - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import p.another.Messages;\n"); buf.append("class Test {"); @@ -115,7 +115,7 @@ public void createChangeWithCollidingImport() throws Exception { performChange(nls); - buf=new StringBuffer(); + buf=new StringBuilder(); buf.append("package p;\n" ); buf.append("import p.another.Messages;\n"); buf.append("class Test {" ); @@ -123,7 +123,7 @@ public void createChangeWithCollidingImport() throws Exception { buf.append("}"); checkContentOfCu("manipulated class", cu, buf.toString()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("test0=helloworld\n"); checkContentOfFile("properties", fHelper.getFile("/TestSetupProject/src2/p/test.properties"), buf.toString()); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -133,7 +133,7 @@ public void createChangeWithCollidingImport() throws Exception { @Test public void createChangeWithExistingAccessorclassInDifferentPackage() throws Exception { //Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class Accessor {\n"); buf.append(" private static final String BUNDLE_NAME = \"test.test\";//$NON-NLS-1$\n"); @@ -144,7 +144,7 @@ public void createChangeWithExistingAccessorclassInDifferentPackage() throws Exc GenericRefactoringTest.createCU(fHelper.getPackageFragment("/TestSetupProject/src1/p"), "Accessor.java", buf.toString()); //class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("class Test {\n"); buf.append(" String hello=\"hello\";\n"); @@ -171,7 +171,7 @@ public void createChangeWithExistingAccessorclassInDifferentPackage() throws Exc performChange(nls); //class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import p.Accessor;\n\n"); buf.append("class Test {\n"); @@ -185,7 +185,7 @@ public void createChangeWithExistingAccessorclassInDifferentPackage() throws Exc @Test public void createChangeWithExistingAccessorclassInDifferentPackage_1() throws Exception { //Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class Accessor {\n"); buf.append(" private static final String BUNDLE_NAME = \"test.test\";//$NON-NLS-1$\n"); @@ -196,7 +196,7 @@ public void createChangeWithExistingAccessorclassInDifferentPackage_1() throws E GenericRefactoringTest.createCU(fHelper.getPackageFragment("/TestSetupProject/src1/p"), "Accessor.java", buf.toString()); //class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("class Test {\n"); buf.append(" String hello=\"helloworld\";\n"); @@ -218,7 +218,7 @@ public void createChangeWithExistingAccessorclassInDifferentPackage_1() throws E performChange(nls); //class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("class Test {\n"); buf.append(" String hello=\"helloworld\"; //$NON-NLS-1$\n"); @@ -228,7 +228,7 @@ public void createChangeWithExistingAccessorclassInDifferentPackage_1() throws E @Test public void createChangeWithNonDefaultSubstitution() throws Exception { //class to NLS - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import p.another.Messages;\n"); buf.append("class Test {\n"); @@ -242,7 +242,7 @@ public void createChangeWithNonDefaultSubstitution() throws Exception { nls.setSubstitutionPattern(string); performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import p.another.Messages;\n"); buf.append("class Test {\n"); @@ -251,7 +251,7 @@ public void createChangeWithNonDefaultSubstitution() throws Exception { checkContentOfCu("manipulated class", //$NON-NLS-1$ cu, buf.toString()); - buf=new StringBuffer(); + buf=new StringBuilder(); buf.append("test0=helloworld\n"); checkContentOfFile("properties", fHelper.getFile("/TestSetupProject/src2/p/test.properties"), buf.toString()); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -276,14 +276,14 @@ public void externalizedToIgnore() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("A.1=Hello1\n"); buf.append("A.2=Hello2\n"); buf.append("A.3=Hello3\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"A.1\"); //$NON-NLS-1$\n"); @@ -300,13 +300,13 @@ public void externalizedToIgnore() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("A.2=Hello2\n"); buf.append("A.3=Hello3\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= \"Hello1\"; //$NON-NLS-1$\n"); @@ -324,13 +324,13 @@ public void insertToDuplicate() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -350,13 +350,13 @@ public void insertToDuplicate() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -374,14 +374,14 @@ public void renameToDuplicate() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); buf.append("Test.3=Hello3\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -400,13 +400,13 @@ public void renameToDuplicate() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -424,13 +424,13 @@ public void renameDuplicate() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -449,14 +449,14 @@ public void renameDuplicate() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); buf.append("Test.3=Hello3\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -474,13 +474,13 @@ public void internalizeDuplicate() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -498,13 +498,13 @@ public void internalizeDuplicate() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -522,13 +522,13 @@ public void internalizeAndInsert() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -550,13 +550,13 @@ public void internalizeAndInsert() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= \"Hello1\"; \n"); @@ -575,13 +575,13 @@ public void addMissing1() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -599,14 +599,14 @@ public void addMissing1() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); buf.append("Test.3=Hello3\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -624,13 +624,13 @@ public void addMissing2() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -651,14 +651,14 @@ public void addMissing2() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello22\n"); buf.append("Test.3=Hello3\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -676,12 +676,12 @@ public void noNewLineAtEnd() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -699,13 +699,13 @@ public void noNewLineAtEnd() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -722,12 +722,12 @@ public void twoInsertsNoNewLineAtEnd() throws Exception { createDefaultAccessor(pack1); // property file - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("Test.1=Hello1"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); @@ -750,14 +750,14 @@ public void twoInsertsNoNewLineAtEnd() throws Exception { performChange(nls); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test.1=Hello1\n"); buf.append("Test.2=Hello2\n"); buf.append("Test.3=Hello3\n"); checkContentOfFile("property file", file, buf.toString()); // class to NLS - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" String hello1= Accessor.getString(\"Test.1\"); //$NON-NLS-1$\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit3TestFinderTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit3TestFinderTest.java index 45785c9c89c..2ea21cfb095 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit3TestFinderTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit3TestFinderTest.java @@ -62,7 +62,7 @@ public void tearDown() throws Exception { @Test public void testTestCase() throws Exception { IPackageFragment p= fRoot.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -75,7 +75,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest1, new String[] { "p.MyTest" }); assertTestFound(validTest1.getCompilationUnit(), new String[] { "p.MyTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -88,7 +88,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest2, new String[] { "p.MySuperTest" }); assertTestFound(validTest2.getCompilationUnit(), new String[] { "p.MySuperTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -102,7 +102,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest3, new String[] { "p.InvisibleTest" }); assertTestFound(validTest3.getCompilationUnit(), new String[] { "p.InvisibleTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -117,7 +117,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest4, new String[] { "p.Outer.InnerTest" }); assertTestFound(validTest4.getCompilationUnit(), new String[] { "p.Outer.InnerTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -142,7 +142,7 @@ public void testTestCase() throws Exception { assertTestFound(invalidTests[0].getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -155,7 +155,7 @@ public void testTestCase() throws Exception { assertTestFound(invalidTest1, new String[] {}); assertTestFound(invalidTest1.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Vector;\n"); buf.append("\n"); @@ -178,7 +178,7 @@ public void testTestCase() throws Exception { @Test public void testSuite() throws Exception { IPackageFragment p= fRoot.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -192,7 +192,7 @@ public void testSuite() throws Exception { assertTestFound(validTest1, new String[] { "p.SuiteClass" }); assertTestFound(validTest1.getCompilationUnit(), new String[] { "p.SuiteClass" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -206,7 +206,7 @@ public void testSuite() throws Exception { assertTestFound(validTest2, new String[] { "p.AbstractSuiteClass" }); assertTestFound(validTest2.getCompilationUnit(), new String[] { "p.AbstractSuiteClass" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -220,7 +220,7 @@ public void testSuite() throws Exception { assertTestFound(validTest3, new String[] { "p.InvisibleSuiteClass" }); assertTestFound(validTest3.getCompilationUnit(), new String[] { "p.InvisibleSuiteClass" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -236,7 +236,7 @@ public void testSuite() throws Exception { assertTestFound(validTest4, new String[] { "p.SuiteOuter.InnerSuite" }); assertTestFound(validTest4.getCompilationUnit(), new String[] { "p.SuiteOuter.InnerSuite" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -261,7 +261,7 @@ public void testSuite() throws Exception { } assertTestFound(invalidTests[0].getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -275,7 +275,7 @@ public void testSuite() throws Exception { assertTestFound(invalidTest1, new String[] {}); assertTestFound(invalidTest1.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -289,7 +289,7 @@ public void testSuite() throws Exception { assertTestFound(invalidTest2, new String[] {}); assertTestFound(invalidTest2.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -313,7 +313,7 @@ public void testSuite() throws Exception { @Test public void testTestInterface() throws Exception { IPackageFragment p= fRoot.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("import junit.framework.TestResult;\n"); @@ -330,7 +330,7 @@ public void testTestInterface() throws Exception { assertTestFound(validTest1, new String[] { "p.MyITest" }); assertTestFound(validTest1.getCompilationUnit(), new String[] { "p.MyITest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class MySuperITest extends MyITest {\n"); @@ -342,7 +342,7 @@ public void testTestInterface() throws Exception { assertTestFound(validTest2, new String[] { "p.MySuperITest" }); assertTestFound(validTest2.getCompilationUnit(), new String[] { "p.MySuperITest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.Test;\n"); buf.append("\n"); @@ -353,7 +353,7 @@ public void testTestInterface() throws Exception { assertTestFound(invalidTest1, new String[] {}); assertTestFound(invalidTest1.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestResult;\n"); buf.append("\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit4TestFinderTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit4TestFinderTest.java index 83c2a6b9093..a91f927c1d1 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit4TestFinderTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/junit/tests/JUnit4TestFinderTest.java @@ -72,7 +72,7 @@ public void tearDown() throws Exception { @Test public void testTestCase() throws Exception { IPackageFragment p= fRoot.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -85,7 +85,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest1, new String[] { "p.MyTest" }); assertTestFound(validTest1.getCompilationUnit(), new String[] { "p.MyTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -98,7 +98,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest2, new String[] { "p.MySuperTest" }); assertTestFound(validTest2.getCompilationUnit(), new String[] { "p.MySuperTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -112,7 +112,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest3, new String[] { "p.InvisibleTest" }); assertTestFound(validTest3.getCompilationUnit(), new String[] { "p.InvisibleTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -127,7 +127,7 @@ public void testTestCase() throws Exception { assertTestFound(validTest4, new String[] { "p.Outer.InnerTest" }); assertTestFound(validTest4.getCompilationUnit(), new String[] { "p.Outer.InnerTest" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -152,7 +152,7 @@ public void testTestCase() throws Exception { assertTestFound(invalidTests[0].getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import junit.framework.TestCase;\n"); buf.append("\n"); @@ -165,7 +165,7 @@ public void testTestCase() throws Exception { assertTestFound(invalidTest1, new String[] {}); assertTestFound(invalidTest1.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Vector;\n"); buf.append("\n"); @@ -211,7 +211,7 @@ public void testSuiteFinder() throws Exception { @Test public void testRunWith() throws Exception { IPackageFragment p= fRoot.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.Test;\n"); @@ -222,7 +222,7 @@ public void testRunWith() throws Exception { buf.append("}\n"); p.createCompilationUnit("Test1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.runner.RunWith;\n"); @@ -239,7 +239,7 @@ public void testRunWith() throws Exception { assertTestFound(validTest1, new String[] { "p.Test2" }); assertTestFound(validTest1.getCompilationUnit(), new String[] { "p.Test2" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class Test3 extends Test2 {\n"); @@ -250,7 +250,7 @@ public void testRunWith() throws Exception { assertTestFound(validTest2, new String[] { "p.Test3" }); assertTestFound(validTest2.getCompilationUnit(), new String[] { "p.Test3" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.runner.RunWith;\n"); @@ -267,7 +267,7 @@ public void testRunWith() throws Exception { assertTestFound(invalidTest1, new String[] {}); assertTestFound(invalidTest1.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.runner.RunWith;\n"); @@ -284,7 +284,7 @@ public void testRunWith() throws Exception { assertTestFound(validTest3, new String[] { "p.Test5"}); assertTestFound(validTest3.getCompilationUnit(), new String[] { "p.Test5" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.runner.RunWith;\n"); @@ -298,7 +298,7 @@ public void testRunWith() throws Exception { assertTestFound(invalidTest2, new String[] {}); assertTestFound(invalidTest2.getCompilationUnit(), new String[] {}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("import java.util.Arrays;\n"); buf.append("import java.util.Collection;\n"); buf.append("\n"); @@ -338,7 +338,7 @@ public void testRunWith() throws Exception { @Test public void testTestAnnotation() throws Exception { IPackageFragment p= fRoot.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.Test;\n"); @@ -353,7 +353,7 @@ public void testTestAnnotation() throws Exception { assertTestFound(validTest1.getCompilationUnit(), new String[] { "p.Test1" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class Test2 extends Test1 {\n"); @@ -366,7 +366,7 @@ public void testTestAnnotation() throws Exception { assertTestFound(validTest2.getCompilationUnit(), new String[] { "p.Test2" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.Test;\n"); @@ -381,7 +381,7 @@ public void testTestAnnotation() throws Exception { assertTestFound(validTest3.getCompilationUnit(), new String[] { "p.Test3" }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import org.junit.Test;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java index d62e77e0d17..79bd7df2c40 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/AddImportTest.java @@ -86,7 +86,7 @@ public void testAddImports1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); @@ -109,7 +109,7 @@ public void testAddImports1() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.net.Socket;\n"); @@ -134,7 +134,7 @@ public void testAddImports2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -151,7 +151,7 @@ public void testAddImports2() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.x.Socket;\n"); @@ -169,7 +169,7 @@ public void testAddImports3() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set; // comment\n"); @@ -185,7 +185,7 @@ public void testAddImports3() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set; // comment\n"); @@ -201,7 +201,7 @@ public void testRemoveImports1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -223,7 +223,7 @@ public void testRemoveImports1() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -240,7 +240,7 @@ public void testRemoveImports2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -257,7 +257,7 @@ public void testRemoveImports2() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -272,7 +272,7 @@ public void testRemoveImports3() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -282,7 +282,7 @@ public void testRemoveImports3() throws Exception { pack.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment test1= sourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import pack.A;\n"); @@ -311,7 +311,7 @@ public void testRemoveImports3() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import pack.A;\n"); @@ -327,7 +327,7 @@ public void testAddImports_bug23078() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import p.A.*;\n"); @@ -343,7 +343,7 @@ public void testAddImports_bug23078() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import p.Inner;\n"); @@ -359,7 +359,7 @@ public void testAddImports_bug25113() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.awt.Panel;\n"); @@ -377,7 +377,7 @@ public void testAddImports_bug25113() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.awt.Panel;\n"); @@ -395,7 +395,7 @@ public void testAddImports_bug42637() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -411,7 +411,7 @@ public void testAddImports_bug42637() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.Exception;\n"); @@ -427,7 +427,7 @@ public void testAddStaticImports1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -445,7 +445,7 @@ public void testAddStaticImports1() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.lang.Math.max;\n"); @@ -463,7 +463,7 @@ public void testAddStaticImports2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -481,7 +481,7 @@ public void testAddStaticImports2() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static xx.MyConstants.SIZE;\n"); @@ -502,7 +502,7 @@ public void testImportStructureWithSignatures() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("import java.net.*;\n"); @@ -517,7 +517,7 @@ public void testImportStructureWithSignatures() throws Exception { String content= buf.toString(); ICompilationUnit cu1= pack1.createCompilationUnit("A.java", content, false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B {\n"); buf.append("}\n"); @@ -556,7 +556,7 @@ public void testImportStructureWithSignatures() throws Exception { } apply(importsRewrite); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -696,7 +696,7 @@ public void testImportStructureWithSignatures2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("import java.net.*;\n"); @@ -709,7 +709,7 @@ public void testImportStructureWithSignatures2() throws Exception { String content= buf.toString(); ICompilationUnit cu1= pack1.createCompilationUnit("A.java", content, false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B {\n"); buf.append("}\n"); @@ -731,7 +731,7 @@ public void testImportStructureWithSignatures2() throws Exception { apply(importsRewrite); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); @@ -752,7 +752,7 @@ public void testAddedRemovedImportsAPI() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -800,7 +800,7 @@ public void testAddedRemovedImportsAPI() throws Exception { apply(imports); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.lang.Math.max;\n"); @@ -827,7 +827,7 @@ public void testAddImportAction1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -842,7 +842,7 @@ public void testAddImportAction1() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -859,7 +859,7 @@ public void testAddImportAction2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -874,7 +874,7 @@ public void testAddImportAction2() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -891,7 +891,7 @@ public void testAddImportAction3() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -906,7 +906,7 @@ public void testAddImportAction3() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -923,7 +923,7 @@ public void testAddImportAction4() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -938,7 +938,7 @@ public void testAddImportAction4() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -955,7 +955,7 @@ public void testAddImportAction5() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -976,7 +976,7 @@ public void testAddImportAction5() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -1111,7 +1111,7 @@ public void testAddImportActionBug_409594_test4() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("class SnippetY {\n"); @@ -1130,7 +1130,7 @@ public void testAddImportActionBug_409594_test4() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 3, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import static p.SnippetY.Test.bar;\n"); @@ -1224,7 +1224,7 @@ public void testAddImportAction_bug107206() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -1239,7 +1239,7 @@ public void testAddImportAction_bug107206() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -1255,7 +1255,7 @@ public void testAddImportActionStatic1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -1270,7 +1270,7 @@ public void testAddImportActionStatic1() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.io.File.separator;\n"); @@ -1290,7 +1290,7 @@ public void testAddImportActionStaticWith14() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -1305,7 +1305,7 @@ public void testAddImportActionStaticWith14() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.System;\n"); @@ -1321,7 +1321,7 @@ public void testAddImportActionNestedType1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1334,7 +1334,7 @@ public void testAddImportActionNestedType1() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1348,7 +1348,7 @@ public void testAddImportActionNestedType2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1361,7 +1361,7 @@ public void testAddImportActionNestedType2() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.Thread.State;\n"); @@ -1377,7 +1377,7 @@ public void testAddImportActionParameterizedType1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1390,7 +1390,7 @@ public void testAddImportActionParameterizedType1() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); @@ -1406,7 +1406,7 @@ public void testAddImportActionParameterizedType2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1419,7 +1419,7 @@ public void testAddImportActionParameterizedType2() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Map.Entry;\n"); @@ -1435,7 +1435,7 @@ public void testAddImportActionParameterizedType3() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1448,7 +1448,7 @@ public void testAddImportActionParameterizedType3() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); @@ -1464,7 +1464,7 @@ public void testAddImportActionParameterizedType4() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1477,7 +1477,7 @@ public void testAddImportActionParameterizedType4() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Map.Entry;\n"); @@ -1493,7 +1493,7 @@ public void testAddImportActionParameterizedType5() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("public class Outer {\n"); @@ -1505,7 +1505,7 @@ public void testAddImportActionParameterizedType5() throws Exception { pack2.createCompilationUnit("Outer.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1518,7 +1518,7 @@ public void testAddImportActionParameterizedType5() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack2.Outer.Middle;\n"); @@ -1535,7 +1535,7 @@ public void testAddImportActionParameterizedType6() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("public class Outer {\n"); @@ -1547,7 +1547,7 @@ public void testAddImportActionParameterizedType6() throws Exception { pack2.createCompilationUnit("Outer.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1560,7 +1560,7 @@ public void testAddImportActionParameterizedType6() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1574,7 +1574,7 @@ public void testAddImportActionAnnotatedType1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1591,7 +1591,7 @@ public void testAddImportActionAnnotatedType1() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1611,7 +1611,7 @@ public void testAddImportActionAnnotatedType2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1628,7 +1628,7 @@ public void testAddImportActionAnnotatedType2() throws Exception { AddImportsOperation op= new AddImportsOperation(cu, selOffset, 0, null, true); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1845,14 +1845,14 @@ public void testAddImportContextSensitive10() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public abstract class E1 {\n"); buf.append(" protected class C {}\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class E2 extends E1 {\n"); buf.append(" //<-insert\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java index dc9b67efca9..8980147e18e 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/BindingsNameTest.java @@ -59,13 +59,13 @@ public void setUp() throws Exception { fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("public class X {\n"); buf.append("}\n"); pack0.createCompilationUnit("X.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1.ae", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1.ae;\n"); buf.append("import X;\n"); buf.append("public class E {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterTest.java index addb842be93..8b84f54c613 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterTest.java @@ -111,7 +111,7 @@ private static String format(ICompilationUnit cu, int offset, int length, String @Test public void testFormatSelection() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("/**\n"); buf.append("*\n"); buf.append(" * HEADER\n"); @@ -128,7 +128,7 @@ public void testFormatSelection() throws Exception { String original= buf.toString(); ICompilationUnit cu= pack1.createCompilationUnit("C.java", original, false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append(" /** \n"); buf.append("* Bla\n"); buf.append(" */\n"); @@ -136,7 +136,7 @@ public void testFormatSelection() throws Exception { String formatted= format(cu, original.indexOf(selection), selection.length()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/**\n"); buf.append("*\n"); buf.append(" * HEADER\n"); @@ -156,7 +156,7 @@ public void testFormatSelection() throws Exception { @Test public void testFormatFieldDeclWithExtraWhitespace() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append(" class A {\n"); buf.append(" int i;\n"); @@ -177,7 +177,7 @@ public void testFormatFieldDeclWithExtraWhitespace() throws Exception { edit.apply(doc); String formatted= doc.get(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" int i;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java index 00852a996d0..4247fa6d0ff 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/CodeFormatterUtilTest.java @@ -128,7 +128,7 @@ protected boolean notDeleted() { @Test public void testCU() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -140,7 +140,7 @@ public void testCU() throws Exception { String formatted= CodeFormatterUtil.format(CodeFormatter.K_COMPILATION_UNIT, contents, 0, "\n", fJProject1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -154,7 +154,7 @@ public void testCU() throws Exception { @Test public void testCUIndented() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -166,7 +166,7 @@ public void testCUIndented() throws Exception { String formatted= CodeFormatterUtil.format(CodeFormatter.K_COMPILATION_UNIT, contents, 1, "\n", fJProject1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append(" package test1;\n"); buf.append(" public class A {\n"); buf.append(" public void foo() {\n"); @@ -180,7 +180,7 @@ public void testCUIndented() throws Exception { @Test public void testCUNewAPI() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -195,7 +195,7 @@ public void testCUNewAPI() throws Exception { String formatted= doc.get(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -209,7 +209,7 @@ public void testCUNewAPI() throws Exception { @Test public void testCUNewAPI2() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("/**\n"); @@ -227,7 +227,7 @@ public void testCUNewAPI2() throws Exception { String formatted= doc.get(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" /**\n"); @@ -244,7 +244,7 @@ public void testCUNewAPI2() throws Exception { @Test public void testCUWithPos() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -262,7 +262,7 @@ public void testCUWithPos() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -279,7 +279,7 @@ public void testCUWithPos() throws Exception { @Test public void testPackage() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append(" package com . test1;"); String contents= buf.toString(); @@ -291,14 +291,14 @@ public void testPackage() throws Exception { Document document= new Document(contents); edit.apply(document); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package com.test1;"); assertEqualString(document.get(), buf.toString()); } @Test public void testPackageWithPos() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package com . test1;"); String contents= buf.toString(); @@ -318,7 +318,7 @@ public void testPackageWithPos() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package com.test1;"); String expected= buf.toString(); assertEqualString(formatted, expected); @@ -333,7 +333,7 @@ public void testPackageWithPos() throws Exception { @Test public void testVarDeclStatemenetWithPos() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("x[ ]=\nnew int[ offset]"); String contents= buf.toString(); @@ -353,7 +353,7 @@ public void testVarDeclStatemenetWithPos() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("x[] = new int[offset]"); String expected= buf.toString(); assertEqualString(formatted, expected); @@ -368,7 +368,7 @@ public void testVarDeclStatemenetWithPos() throws Exception { @Test public void testJavadoc() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("/** bar\n"); buf.append(" * foo\n"); buf.append(" */\n"); @@ -390,7 +390,7 @@ public void testJavadoc() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/** bar\n"); buf.append(" * foo\n"); buf.append(" */\n"); @@ -407,7 +407,7 @@ public void testJavadoc() throws Exception { @Test public void testJavadoc2() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("/** bar\n"); buf.append(" * foo\n"); buf.append(" */"); @@ -429,7 +429,7 @@ public void testJavadoc2() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append(" /** bar\n"); buf.append(" * foo\n"); buf.append(" */"); @@ -446,7 +446,7 @@ public void testJavadoc2() throws Exception { @Test public void testJavadoc3() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("/** bar\n"); buf.append(" * foo\n"); buf.append(" */"); @@ -469,7 +469,7 @@ public void testJavadoc3() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/** bar\r\n"); buf.append(" * foo\r\n"); buf.append(" */"); @@ -486,7 +486,7 @@ public void testJavadoc3() throws Exception { @Test public void testCatchClause() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("catch\n"); buf.append("(Exception e) {\n"); buf.append("}"); @@ -508,7 +508,7 @@ public void testCatchClause() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append(" catch (Exception e) {\n"); buf.append("}"); String expected= buf.toString(); @@ -524,7 +524,7 @@ public void testCatchClause() throws Exception { @Test public void testCatchStringLiteral() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("\"Hello\" "); String contents= buf.toString(); @@ -536,7 +536,7 @@ public void testCatchStringLiteral() throws Exception { Document document= new Document(contents); edit.apply(document); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("\"Hello\""); String expected= buf.toString(); assertEqualString(document.get(), expected); @@ -545,7 +545,7 @@ public void testCatchStringLiteral() throws Exception { @Test public void testFormatSubstring() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -579,7 +579,7 @@ public void testFormatSubstring() throws Exception { assertNotNull(edit); String formatted= evaluateFormatterEdit(contents, edit, new Position[] { pos1, pos2, pos3}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java index 887d99f3097..3f0acee3cd1 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java @@ -340,7 +340,7 @@ public void testInnerClassVisibility() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected static class C1 {\n"); @@ -352,7 +352,7 @@ public void testInnerClassVisibility() throws Exception { IPackageFragment pack2= sourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test2.A.A1;\n"); @@ -413,7 +413,7 @@ public void testClearImports() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class C {\n"); @@ -427,7 +427,7 @@ public void testClearImports() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -440,7 +440,7 @@ public void testNewImports() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C extends Vector {\n"); buf.append("}\n"); @@ -453,7 +453,7 @@ public void testNewImports() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -468,7 +468,7 @@ public void testReplaceImports() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -484,7 +484,7 @@ public void testReplaceImports() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -499,7 +499,7 @@ public void testClearImportsNoPackage() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.getPackageFragment(""); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("import java.util.Vector;\n"); buf.append("public class C {\n"); buf.append("}\n"); @@ -512,7 +512,7 @@ public void testClearImportsNoPackage() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public class C {\n"); buf.append("}\n"); assertEqualString(cu.getSource(), buf.toString()); @@ -523,7 +523,7 @@ public void testNewImportsNoPackage() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.getPackageFragment(""); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("public class C extends Vector {\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); @@ -535,7 +535,7 @@ public void testNewImportsNoPackage() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("import java.util.Vector;\n"); buf.append("\n"); buf.append("public class C extends Vector {\n"); @@ -548,7 +548,7 @@ public void testReplaceImportsNoPackage() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.getPackageFragment(""); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("import java.util.Set;\n"); buf.append("\n"); buf.append("public class C extends Vector {\n"); @@ -562,7 +562,7 @@ public void testReplaceImportsNoPackage() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("import java.util.Vector;\n"); buf.append("\n"); buf.append("public class C extends Vector {\n"); @@ -575,7 +575,7 @@ public void testCommentAfterImport() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\r\n"); buf.append("\r\n"); buf.append("import x;\r\n"); @@ -593,7 +593,7 @@ public void testCommentAfterImport() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\r\n"); buf.append("\r\n"); buf.append("import java.util.Vector; // comment\r\n"); @@ -609,7 +609,7 @@ public void testImportToStar() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); @@ -617,7 +617,7 @@ public void testImportToStar() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -642,7 +642,7 @@ public void testImportToStar() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 2, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -664,7 +664,7 @@ public void testImportToStarWithComments() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); @@ -672,7 +672,7 @@ public void testImportToStarWithComments() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("// comment 1\n"); @@ -698,7 +698,7 @@ public void testImportToStarWithComments() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 2, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("// comment 1\n"); @@ -729,19 +729,19 @@ public void testImportToStarWithExplicit() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); pack2.createCompilationUnit("List.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List2 {\n"); buf.append("}\n"); pack2.createCompilationUnit("List2.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List3 {\n"); buf.append("}\n"); @@ -749,7 +749,7 @@ public void testImportToStarWithExplicit() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -780,7 +780,7 @@ public void testImportToStarWithExplicit() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 2, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -805,14 +805,14 @@ public void testImportToStarWithExplicit2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); pack2.createCompilationUnit("List.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -837,7 +837,7 @@ public void testImportToStarWithExplicit2() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 1, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -859,20 +859,20 @@ public void testImportToStarWithExplicit3() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); pack2.createCompilationUnit("List.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class Set {\n"); buf.append("}\n"); pack2.createCompilationUnit("Set.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -897,7 +897,7 @@ public void testImportToStarWithExplicit3() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 1, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -920,21 +920,21 @@ public void testImportToStarWithExplicit4() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); pack2.createCompilationUnit("List.java", buf.toString(), false, null); IPackageFragment pack3= sourceFolder.createPackageFragment("pack3", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack3;\n"); buf.append("public class List {\n"); buf.append("}\n"); pack3.createCompilationUnit("List.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -959,7 +959,7 @@ public void testImportToStarWithExplicit4() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 1, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -989,13 +989,13 @@ public void testImportToStarWithExplicit5() throws Exception { IPackageFragmentRoot sourceFolder2= JavaProjectHelper.addSourceContainer(project2, "src"); IPackageFragment pack22= sourceFolder2.createPackageFragment("packx", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class Vector {\n"); buf.append("}\n"); pack22.createCompilationUnit("List.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class Set {\n"); buf.append("}\n"); @@ -1004,14 +1004,14 @@ public void testImportToStarWithExplicit5() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class List {\n"); buf.append("}\n"); pack2.createCompilationUnit("List.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -1036,7 +1036,7 @@ public void testImportToStarWithExplicit5() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 1, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -1062,14 +1062,14 @@ public void testImportFromDefault() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("public class List1 {\n"); buf.append("}\n"); pack2.createCompilationUnit("List1.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -1092,7 +1092,7 @@ public void testImportFromDefault() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 2, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); // no imports from default in compatibility >= 1.4 @@ -1112,19 +1112,19 @@ public void testImportFromDefaultWithStar() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("public class List1 {\n"); buf.append("}\n"); pack2.createCompilationUnit("List1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public class List2 {\n"); buf.append("}\n"); pack2.createCompilationUnit("List2.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); // no imports from default in compatibility >= 1.4 @@ -1148,7 +1148,7 @@ public void testImportFromDefaultWithStar() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 2, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -1170,7 +1170,7 @@ public void testImportOfMemberFromLocal() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1192,7 +1192,7 @@ public void testImportOfMemberFromLocal() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -1215,14 +1215,14 @@ public void testGroups1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public class List1 {\n"); buf.append("}\n"); pack2.createCompilationUnit("List1.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1241,7 +1241,7 @@ public void testGroups1() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.File;\n"); @@ -1267,14 +1267,14 @@ public void testBaseGroups1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public class List1 {\n"); buf.append("}\n"); pack2.createCompilationUnit("List1.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -1293,7 +1293,7 @@ public void testBaseGroups1() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -1319,7 +1319,7 @@ public void testVisibility_bug26746() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public interface MyInterface {\n"); buf.append(" public interface MyInnerInterface {\n"); @@ -1327,7 +1327,7 @@ public void testVisibility_bug26746() throws Exception { buf.append("}\n"); pack2.createCompilationUnit("MyInterface.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import pack0.MyInterface.MyInnerInterface;\n"); @@ -1345,7 +1345,7 @@ public void testVisibility_bug26746() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("public class MyClass implements MyInterface {\n"); @@ -1361,7 +1361,7 @@ public void testVisibility_bug37299a() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class ClusterSingletonStepped {\n"); buf.append(" public interface SingletonStep {\n"); @@ -1370,7 +1370,7 @@ public void testVisibility_bug37299a() throws Exception { pack1.createCompilationUnit("ClusterSingletonStepped.java", buf.toString(), false, null); IPackageFragment pack2= sourceFolder.createPackageFragment("pack0", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import pack1.ClusterSingletonStepped;\n"); @@ -1388,7 +1388,7 @@ public void testVisibility_bug37299a() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import pack1.ClusterSingletonStepped;\n"); @@ -1405,7 +1405,7 @@ public void testVisibility_bug37299b() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class ClusterSingletonStepped {\n"); buf.append(" public interface SingletonStep {\n"); @@ -1414,7 +1414,7 @@ public void testVisibility_bug37299b() throws Exception { pack1.createCompilationUnit("ClusterSingletonStepped.java", buf.toString(), false, null); IPackageFragment pack2= sourceFolder.createPackageFragment("pack0", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import pack1.ClusterSingletonStepped;\n"); @@ -1432,7 +1432,7 @@ public void testVisibility_bug37299b() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import pack1.ClusterSingletonStepped;\n"); @@ -1448,7 +1448,7 @@ public void testVisibility_bug56704() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack2= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public class A {\n"); buf.append(" public class AX {\n"); @@ -1456,7 +1456,7 @@ public void testVisibility_bug56704() throws Exception { buf.append("}\n"); pack2.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import pack0.A.AX;\n"); @@ -1473,7 +1473,7 @@ public void testVisibility_bug56704() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("public class B extends A {\n"); @@ -1488,7 +1488,7 @@ public void testVisibility_bug67644() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class A {\n"); buf.append(" public class AX {\n"); @@ -1498,7 +1498,7 @@ public void testVisibility_bug67644() throws Exception { IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack1.A;\n"); @@ -1517,7 +1517,7 @@ public void testVisibility_bug67644() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack1.A;\n"); @@ -1535,7 +1535,7 @@ public void testVisibility_bug85831() throws Exception { IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("class A {\n"); @@ -1555,7 +1555,7 @@ public void testVisibility_bug85831() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("class A {\n"); @@ -1575,7 +1575,7 @@ public void testVisibility_bug79174() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public interface A {\n"); buf.append(" public interface AX {\n"); @@ -1585,7 +1585,7 @@ public void testVisibility_bug79174() throws Exception { IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack1.A;\n"); @@ -1603,7 +1603,7 @@ public void testVisibility_bug79174() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack1.A;\n"); @@ -1621,7 +1621,7 @@ public void testVisibility_bug131305() throws Exception { IPackageFragment packUtil= sourceFolder.createPackageFragment("util", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package util;\n"); buf.append("\n"); buf.append("public interface Map \n"); @@ -1630,7 +1630,7 @@ public void testVisibility_bug131305() throws Exception { buf.append("}\n"); packUtil.createCompilationUnit("Map.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package util;\n"); buf.append("\n"); buf.append("public interface HashMap implements Map {\n"); @@ -1640,7 +1640,7 @@ public void testVisibility_bug131305() throws Exception { packUtil.createCompilationUnit("HashMap.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import util.HashMap;\n"); @@ -1668,7 +1668,7 @@ public void testVisibility_bug159638() throws Exception { IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public abstract class Parent {\n"); buf.append(" public static class Inner {\n"); @@ -1681,7 +1681,7 @@ public void testVisibility_bug159638() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.Parent;\n"); @@ -1737,7 +1737,7 @@ public void test5() throws Exception { body.append("}\n"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append(body.toString()); @@ -1748,7 +1748,7 @@ public void test5() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;\n"); @@ -1809,7 +1809,7 @@ public void test_bug25773() throws Exception { body.append("}\n"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append(body.toString()); @@ -1820,7 +1820,7 @@ public void test_bug25773() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, threshold, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -1877,7 +1877,7 @@ public void test_bug25113() throws Exception { body.append("}\n"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append(body.toString()); @@ -1888,7 +1888,7 @@ public void test_bug25113() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, threshold, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import com.misc.Class5;\n"); @@ -1909,7 +1909,7 @@ public void testStaticImports1() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.lang.System.out;\n"); @@ -1928,7 +1928,7 @@ public void testStaticImports1() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.File;\n"); @@ -1949,7 +1949,7 @@ public void testStaticImports2() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.io.File.*;\n"); @@ -1968,7 +1968,7 @@ public void testStaticImports2() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.io.File.pathSeparator;\n"); @@ -1989,7 +1989,7 @@ public void testStaticImports_bug78585() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public class Test1 {\n"); buf.append(" public static final void assertNotEquals(final String msg, final T expected, final T toCheck) {\n"); @@ -1998,7 +1998,7 @@ public void testStaticImports_bug78585() throws Exception { pack0.createCompilationUnit("Test1.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.Test1;\n"); @@ -2018,7 +2018,7 @@ public void testStaticImports_bug78585() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.Test1;\n"); // no static import for 'assertNotEquals' @@ -2036,7 +2036,7 @@ public void testStaticImports_bug90556() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public class BasePanel {\n"); buf.append(" public static void add2panel(String... s) {\n"); @@ -2044,7 +2044,7 @@ public void testStaticImports_bug90556() throws Exception { buf.append("}\n"); pack0.createCompilationUnit("Test1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("public class ManufacturerMainPanel extends BasePanel{\n"); @@ -2061,7 +2061,7 @@ public void testStaticImports_bug90556() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("public class ManufacturerMainPanel extends BasePanel{\n"); @@ -2077,7 +2077,7 @@ public void testStaticImports_bug113770() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public abstract class Test\n"); @@ -2097,7 +2097,7 @@ public void testStaticImports_bug113770() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); @@ -2118,7 +2118,7 @@ public void testStaticImports_bug81589() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public enum E {\n"); buf.append(" A, B, C;\n"); @@ -2126,7 +2126,7 @@ public void testStaticImports_bug81589() throws Exception { pack0.createCompilationUnit("E.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.E;\n"); @@ -2148,7 +2148,7 @@ public void testStaticImports_bug81589() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.E;\n"); // no import for E.A @@ -2168,7 +2168,7 @@ public void testStaticImports_bug159424() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2180,7 +2180,7 @@ public void testStaticImports_bug159424() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2243,7 +2243,7 @@ public void testStaticImports_bug181895() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import static java.lang.Math.max;\n"); @@ -2264,7 +2264,7 @@ public void testStaticImports_bug181895() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class Test {\n"); @@ -2282,7 +2282,7 @@ public void testStaticImports_bug187004a() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("b", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package b;\n"); buf.append("\n"); buf.append("abstract public class Parent {\n"); @@ -2291,7 +2291,7 @@ public void testStaticImports_bug187004a() throws Exception { pack0.createCompilationUnit("Parent.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("a", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("import b.Parent;\n"); @@ -2309,7 +2309,7 @@ public void testStaticImports_bug187004a() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("import b.Parent;\n"); // no static import for CONSTANT @@ -2327,7 +2327,7 @@ public void testStaticImports_bug187004b() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("b", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package b;\n"); buf.append("\n"); buf.append("abstract public class Parent {\n"); @@ -2336,7 +2336,7 @@ public void testStaticImports_bug187004b() throws Exception { pack0.createCompilationUnit("Parent.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("a", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("import b.Parent;\n"); @@ -2354,7 +2354,7 @@ public void testStaticImports_bug187004b() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("import b.Parent;\n"); // no static import for CONSTANT() @@ -2372,7 +2372,7 @@ public void testStaticImports_bug230067() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("a", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("class Test {\n"); @@ -2392,7 +2392,7 @@ public void testStaticImports_bug230067() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); // no static import for 'TEST' buf.append("class Test {\n"); @@ -2414,7 +2414,7 @@ public void testStaticImports_bug562641() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -2430,7 +2430,7 @@ public void testStaticImports_bug562641() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import static java.lang.Math.max;\n"); @@ -2449,7 +2449,7 @@ public void testImportCountAddNew() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -2467,7 +2467,7 @@ public void testImportCountAddNew() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2491,7 +2491,7 @@ public void testImportCountAddandRemove() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -2511,7 +2511,7 @@ public void testImportCountAddandRemove() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2535,7 +2535,7 @@ public void testImportCountAddandRemoveWithComments() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("/**comment1*/\n"); buf.append("/*lead1*/import java.util.*;// trail 1\n"); @@ -2555,7 +2555,7 @@ public void testImportCountAddandRemoveWithComments() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("/**comment1*/\n"); buf.append("/*lead1*/\n"); @@ -2581,7 +2581,7 @@ public void testImportCountKeepOne() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.HashMap;\n"); @@ -2600,7 +2600,7 @@ public void testImportCountKeepOne() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2624,7 +2624,7 @@ public void testImportCountKeepStar() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -2645,7 +2645,7 @@ public void testImportCountKeepStar() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 2, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.net.Socket;\n"); @@ -2671,7 +2671,7 @@ public void testImportCountAddTwoRemoveOne() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.BitSet;\n"); @@ -2691,7 +2691,7 @@ public void testImportCountAddTwoRemoveOne() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2715,7 +2715,7 @@ public void testImportCountReplaceStar() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.BitSet;\n"); @@ -2737,7 +2737,7 @@ public void testImportCountReplaceStar() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2761,7 +2761,7 @@ public void testImportCountRemoveStatic() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.BitSet;\n"); @@ -2785,7 +2785,7 @@ public void testImportCountRemoveStatic() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2809,7 +2809,7 @@ public void testImportCountKeepStatic() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.BitSet;\n"); @@ -2834,7 +2834,7 @@ public void testImportCountKeepStatic() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -2860,7 +2860,7 @@ public void test_bug78397() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class A {\n"); @@ -2874,7 +2874,7 @@ public void test_bug78397() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class A {\n"); @@ -2888,7 +2888,7 @@ public void test_bug78533() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public class A {\n"); buf.append(" public void method1() { }\n"); @@ -2901,7 +2901,7 @@ public void test_bug78533() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("\n"); buf.append("import java.util.Collection;\n"); @@ -2917,7 +2917,7 @@ public void test_bug78716() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public enum MyEnum {\n"); buf.append(" A, B, C\n"); @@ -2925,7 +2925,7 @@ public void test_bug78716() throws Exception { pack0.createCompilationUnit("MyEnum.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.MyEnum;\n"); @@ -2942,7 +2942,7 @@ public void test_bug78716() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.MyEnum;\n"); @@ -2960,7 +2960,7 @@ public void test_bug135122() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class Foo extends Bar {\n"); @@ -2983,7 +2983,7 @@ public void test_bug135122() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class Foo extends Bar {\n"); @@ -3006,13 +3006,13 @@ public void test_PackageInfoBug157541a() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@Foo\n"); buf.append("package pack1;"); ICompilationUnit cu= pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("public @interface Foo {\n"); buf.append("}\n"); @@ -3024,7 +3024,7 @@ public void test_PackageInfoBug157541a() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@Foo\n"); buf.append("package pack1;\n"); buf.append("\n"); @@ -3037,7 +3037,7 @@ public void test_PackageInfoBug157541b() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@Foo @Bar\n"); buf.append("package pack1;\n"); buf.append("\n"); @@ -3046,13 +3046,13 @@ public void test_PackageInfoBug157541b() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("public @interface Foo {\n"); buf.append("}\n"); pack2.createCompilationUnit("Foo.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("public @interface Bar {\n"); buf.append("}\n"); @@ -3064,7 +3064,7 @@ public void test_PackageInfoBug157541b() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@Foo @Bar\n"); buf.append("package pack1;\n"); buf.append("\n"); @@ -3079,7 +3079,7 @@ public void test_PackageInfoBug216432() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("/**\n"); buf.append(" * @see Bar\n"); buf.append(" */\n"); @@ -3088,13 +3088,13 @@ public void test_PackageInfoBug216432() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); IPackageFragment pack2= sourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("public @interface Foo {\n"); buf.append("}\n"); pack2.createCompilationUnit("Foo.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("public @interface Bar {\n"); buf.append("}\n"); @@ -3106,7 +3106,7 @@ public void test_PackageInfoBug216432() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/**\n"); buf.append(" * @see Bar\n"); buf.append(" */\n"); @@ -3123,7 +3123,7 @@ public void testTypeArgumentImports() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class B {\n"); @@ -3151,7 +3151,7 @@ public void testTypeArgumentImports() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.File;\n"); @@ -3185,20 +3185,20 @@ public void testAnnotationImports1() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public @interface MyAnnot1 {\n"); buf.append("}\n"); pack0.createCompilationUnit("MyAnnot1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public @interface MyAnnot2 {\n"); buf.append(" int value();\n"); buf.append("}\n"); pack0.createCompilationUnit("MyAnnot2.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public @interface MyAnnot3 {\n"); buf.append("}\n"); @@ -3206,7 +3206,7 @@ public void testAnnotationImports1() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("@MyAnnot3 public class Test2 {\n"); @@ -3222,7 +3222,7 @@ public void testAnnotationImports1() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.MyAnnot1;\n"); @@ -3242,13 +3242,13 @@ public void testAnnotationImports2() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public @interface MyAnnot1 {\n"); buf.append("}\n"); pack0.createCompilationUnit("MyAnnot1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("public @interface MyAnnot2 {\n"); buf.append(" char value();\n"); @@ -3257,7 +3257,7 @@ public void testAnnotationImports2() throws Exception { IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("@MyAnnot1()\n"); @@ -3272,7 +3272,7 @@ public void testAnnotationImports2() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.io.File;\n"); @@ -3291,7 +3291,7 @@ public void testJavadocImports_bug319860() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import p.Main.I;\n"); @@ -3313,7 +3313,7 @@ public void testJavadocImports_bug319860() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("/**\n"); @@ -3517,7 +3517,7 @@ public void testDealWithBrokenStaticImport() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack1= sourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import static Broken;\n"); @@ -3534,7 +3534,7 @@ public void testDealWithBrokenStaticImport() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class C{\n"); @@ -3557,7 +3557,7 @@ public void testBug508660() throws Exception { pack1.createCompilationUnit("ISomeInterface.java", buf1.toString(), false, null); IPackageFragment pack2= sourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf2= new StringBuffer(); + StringBuilder buf2= new StringBuilder(); buf2.append("package test2;\n"); buf2.append("public class Test {\n"); buf2.append(" private FirstInnerClass first;\n"); @@ -3571,7 +3571,7 @@ public void testBug508660() throws Exception { OrganizeImportsOperation op= createOperation(cu2, order, 99, false, true, true, query); op.run(null); - buf2= new StringBuffer(); + buf2= new StringBuilder(); buf2.append("package test2;\n"); buf2.append("\n"); buf2.append("import test1.ISomeInterface.FirstInnerClass;\n"); @@ -3592,7 +3592,7 @@ public void testBug530193() throws Exception { new IClasspathAttribute[] { JavaCore.newClasspathAttribute(IClasspathAttribute.TEST, "true") }); IPackageFragment pack1= sourceFolder.createPackageFragment("pp", false, null); - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); buf1.append("package pp;\n"); buf1.append("public class C1 {\n"); buf1.append(" Tests at=new Tests();\n"); @@ -3612,7 +3612,7 @@ public void testBug530193() throws Exception { OrganizeImportsOperation op= createOperation(cu1, order, 99, false, true, true, query); op.run(null); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package pp;\n"); buf1.append("public class C1 {\n"); buf1.append(" Tests at=new Tests();\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest1d8.java index 5e2dd30fa1d..658555b0a08 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest1d8.java @@ -64,7 +64,7 @@ public void typeUseAnnotationImport1() throws Exception { // PrimitiveType IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("@Target(ElementType.TYPE_USE)\n"); buf.append("public @interface TypeUse {\n"); @@ -72,7 +72,7 @@ public void typeUseAnnotationImport1() throws Exception { // PrimitiveType pack0.createCompilationUnit("TypeUse.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class C{\n"); buf.append(" @TypeUse int i;\n"); @@ -85,7 +85,7 @@ public void typeUseAnnotationImport1() throws Exception { // PrimitiveType OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.TypeUse;\n"); @@ -101,7 +101,7 @@ public void typeUseAnnotationImport2() throws Exception { // SimpleType IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("@Target(ElementType.TYPE_USE)\n"); buf.append("public @interface TypeUse {\n"); @@ -109,7 +109,7 @@ public void typeUseAnnotationImport2() throws Exception { // SimpleType pack0.createCompilationUnit("TypeUse.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class C{\n"); buf.append(" ArrayList<@TypeUse String> list1;\n"); @@ -122,7 +122,7 @@ public void typeUseAnnotationImport2() throws Exception { // SimpleType OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -139,7 +139,7 @@ public void typeUseAnnotationImport3() throws Exception { // QualifiedType IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("@Target(ElementType.TYPE_USE)\n"); buf.append("public @interface TypeUse {\n"); @@ -147,7 +147,7 @@ public void typeUseAnnotationImport3() throws Exception { // QualifiedType pack0.createCompilationUnit("TypeUse.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class C{\n"); buf.append(" ArrayList<@TypeUse A.B> list2;\n"); @@ -166,7 +166,7 @@ public void typeUseAnnotationImport3() throws Exception { // QualifiedType OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -189,7 +189,7 @@ public void typeUseAnnotationImport4() throws Exception { // PackageQualifiedTyp IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("@Target(ElementType.TYPE_USE)\n"); buf.append("public @interface TypeUse {\n"); @@ -197,7 +197,7 @@ public void typeUseAnnotationImport4() throws Exception { // PackageQualifiedTyp pack0.createCompilationUnit("TypeUse.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class C{\n"); buf.append(" ArrayList list;\n"); @@ -210,7 +210,7 @@ public void typeUseAnnotationImport4() throws Exception { // PackageQualifiedTyp OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -227,7 +227,7 @@ public void typeUseAnnotationImport5() throws Exception { // WildcardType IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("@Target(ElementType.TYPE_USE)\n"); buf.append("public @interface TypeUse {\n"); @@ -235,7 +235,7 @@ public void typeUseAnnotationImport5() throws Exception { // WildcardType pack0.createCompilationUnit("TypeUse.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class C{\n"); buf.append(" ArrayList<@TypeUse ?> list3;\n"); @@ -248,7 +248,7 @@ public void typeUseAnnotationImport5() throws Exception { // WildcardType OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -265,7 +265,7 @@ public void typeUseAnnotationImport6() throws Exception { // ArrayType IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("pack0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack0;\n"); buf.append("@Target(ElementType.TYPE_USE)\n"); buf.append("public @interface TypeUse {\n"); @@ -273,7 +273,7 @@ public void typeUseAnnotationImport6() throws Exception { // ArrayType pack0.createCompilationUnit("TypeUse.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("pack1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("public class C{\n"); buf.append(" int[] arr = new int @TypeUse [5];\n"); @@ -286,7 +286,7 @@ public void typeUseAnnotationImport6() throws Exception { // ArrayType OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("import pack0.TypeUse;\n"); @@ -302,7 +302,7 @@ public void staticMethodReferenceImports_bug424172() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.function.IntPredicate;\n"); @@ -322,7 +322,7 @@ public void staticMethodReferenceImports_bug424172() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.function.IntPredicate;\n"); @@ -342,7 +342,7 @@ public void methodReferenceImports_bug424227() throws Exception { IPackageFragmentRoot sourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); IPackageFragment pack0= sourceFolder.createPackageFragment("p0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p0;\n"); buf.append("@FunctionalInterface\n"); buf.append("public interface FI {\n"); @@ -350,7 +350,7 @@ public void methodReferenceImports_bug424227() throws Exception { buf.append("}\n"); pack0.createCompilationUnit("FI.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p0;\n"); buf.append("public class X {\n"); buf.append(" public static FI staticMethodX() {\n"); @@ -360,7 +360,7 @@ public void methodReferenceImports_bug424227() throws Exception { pack0.createCompilationUnit("X.java", buf.toString(), false, null); IPackageFragment pack1= sourceFolder.createPackageFragment("p1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p1;\n"); buf.append("\n"); buf.append("public class C1 {\n"); @@ -374,7 +374,7 @@ public void methodReferenceImports_bug424227() throws Exception { OrganizeImportsOperation op= createOperation(cu, order, 99, false, true, true, query); op.run(null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p1;\n"); buf.append("\n"); buf.append("import p0.FI;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java index 7c4952b32a5..c9247b6f027 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/PartialASTTest.java @@ -89,7 +89,7 @@ public void tearDown() throws Exception { @Test public void testPartialCU1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -111,7 +111,7 @@ public void testPartialCU1() throws Exception { CompilationUnit astRoot= getPartialCompilationUnit(cu, offset); String string= ASTNodes.asFormattedString(astRoot, 0, String.valueOf('\n'), null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -175,7 +175,7 @@ private void assertAllBindings(CompilationUnit astRoot) { @Test public void testPartialCU2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -211,7 +211,7 @@ public void testPartialCU2() throws Exception { CompilationUnit astRoot= getPartialCompilationUnit(cu, offset); String string= ASTNodes.asFormattedString(astRoot, 0, String.valueOf('\n'), null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -240,7 +240,7 @@ public void testPartialCU2() throws Exception { @Test public void testPartialCU3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.Serializable;\n"); @@ -277,7 +277,7 @@ public void testPartialCU3() throws Exception { CompilationUnit astRoot= getPartialCompilationUnit(cu, offset); String string= ASTNodes.asFormattedString(astRoot, 0, String.valueOf('\n'), null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.Serializable;\n"); @@ -309,7 +309,7 @@ public void testPartialCU3() throws Exception { @Test public void testPartialCU4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.IOException;\n"); @@ -347,7 +347,7 @@ public void testPartialCU4() throws Exception { CompilationUnit astRoot= getPartialCompilationUnit(cu, offset); String string= ASTNodes.asFormattedString(astRoot, 0, String.valueOf('\n'), null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.IOException;\n"); @@ -374,7 +374,7 @@ public void testPartialCU4() throws Exception { @Test public void testPartialCUPositionNotInMethod1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.IOException;\n"); @@ -412,7 +412,7 @@ public void testPartialCUPositionNotInMethod1() throws Exception { CompilationUnit astRoot= getPartialCompilationUnit(cu, offset); String string= ASTNodes.asFormattedString(astRoot, 0, String.valueOf('\n'), null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.IOException;\n"); @@ -438,7 +438,7 @@ public void testPartialCUPositionNotInMethod1() throws Exception { @Test public void testPartialCUPositionNotInMethod2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.IOException;\n"); @@ -477,7 +477,7 @@ public void testPartialCUPositionNotInMethod2() throws Exception { CompilationUnit astRoot= getPartialCompilationUnit(cu, offset); String string= ASTNodes.asFormattedString(astRoot, 0, String.valueOf('\n'), null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("import java.io.IOException;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java index 742dcbfd06d..b269bdfa267 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ScopeAnalyzerTest.java @@ -258,7 +258,7 @@ public void testVariableDeclarations3() throws Exception { @Test public void testVariableDeclarations4() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public class Rectangle {\n"); @@ -268,7 +268,7 @@ public void testVariableDeclarations4() throws Exception { pack0.createCompilationUnit("Rectangle.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1.ae", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1.ae;\n"); buf.append("import pack1.Rectangle;\n"); buf.append("public class E {\n"); @@ -299,7 +299,7 @@ public void testVariableDeclarations4() throws Exception { public void testVariableDeclarations5() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack1;\n"); buf.append("\n"); buf.append("public interface IConstants {\n"); @@ -308,7 +308,7 @@ public void testVariableDeclarations5() throws Exception { pack0.createCompilationUnit("IConstants.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1.ae", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1.ae;\n"); buf.append("public class E {\n"); buf.append(" private int fVar1, fVar2;\n"); @@ -697,7 +697,7 @@ public void testTypeDeclarations2() throws Exception { public void testTypeDeclarationsTypeParameters() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("test0.ae", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1.ae;\n"); buf.append("public class H {\n"); buf.append("}\n"); @@ -705,7 +705,7 @@ public void testTypeDeclarationsTypeParameters() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1.ae", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1.ae;\n"); buf.append("import test0.ae.H;\n"); buf.append("public class G extends H {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java index 4beb41319ea..2ff02d8d65b 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedConstructorsTest.java @@ -1116,7 +1116,7 @@ public void testInsertAt() throws Exception { IPackageFragmentRoot root= JavaProjectHelper.addSourceContainer(fJavaProject, "src"); fPackage= root.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class B {\n"); @@ -1126,7 +1126,7 @@ public void testInsertAt() throws Exception { fPackage.createCompilationUnit("B.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class A extends B {\n"); @@ -1152,7 +1152,7 @@ public void testInsertAt() throws Exception { final int NUM_MEMBERS= 6; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public A(int x) {\n"); buf.append(" super(x);\n"); buf.append(" // TODO\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java index 680135f9288..811d28715e7 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/AddUnimplementedMethodsTest.java @@ -210,7 +210,7 @@ public void test4() throws Exception { @Test public void bug119171() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package ibm.util;\n"); buf.append("import java.util.Properties;\n"); buf.append("public interface F {\n"); @@ -218,14 +218,14 @@ public void bug119171() throws Exception { buf.append("}\n"); fPackage.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package ibm.util;\n"); buf.append("public class Properties {\n"); buf.append(" public int get() {return 0;}\n"); buf.append("}\n"); fPackage.createCompilationUnit("Properties.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public class Test5 implements F {\n"); buf.append(" public void foo() {\n"); buf.append(" Properties p= new Properties();\n"); @@ -246,7 +246,7 @@ public void bug119171() throws Exception { @Test public void bug297183() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package ibm.util;\n"); buf.append("interface Shape {\r\n"); buf.append(" int getX();\r\n"); @@ -256,7 +256,7 @@ public void bug297183() throws Exception { buf.append("}\r\n"); fPackage.createCompilationUnit("Shape.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package ibm.util;\n"); buf.append("interface Circle extends Shape {\r\n"); buf.append(" int getR();\r\n"); @@ -264,7 +264,7 @@ public void bug297183() throws Exception { buf.append("\r\n"); fPackage.createCompilationUnit("Circle.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package ibm.util;\n"); buf.append("public class DefaultCircle implements Circle {\n"); buf.append("}\n"); @@ -288,7 +288,7 @@ public void insertAt() throws Exception { IPackageFragmentRoot root= JavaProjectHelper.addSourceContainer(fJavaProject, "src"); fPackage= root.createPackageFragment("p", true, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public abstract class B {\n"); @@ -298,7 +298,7 @@ public void insertAt() throws Exception { fPackage.createCompilationUnit("B.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class A extends B {\n"); @@ -323,7 +323,7 @@ public void insertAt() throws Exception { final int NUM_MEMBERS= 6; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public void foo() {\n"); buf.append(" // TODO\n"); buf.append(" }"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java index b47cd32a93c..88f74a6e9e3 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateConstructorUsingFieldsTest.java @@ -710,7 +710,7 @@ public void test15() throws Exception { @Test public void insertAt1() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -735,7 +735,7 @@ public void insertAt1() throws Exception { final int NUM_MEMBERS= 6; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public A(int x) {\n"); buf.append(" this.x = x;\n"); buf.append(" }"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java index 121e4f95069..c1f4fd411c6 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/source/GenerateDelegateMethodsTest.java @@ -816,7 +816,7 @@ public void test12() throws Exception { @Test public void insertAt() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -841,7 +841,7 @@ public void insertAt() throws Exception { final int NUM_MEMBERS= 6; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public void run() {\n"); buf.append(" x.run();\n"); buf.append(" }"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest.java index 60901a5fe8d..a2a72870f49 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest.java @@ -96,7 +96,7 @@ public void tearDown() throws Exception { @Test public void testSplitIfCondition1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b) {\n"); @@ -113,7 +113,7 @@ public void testSplitIfCondition1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b) {\n"); @@ -133,7 +133,7 @@ public void testSplitIfCondition1() throws Exception { @Test public void testSplitIfCondition2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -150,7 +150,7 @@ public void testSplitIfCondition2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -170,7 +170,7 @@ public void testSplitIfCondition2() throws Exception { @Test public void testSplitIfCondition3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -187,7 +187,7 @@ public void testSplitIfCondition3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -307,7 +307,7 @@ public void testSplitIfElseCondition() throws Exception { @Test public void testJoinAndIfStatements1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -326,7 +326,7 @@ public void testJoinAndIfStatements1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -344,7 +344,7 @@ public void testJoinAndIfStatements1() throws Exception { @Test public void testJoinAndIfStatements2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -362,7 +362,7 @@ public void testJoinAndIfStatements2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -380,7 +380,7 @@ public void testJoinAndIfStatements2() throws Exception { @Test public void testJoinAndIfStatements3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -399,7 +399,7 @@ public void testJoinAndIfStatements3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -417,7 +417,7 @@ public void testJoinAndIfStatements3() throws Exception { @Test public void testJoinAndIfStatements4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -435,7 +435,7 @@ public void testJoinAndIfStatements4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -453,7 +453,7 @@ public void testJoinAndIfStatements4() throws Exception { @Test public void testJoinAndIfStatementsBug335173() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a, int x) {\n"); @@ -471,7 +471,7 @@ public void testJoinAndIfStatementsBug335173() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a, int x) {\n"); @@ -488,7 +488,7 @@ public void testJoinAndIfStatementsBug335173() throws Exception { @Test public void testJoinOrIfStatements1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -514,7 +514,7 @@ public void testJoinOrIfStatements1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -532,7 +532,7 @@ public void testJoinOrIfStatements1() throws Exception { @Test public void testJoinOrIfStatementsBug335173() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a, int x) {\n"); @@ -558,7 +558,7 @@ public void testJoinOrIfStatementsBug335173() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a, int x) {\n"); @@ -576,7 +576,7 @@ public void testJoinOrIfStatementsBug335173() throws Exception { @Test public void testSplitOrCondition1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -593,7 +593,7 @@ public void testSplitOrCondition1() throws Exception { List proposals= collectAssists(context, false); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -612,7 +612,7 @@ public void testSplitOrCondition1() throws Exception { @Test public void testSplitOrCondition2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -632,7 +632,7 @@ public void testSplitOrCondition2() throws Exception { List proposals= collectAssists(context, false); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, boolean c) {\n"); @@ -654,7 +654,7 @@ public void testSplitOrCondition2() throws Exception { @Test public void testIfReturnIntoIfElseAtEndOfVoidMethod1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b) {\n"); @@ -673,7 +673,7 @@ public void testIfReturnIntoIfElseAtEndOfVoidMethod1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b) {\n"); @@ -693,7 +693,7 @@ public void testIfReturnIntoIfElseAtEndOfVoidMethod1() throws Exception { @Test public void testInverseIfContinueIntoIfThenInLoops1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -713,7 +713,7 @@ public void testInverseIfContinueIntoIfThenInLoops1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -734,7 +734,7 @@ public void testInverseIfContinueIntoIfThenInLoops1() throws Exception { @Test public void testInverseIfIntoContinueInLoops1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -754,7 +754,7 @@ public void testInverseIfIntoContinueInLoops1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -775,7 +775,7 @@ public void testInverseIfIntoContinueInLoops1() throws Exception { @Test public void testRemoveExtraParentheses1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, Object o) {\n"); @@ -793,7 +793,7 @@ public void testRemoveExtraParentheses1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, Object o) {\n"); @@ -811,7 +811,7 @@ public void testRemoveExtraParentheses1() throws Exception { @Test public void testRemoveExtraParentheses2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -826,7 +826,7 @@ public void testRemoveExtraParentheses2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -841,7 +841,7 @@ public void testRemoveExtraParentheses2() throws Exception { @Test public void testAddParanoidalParentheses1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, int c, Object o) {\n"); @@ -859,7 +859,7 @@ public void testAddParanoidalParentheses1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b, int c, Object o) {\n"); @@ -877,7 +877,7 @@ public void testAddParanoidalParentheses1() throws Exception { @Test public void testAddParenthesesForExpression1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object obj) {\n"); @@ -893,7 +893,7 @@ public void testAddParenthesesForExpression1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object obj) {\n"); @@ -911,7 +911,7 @@ public void testAddParenthesesForExpression1() throws Exception { @Test public void testAddParenthesesForExpression2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object obj) {\n"); @@ -926,7 +926,7 @@ public void testAddParenthesesForExpression2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object obj) {\n"); @@ -943,7 +943,7 @@ public void testAddParenthesesForExpression2() throws Exception { @Test public void testAddParenthesesForExpression3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -959,7 +959,7 @@ public void testAddParenthesesForExpression3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -977,7 +977,7 @@ public void testAddParenthesesForExpression3() throws Exception { @Test public void testAddParenthesesForExpression4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -993,7 +993,7 @@ public void testAddParenthesesForExpression4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -1011,7 +1011,7 @@ public void testAddParenthesesForExpression4() throws Exception { @Test public void testAddParenthesesForExpression5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -1025,7 +1025,7 @@ public void testAddParenthesesForExpression5() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -1041,7 +1041,7 @@ public void testAddParenthesesForExpression5() throws Exception { @Test public void testAddParenthesesForExpression6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -1058,7 +1058,7 @@ public void testAddParenthesesForExpression6() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 7); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b, int c) {\n"); @@ -1120,7 +1120,7 @@ public void testAddParenthesesForExpression8() throws Exception { @Test public void testInverseIfCondition1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b) {\n"); @@ -1138,7 +1138,7 @@ public void testInverseIfCondition1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, int b) {\n"); @@ -1157,7 +1157,7 @@ public void testInverseIfCondition1() throws Exception { @Test public void testInverseIfCondition2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b, boolean c) {\n"); @@ -1175,7 +1175,7 @@ public void testInverseIfCondition2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b, boolean c) {\n"); @@ -1195,7 +1195,7 @@ public void testInverseIfCondition2() throws Exception { public void testInverseIfCondition3() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=75109 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1215,7 +1215,7 @@ public void testInverseIfCondition3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1237,7 +1237,7 @@ public void testInverseIfCondition3() throws Exception { public void testInverseIfCondition4() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=74580 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b, boolean c) {\n"); @@ -1258,7 +1258,7 @@ public void testInverseIfCondition4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b, boolean c) {\n"); @@ -1283,7 +1283,7 @@ public void testInverseIfCondition4() throws Exception { public void testInverseIfCondition5() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=74580 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -1303,7 +1303,7 @@ public void testInverseIfCondition5() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -1326,7 +1326,7 @@ public void testInverseIfCondition5() throws Exception { public void testInverseIfCondition_bug119251() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119251 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private boolean a() { return false; }\n"); @@ -1346,7 +1346,7 @@ public void testInverseIfCondition_bug119251() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private boolean a() { return false; }\n"); @@ -1367,7 +1367,7 @@ public void testInverseIfCondition_bug119251() throws Exception { public void testInverseIfCondition6() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119251 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private boolean a() { return false; }\n"); @@ -1387,7 +1387,7 @@ public void testInverseIfCondition6() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private boolean a() { return false; }\n"); @@ -1408,7 +1408,7 @@ public void testInverseIfCondition6() throws Exception { public void testInverseIfConditionUnboxing() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=297645 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Boolean b) {\n"); @@ -1427,7 +1427,7 @@ public void testInverseIfConditionUnboxing() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Boolean b) {\n"); @@ -1446,7 +1446,7 @@ public void testInverseIfConditionUnboxing() throws Exception { @Test public void testInverseIfConditionEquals() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1464,7 +1464,7 @@ public void testInverseIfConditionEquals() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1483,7 +1483,7 @@ public void testInverseIfConditionEquals() throws Exception { public void testInverseIfCondition_bug117960() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=117960 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1502,7 +1502,7 @@ public void testInverseIfCondition_bug117960() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1522,7 +1522,7 @@ public void testInverseIfCondition_bug117960() throws Exception { public void testInverseIfCondition_bug388074() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=388074 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1541,7 +1541,7 @@ public void testInverseIfCondition_bug388074() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -1562,7 +1562,7 @@ public void testInverseIfCondition_bug388074() throws Exception { public void testInverseConditionalStatement1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=74746 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(boolean a) {\n"); @@ -1577,7 +1577,7 @@ public void testInverseConditionalStatement1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(boolean a) {\n"); @@ -1594,7 +1594,7 @@ public void testInverseConditionalStatement1() throws Exception { public void testInverseConditionalStatement2() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=74746 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a) {\n"); @@ -1609,7 +1609,7 @@ public void testInverseConditionalStatement2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a) {\n"); @@ -1626,7 +1626,7 @@ public void testInverseConditionalStatement2() throws Exception { public void testInnerAndOuterIfConditions1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=74746 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1647,7 +1647,7 @@ public void testInnerAndOuterIfConditions1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1668,7 +1668,7 @@ public void testInnerAndOuterIfConditions1() throws Exception { @Test public void testInnerAndOuterIfConditions2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1688,7 +1688,7 @@ public void testInnerAndOuterIfConditions2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1708,7 +1708,7 @@ public void testInnerAndOuterIfConditions2() throws Exception { @Test public void testInnerAndOuterIfConditions3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1729,7 +1729,7 @@ public void testInnerAndOuterIfConditions3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1750,7 +1750,7 @@ public void testInnerAndOuterIfConditions3() throws Exception { @Test public void testInnerAndOuterIfConditions4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1770,7 +1770,7 @@ public void testInnerAndOuterIfConditions4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo(int a, Object b) {\n"); @@ -1791,7 +1791,7 @@ public void testInnerAndOuterIfConditions4() throws Exception { public void testExchangeOperands1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=74746 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, Object b) {\n"); @@ -1807,7 +1807,7 @@ public void testExchangeOperands1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, Object b) {\n"); @@ -1823,7 +1823,7 @@ public void testExchangeOperands1() throws Exception { @Test public void testExchangeOperands2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1839,7 +1839,7 @@ public void testExchangeOperands2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1855,7 +1855,7 @@ public void testExchangeOperands2() throws Exception { @Test public void testExchangeOperands3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1871,7 +1871,7 @@ public void testExchangeOperands3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1887,7 +1887,7 @@ public void testExchangeOperands3() throws Exception { @Test public void testExchangeOperands4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1903,7 +1903,7 @@ public void testExchangeOperands4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1919,7 +1919,7 @@ public void testExchangeOperands4() throws Exception { @Test public void testExchangeOperands5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1935,7 +1935,7 @@ public void testExchangeOperands5() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1951,7 +1951,7 @@ public void testExchangeOperands5() throws Exception { @Test public void testExchangeOperands6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1967,7 +1967,7 @@ public void testExchangeOperands6() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1983,7 +1983,7 @@ public void testExchangeOperands6() throws Exception { @Test public void testExchangeOperands7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -1999,7 +1999,7 @@ public void testExchangeOperands7() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2015,7 +2015,7 @@ public void testExchangeOperands7() throws Exception { @Test public void testExchangeOperandsBug332019_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2031,7 +2031,7 @@ public void testExchangeOperandsBug332019_1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2047,7 +2047,7 @@ public void testExchangeOperandsBug332019_1() throws Exception { @Test public void testExchangeOperandsBug332019_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2063,7 +2063,7 @@ public void testExchangeOperandsBug332019_2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2079,7 +2079,7 @@ public void testExchangeOperandsBug332019_2() throws Exception { @Test public void testExchangeOperandsBug332019_3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2095,7 +2095,7 @@ public void testExchangeOperandsBug332019_3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2111,7 +2111,7 @@ public void testExchangeOperandsBug332019_3() throws Exception { @Test public void testExchangeOperandsBug332019_4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2127,7 +2127,7 @@ public void testExchangeOperandsBug332019_4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int a, int b) {\n"); @@ -2144,7 +2144,7 @@ public void testExchangeOperandsBug332019_4() throws Exception { public void testAssignAndCast1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=75066 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2161,7 +2161,7 @@ public void testAssignAndCast1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2180,7 +2180,7 @@ public void testAssignAndCast1() throws Exception { public void testAssignAndCast2() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=75066 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2197,7 +2197,7 @@ public void testAssignAndCast2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2216,7 +2216,7 @@ public void testAssignAndCast2() throws Exception { @Test public void testAssignAndCastBug_104021() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2234,7 +2234,7 @@ public void testAssignAndCastBug_104021() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2253,7 +2253,7 @@ public void testAssignAndCastBug_104021() throws Exception { @Test public void testAssignAndCastBug129336_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2270,7 +2270,7 @@ public void testAssignAndCastBug129336_1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2288,7 +2288,7 @@ public void testAssignAndCastBug129336_1() throws Exception { @Test public void testAssignAndCast129336_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2305,7 +2305,7 @@ public void testAssignAndCast129336_2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2323,7 +2323,7 @@ public void testAssignAndCast129336_2() throws Exception { @Test public void testAssignAndCastBug129336_3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2341,7 +2341,7 @@ public void testAssignAndCastBug129336_3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2360,7 +2360,7 @@ public void testAssignAndCastBug129336_3() throws Exception { @Test public void testAssignAndCastBug331195_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2377,7 +2377,7 @@ public void testAssignAndCastBug331195_1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2395,7 +2395,7 @@ public void testAssignAndCastBug331195_1() throws Exception { @Test public void testAssignAndCastBug331195_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2412,7 +2412,7 @@ public void testAssignAndCastBug331195_2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2430,7 +2430,7 @@ public void testAssignAndCastBug331195_2() throws Exception { @Test public void testAssignAndCastBug331195_3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2447,7 +2447,7 @@ public void testAssignAndCastBug331195_3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2465,7 +2465,7 @@ public void testAssignAndCastBug331195_3() throws Exception { @Test public void testAssignAndCastBug331195_4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2482,7 +2482,7 @@ public void testAssignAndCastBug331195_4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2500,7 +2500,7 @@ public void testAssignAndCastBug331195_4() throws Exception { @Test public void testAssignAndCastBug331195_5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2517,7 +2517,7 @@ public void testAssignAndCastBug331195_5() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2535,7 +2535,7 @@ public void testAssignAndCastBug331195_5() throws Exception { @Test public void testAssignAndCastBug331195_6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2553,7 +2553,7 @@ public void testAssignAndCastBug331195_6() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2572,7 +2572,7 @@ public void testAssignAndCastBug331195_6() throws Exception { @Test public void testAssignAndCastBug331195_7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2589,7 +2589,7 @@ public void testAssignAndCastBug331195_7() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2607,7 +2607,7 @@ public void testAssignAndCastBug331195_7() throws Exception { @Test public void testAssignAndCastBug331195_8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2624,7 +2624,7 @@ public void testAssignAndCastBug331195_8() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, Object b) {\n"); @@ -2643,7 +2643,7 @@ public void testAssignAndCastBug331195_8() throws Exception { @Test public void testReplaceReturnConditionWithIf1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -2659,7 +2659,7 @@ public void testReplaceReturnConditionWithIf1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -2677,7 +2677,7 @@ public void testReplaceReturnConditionWithIf1() throws Exception { @Test public void testReplaceReturnConditionWithIf2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -2693,7 +2693,7 @@ public void testReplaceReturnConditionWithIf2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -2711,7 +2711,7 @@ public void testReplaceReturnConditionWithIf2() throws Exception { @Test public void testReplaceReturnConditionWithIf3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -2728,7 +2728,7 @@ public void testReplaceReturnConditionWithIf3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -2747,7 +2747,7 @@ public void testReplaceReturnConditionWithIf3() throws Exception { public void testReplaceReturnConditionWithIf4() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112443 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.List;\n"); @@ -2764,7 +2764,7 @@ public void testReplaceReturnConditionWithIf4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.List;\n"); @@ -2784,7 +2784,7 @@ public void testReplaceReturnConditionWithIf4() throws Exception { @Test public void testReplaceAssignConditionWithIf1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2800,7 +2800,7 @@ public void testReplaceAssignConditionWithIf1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2819,7 +2819,7 @@ public void testReplaceAssignConditionWithIf1() throws Exception { @Test public void testReplaceAssignConditionWithIf2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2836,7 +2836,7 @@ public void testReplaceAssignConditionWithIf2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2855,7 +2855,7 @@ public void testReplaceAssignConditionWithIf2() throws Exception { @Test public void testReplaceAssignConditionWithIf3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -2872,7 +2872,7 @@ public void testReplaceAssignConditionWithIf3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -2891,7 +2891,7 @@ public void testReplaceAssignConditionWithIf3() throws Exception { @Test public void testReplaceAssignConditionWithIf4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2907,7 +2907,7 @@ public void testReplaceAssignConditionWithIf4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2926,7 +2926,7 @@ public void testReplaceAssignConditionWithIf4() throws Exception { @Test public void testReplaceAssignConditionWithIf5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2942,7 +2942,7 @@ public void testReplaceAssignConditionWithIf5() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2961,7 +2961,7 @@ public void testReplaceAssignConditionWithIf5() throws Exception { @Test public void testReplaceAssignConditionWithIf6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2978,7 +2978,7 @@ public void testReplaceAssignConditionWithIf6() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -2997,7 +2997,7 @@ public void testReplaceAssignConditionWithIf6() throws Exception { @Test public void testReplaceAssignConditionWithIf7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -3014,7 +3014,7 @@ public void testReplaceAssignConditionWithIf7() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -3033,7 +3033,7 @@ public void testReplaceAssignConditionWithIf7() throws Exception { @Test public void testReplaceAssignConditionWithIf8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -3051,7 +3051,7 @@ public void testReplaceAssignConditionWithIf8() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -3069,7 +3069,7 @@ public void testReplaceAssignConditionWithIf8() throws Exception { @Test public void testReplaceConditionalWithIf9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3086,7 +3086,7 @@ public void testReplaceConditionalWithIf9() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3104,7 +3104,7 @@ public void testReplaceConditionalWithIf9() throws Exception { @Test public void testReplaceConditionalWithIf10() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3122,7 +3122,7 @@ public void testReplaceConditionalWithIf10() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3141,7 +3141,7 @@ public void testReplaceConditionalWithIf10() throws Exception { } public void testReplaceConditionalWithIf11() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3160,7 +3160,7 @@ public void testReplaceConditionalWithIf11() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3179,7 +3179,7 @@ public void testReplaceConditionalWithIf11() throws Exception { } public void testReplaceConditionalWithIf12() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3196,7 +3196,7 @@ public void testReplaceConditionalWithIf12() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int f1() {\n"); @@ -3214,7 +3214,7 @@ public void testReplaceConditionalWithIf12() throws Exception { @Test public void testReplaceReturnIfWithCondition() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -3235,7 +3235,7 @@ public void testReplaceReturnIfWithCondition() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String foo(Object b) {\n"); @@ -3253,7 +3253,7 @@ public void testReplaceReturnIfWithCondition2() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Number foo(Integer integer) {\n"); @@ -3274,7 +3274,7 @@ public void testReplaceReturnIfWithCondition2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Number foo(Integer integer) {\n"); @@ -3294,7 +3294,7 @@ public void testReplaceReturnIfWithCondition2() throws Exception { @Test public void testReplaceAssignIfWithCondition1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -3315,7 +3315,7 @@ public void testReplaceAssignIfWithCondition1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object b) {\n"); @@ -3333,7 +3333,7 @@ public void testReplaceAssignIfWithCondition1() throws Exception { @Test public void testReplaceAssignIfWithCondition2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3354,7 +3354,7 @@ public void testReplaceAssignIfWithCondition2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3374,7 +3374,7 @@ public void testReplaceAssignIfWithCondition2() throws Exception { @Test public void testInverseVariable1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b) {\n"); @@ -3392,7 +3392,7 @@ public void testInverseVariable1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b) {\n"); @@ -3409,7 +3409,7 @@ public void testInverseVariable1() throws Exception { @Test public void testInverseVariable2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3425,7 +3425,7 @@ public void testInverseVariable2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3440,7 +3440,7 @@ public void testInverseVariable2() throws Exception { @Test public void testInverseVariable2b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3456,7 +3456,7 @@ public void testInverseVariable2b() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3471,7 +3471,7 @@ public void testInverseVariable2b() throws Exception { @Test public void testInverseVariable3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3488,7 +3488,7 @@ public void testInverseVariable3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3506,7 +3506,7 @@ public void testInverseVariable3() throws Exception { @Test public void testInverseVariable4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3523,7 +3523,7 @@ public void testInverseVariable4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b) {\n"); @@ -3540,7 +3540,7 @@ public void testInverseVariable4() throws Exception { @Test public void testInverseVariableBug117960() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -3557,7 +3557,7 @@ public void testInverseVariableBug117960() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -3575,7 +3575,7 @@ public void testInverseVariableBug117960() throws Exception { public void testInverseCondition1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=334876 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a, Object b) {\n"); @@ -3592,7 +3592,7 @@ public void testInverseCondition1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a, Object b) {\n"); @@ -3609,7 +3609,7 @@ public void testInverseCondition1() throws Exception { @Test public void testInverseCondition2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3626,7 +3626,7 @@ public void testInverseCondition2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3643,7 +3643,7 @@ public void testInverseCondition2() throws Exception { @Test public void testInverseCondition3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3660,7 +3660,7 @@ public void testInverseCondition3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3677,7 +3677,7 @@ public void testInverseCondition3() throws Exception { @Test public void testInverseCondition4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3694,7 +3694,7 @@ public void testInverseCondition4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3711,7 +3711,7 @@ public void testInverseCondition4() throws Exception { @Test public void testInverseCondition5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3728,7 +3728,7 @@ public void testInverseCondition5() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3745,7 +3745,7 @@ public void testInverseCondition5() throws Exception { @Test public void testInverseCondition6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3761,7 +3761,7 @@ public void testInverseCondition6() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object a) {\n"); @@ -3777,7 +3777,7 @@ public void testInverseCondition6() throws Exception { @Test public void testPushNegationDown1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k) {\n"); @@ -3793,7 +3793,7 @@ public void testPushNegationDown1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k) {\n"); @@ -3810,7 +3810,7 @@ public void testPushNegationDown1() throws Exception { @Test public void testPushNegationDown2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k) {\n"); @@ -3826,7 +3826,7 @@ public void testPushNegationDown2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k) {\n"); @@ -3843,7 +3843,7 @@ public void testPushNegationDown2() throws Exception { @Test public void testPushNegationDown3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k) {\n"); @@ -3859,7 +3859,7 @@ public void testPushNegationDown3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k) {\n"); @@ -3922,7 +3922,7 @@ public void testPushNegationDownBug335778_2() throws Exception { @Test public void testPushNegationDownBug117960() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -3939,7 +3939,7 @@ public void testPushNegationDownBug117960() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -3957,7 +3957,7 @@ public void testPushNegationDownBug117960() throws Exception { @Test public void testPullNegationUp() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k, int m, int n) {\n"); @@ -3974,7 +3974,7 @@ public void testPullNegationUp() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, int j, int k, int m, int n) {\n"); @@ -4039,7 +4039,7 @@ public void testPullNegationUpBug335778_2() throws Exception { @Test public void testPullNegationUpBug117960() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -4057,7 +4057,7 @@ public void testPullNegationUpBug117960() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean a, boolean b) {\n"); @@ -4075,7 +4075,7 @@ public void testPullNegationUpBug117960() throws Exception { @Test public void testJoinIfListInIfElseIf() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b) {\n"); @@ -4104,7 +4104,7 @@ public void testJoinIfListInIfElseIf() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a, int b) {\n"); @@ -4133,7 +4133,7 @@ public void testJoinIfListInIfElseIf() throws Exception { @Test public void testConvertSwitchToIf() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a) {\n"); @@ -4165,7 +4165,7 @@ public void testConvertSwitchToIf() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a) {\n"); @@ -4191,7 +4191,7 @@ public void testConvertSwitchToIf() throws Exception { @Test public void testConvertSwitchToIf2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -4223,7 +4223,7 @@ public void testConvertSwitchToIf2() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -4252,7 +4252,7 @@ public void testConvertSwitchToIf2() throws Exception { @Test public void testConvertSwitchToIf3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -4282,7 +4282,7 @@ public void testConvertSwitchToIf3() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -4309,7 +4309,7 @@ public void testConvertSwitchToIf3() throws Exception { @Test public void testConvertSwitchToIfBug252104_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foobar() {\n"); @@ -4339,7 +4339,7 @@ public void testConvertSwitchToIfBug252104_1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foobar() {\n"); @@ -4367,7 +4367,7 @@ public void testConvertSwitchToIfBug252104_1() throws Exception { @Test public void testConvertSwitchToIfBug252104_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int x, int y) {\n"); @@ -4391,7 +4391,7 @@ public void testConvertSwitchToIfBug252104_2() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int x, int y) {\n"); @@ -4414,7 +4414,7 @@ public void testConvertSwitchToIfBug252104_2() throws Exception { public void testConvertSwitchToIfBug252040_1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252040 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4444,7 +4444,7 @@ public void testConvertSwitchToIfBug252040_1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4471,7 +4471,7 @@ public void testConvertSwitchToIfBug252040_1() throws Exception { public void testConvertSwitchToIfBug252040_2() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252040 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4502,7 +4502,7 @@ public void testConvertSwitchToIfBug252040_2() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4530,7 +4530,7 @@ public void testConvertSwitchToIfBug252040_2() throws Exception { @Test public void testConvertSwitchToIfBug352422() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a) {\n"); @@ -4559,7 +4559,7 @@ public void testConvertSwitchToIfBug352422() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a) {\n"); @@ -4613,7 +4613,7 @@ public void testConvertSwitchToIfBug352422_2() throws Exception { @Test public void testConvertIfToSwitch() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a) {\n"); @@ -4638,7 +4638,7 @@ public void testConvertIfToSwitch() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int a) {\n"); @@ -4962,7 +4962,7 @@ public void testConvertIfToSwitchDoNotConvertAnnoyingBreak() throws Exception { @Test public void testConvertIfToSwitchOnEnumWithEqual() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -4993,7 +4993,7 @@ public void testConvertIfToSwitchOnEnumWithEqual() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5023,7 +5023,7 @@ public void testConvertIfToSwitchOnEnumWithEqual() throws Exception { @Test public void testConvertIfToSwitchOnEnumWithMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5054,7 +5054,7 @@ public void testConvertIfToSwitchOnEnumWithMethod() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5084,7 +5084,7 @@ public void testConvertIfToSwitchOnEnumWithMethod() throws Exception { @Test public void testConvertIfToSwitchUsingConstants() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5113,7 +5113,7 @@ public void testConvertIfToSwitchUsingConstants() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5141,7 +5141,7 @@ public void testConvertIfToSwitchUsingConstants() throws Exception { @Test public void testConvertIfToSwitchWithoutJumpStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int a= 10;\n"); @@ -5167,7 +5167,7 @@ public void testConvertIfToSwitchWithoutJumpStatement() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int a= 10;\n"); @@ -5323,7 +5323,7 @@ public void testConvertIfToSwitchWithLabeledBreak() throws Exception { @Test public void testConvertIfToSwitchWithMethodAsDiscriminant() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int a= 10;\n"); @@ -5352,7 +5352,7 @@ public void testConvertIfToSwitchWithMethodAsDiscriminant() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int a= 10;\n"); @@ -5420,7 +5420,7 @@ public void testConvertIfToSwitchDoNotFixOnDifferentDiscriminant() throws Except @Test public void testConvertIfToSwitchOnEnum() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5451,7 +5451,7 @@ public void testConvertIfToSwitchOnEnum() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5475,7 +5475,7 @@ public void testConvertIfToSwitchOnEnum() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -5585,7 +5585,7 @@ public void testConvertIfToSwitchBug393147_2() throws Exception { @Test public void testSurroundWithTemplate01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5606,7 +5606,7 @@ public void testSurroundWithTemplate01() throws Exception { String[] expected= new String[9]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5617,7 +5617,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5628,7 +5628,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5639,7 +5639,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5652,7 +5652,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5663,7 +5663,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5676,7 +5676,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[5]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5687,7 +5687,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[6]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5700,7 +5700,7 @@ public void testSurroundWithTemplate01() throws Exception { buf.append("}\n"); expected[7]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5720,7 +5720,7 @@ public void testSurroundWithTemplate01() throws Exception { @Test public void testSurroundWithTemplate02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5742,7 +5742,7 @@ public void testSurroundWithTemplate02() throws Exception { String[] expected= new String[9]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5754,7 +5754,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5766,7 +5766,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5778,7 +5778,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5792,7 +5792,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5804,7 +5804,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5818,7 +5818,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[5]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5830,7 +5830,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[6]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5844,7 +5844,7 @@ public void testSurroundWithTemplate02() throws Exception { buf.append("}\n"); expected[7]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5865,7 +5865,7 @@ public void testSurroundWithTemplate02() throws Exception { @Test public void testSurroundWithTemplate03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5888,7 +5888,7 @@ public void testSurroundWithTemplate03() throws Exception { String[] expected= new String[9]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5902,7 +5902,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5916,7 +5916,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5930,7 +5930,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5946,7 +5946,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5960,7 +5960,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5976,7 +5976,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[5]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -5990,7 +5990,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[6]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6006,7 +6006,7 @@ public void testSurroundWithTemplate03() throws Exception { buf.append("}\n"); expected[7]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6029,7 +6029,7 @@ public void testSurroundWithTemplate03() throws Exception { @Test public void testSurroundWithTemplate04() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6052,7 +6052,7 @@ public void testSurroundWithTemplate04() throws Exception { String[] expected= new String[9]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6065,7 +6065,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6078,7 +6078,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6091,7 +6091,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6106,7 +6106,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6119,7 +6119,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6134,7 +6134,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[5]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6147,7 +6147,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[6]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6162,7 +6162,7 @@ public void testSurroundWithTemplate04() throws Exception { buf.append("}\n"); expected[7]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void foo() {\n"); @@ -6184,7 +6184,7 @@ public void testSurroundWithTemplate04() throws Exception { @Test public void testPickOutStringProposals1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6200,7 +6200,7 @@ public void testPickOutStringProposals1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6216,7 +6216,7 @@ public void testPickOutStringProposals1() throws Exception { @Test public void testPickOutStringProposals2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6232,7 +6232,7 @@ public void testPickOutStringProposals2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6289,7 +6289,7 @@ public void testPickOutStringProposals4() throws Exception { @Test public void testCombineStringsProposals1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6305,7 +6305,7 @@ public void testCombineStringsProposals1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6321,7 +6321,7 @@ public void testCombineStringsProposals1() throws Exception { @Test public void testCombineStringsProposals2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6337,7 +6337,7 @@ public void testCombineStringsProposals2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6373,7 +6373,7 @@ public void testCombineStringsProposals3() throws Exception { @Test public void testCombineStringsProposals4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6389,7 +6389,7 @@ public void testCombineStringsProposals4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6459,7 +6459,7 @@ public void testConvertToIfReturn1() throws Exception { List proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("public class E {\n"); buf1.append(" public void foo1() {\n"); @@ -6492,7 +6492,7 @@ public void testConvertToIfReturn1() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("public class E {\n"); buf1.append(" public void foo1() {\n"); @@ -6525,7 +6525,7 @@ public void testConvertToIfReturn1() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("public class E {\n"); buf1.append(" public void foo1() {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d7.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d7.java index d370d4a2c26..779ef8012b8 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d7.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d7.java @@ -92,7 +92,7 @@ public void tearDown() throws Exception { @Test public void testConvertSwitchToIf() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -119,7 +119,7 @@ public void testConvertSwitchToIf() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -134,7 +134,7 @@ public void testConvertSwitchToIf() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -155,7 +155,7 @@ public void testConvertSwitchToIf() throws Exception { @Test public void testConvertIfToSwitch1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -178,7 +178,7 @@ public void testConvertIfToSwitch1() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -233,7 +233,7 @@ public void testConvertIfToSwitch2() throws Exception { @Test public void testConvertIfToSwitch3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -256,7 +256,7 @@ public void testConvertIfToSwitch3() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -275,7 +275,7 @@ public void testConvertIfToSwitch3() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -304,7 +304,7 @@ public void testConvertIfToSwitch3() throws Exception { @Test public void testConvertIfToSwitch4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -327,7 +327,7 @@ public void testConvertIfToSwitch4() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -346,7 +346,7 @@ public void testConvertIfToSwitch4() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -375,7 +375,7 @@ public void testConvertIfToSwitch4() throws Exception { @Test public void testConvertIfToSwitch5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -396,7 +396,7 @@ public void testConvertIfToSwitch5() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -412,7 +412,7 @@ public void testConvertIfToSwitch5() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -438,7 +438,7 @@ public void testConvertIfToSwitch5() throws Exception { public void testReplaceReturnConditionWithIf4() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112443 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.List;\n"); @@ -455,7 +455,7 @@ public void testReplaceReturnConditionWithIf4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.List;\n"); @@ -475,7 +475,7 @@ public void testReplaceReturnConditionWithIf4() throws Exception { @Test public void testReplaceReturnIfWithCondition3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -497,7 +497,7 @@ public void testReplaceReturnIfWithCondition3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -515,7 +515,7 @@ public void testReplaceReturnIfWithCondition3() throws Exception { @Test public void testReplaceReturnIfWithCondition4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.Map;\n"); @@ -537,7 +537,7 @@ public void testReplaceReturnIfWithCondition4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.Collections;\n"); @@ -556,7 +556,7 @@ public void testReplaceReturnIfWithCondition4() throws Exception { @Test public void testConvertIfToSwitch() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static boolean isOdd(String number) {\n"); @@ -577,7 +577,7 @@ public void testConvertIfToSwitch() throws Exception { assertNumberOfProposals(proposals, 6); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static boolean isOdd(String number) {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d8.java index ba805be2b5e..7878d84165a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AdvancedQuickAssistTest1d8.java @@ -140,7 +140,7 @@ public void testConvertToIfReturn1() throws Exception { List proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("@FunctionalInterface\n"); buf1.append("interface A {\n"); @@ -196,7 +196,7 @@ public void testConvertToIfReturn1() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("@FunctionalInterface\n"); buf1.append("interface A {\n"); @@ -253,7 +253,7 @@ public void testConvertToIfReturn1() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("@FunctionalInterface\n"); buf1.append("interface A {\n"); @@ -310,7 +310,7 @@ public void testConvertToIfReturn1() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("@FunctionalInterface\n"); buf1.append("interface A {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java index 712faf21cd9..572fd10ce6a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java @@ -107,7 +107,7 @@ public void tearDown() throws Exception { @Test public void testAssignToLocal() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -126,7 +126,7 @@ public void testAssignToLocal() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Class class1;\n"); @@ -140,7 +140,7 @@ public void testAssignToLocal() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -156,7 +156,7 @@ public void testAssignToLocal() throws Exception { @Test public void testAssignToLocal2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -179,7 +179,7 @@ public void testAssignToLocal2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -197,7 +197,7 @@ public void testAssignToLocal2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -227,7 +227,7 @@ public void testAssignToLocal3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -249,7 +249,7 @@ public void testAssignToLocal3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -265,7 +265,7 @@ public void testAssignToLocal3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -285,7 +285,7 @@ public void testAssignToLocal4() throws Exception { // test name conflict IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -307,7 +307,7 @@ public void testAssignToLocal4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -323,7 +323,7 @@ public void testAssignToLocal4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -351,7 +351,7 @@ public void testAssignToLocal5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -373,7 +373,7 @@ public void testAssignToLocal5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -389,7 +389,7 @@ public void testAssignToLocal5() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("\n"); @@ -407,7 +407,7 @@ public void testAssignToLocal5() throws Exception { @Test public void testAssignToLocal6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" static {\n"); @@ -426,7 +426,7 @@ public void testAssignToLocal6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static Class class1;\n"); @@ -440,7 +440,7 @@ public void testAssignToLocal6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" static {\n"); @@ -457,7 +457,7 @@ public void testAssignToLocal7() throws Exception { // test name conflict: name used later IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -481,7 +481,7 @@ public void testAssignToLocal7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -500,7 +500,7 @@ public void testAssignToLocal7() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -619,7 +619,7 @@ public void testAssignToLocal9() throws Exception { // assign to local of field access IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fField;\n"); @@ -639,7 +639,7 @@ public void testAssignToLocal9() throws Exception { String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fField;\n"); @@ -649,7 +649,7 @@ public void testAssignToLocal9() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fField;\n"); @@ -660,7 +660,7 @@ public void testAssignToLocal9() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fField;\n"); @@ -681,7 +681,7 @@ public void testAssignToLocal10() throws Exception { // assign to local with recovered statement IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -700,7 +700,7 @@ public void testAssignToLocal10() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -715,7 +715,7 @@ public void testAssignToLocal10() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -738,7 +738,7 @@ public void testAssignToLocal11() throws Exception { // assign to statement in if body with no brackets IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -758,7 +758,7 @@ public void testAssignToLocal11() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -775,7 +775,7 @@ public void testAssignToLocal11() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -799,7 +799,7 @@ public void testAssignToLocal12() throws Exception { // assign to recovered statement in if body with no brackets IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -821,7 +821,7 @@ public void testAssignToLocal12() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -840,7 +840,7 @@ public void testAssignToLocal12() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -866,7 +866,7 @@ public void testAssignToLocal13() throws Exception { // assign to local in context that requires fully qualified type, https://bugs.eclipse.org/bugs/show_bug.cgi?id=239735 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Timer {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -884,7 +884,7 @@ public void testAssignToLocal13() throws Exception { String[] expecteds= new String[5]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Timer {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -893,7 +893,7 @@ public void testAssignToLocal13() throws Exception { buf.append("}\n"); expecteds[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Timer {\n"); buf.append(" private static java.util.Timer timer;\n"); @@ -904,7 +904,7 @@ public void testAssignToLocal13() throws Exception { buf.append("}\n"); expecteds[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Timer {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -913,7 +913,7 @@ public void testAssignToLocal13() throws Exception { buf.append("}\n"); expecteds[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Timer {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -922,7 +922,7 @@ public void testAssignToLocal13() throws Exception { buf.append("}\n"); expecteds[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Timer {\n"); buf.append(" private static final java.util.Timer TIMER = new java.util.Timer();\n"); @@ -940,7 +940,7 @@ public void testAssignToLocal13() throws Exception { @Test public void testAssignToLocal14() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -960,7 +960,7 @@ public void testAssignToLocal14() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -974,7 +974,7 @@ public void testAssignToLocal14() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -998,7 +998,7 @@ public void testAssignToLocal14() throws Exception { @Test public void testAssignToLocal15() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1018,7 +1018,7 @@ public void testAssignToLocal15() throws Exception { assertNumberOfProposals(proposals, 7); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1032,7 +1032,7 @@ public void testAssignToLocal15() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1055,7 +1055,7 @@ public void testAssignToLocal15() throws Exception { @Test public void testAssignToLocal16() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1076,7 +1076,7 @@ public void testAssignToLocal16() throws Exception { assertNumberOfProposals(proposals, 7); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1091,7 +1091,7 @@ public void testAssignToLocal16() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1115,7 +1115,7 @@ public void testAssignToLocal16() throws Exception { @Test public void testAssignToLocal17() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface WorkItem { }\n"); @@ -1136,7 +1136,7 @@ public void testAssignToLocal17() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface WorkItem { }\n"); @@ -1151,7 +1151,7 @@ public void testAssignToLocal17() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface WorkItem { }\n"); @@ -1174,7 +1174,7 @@ public void testAssignToLocal17() throws Exception { @Test public void testAssignToLocal18() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=287377 IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -1197,7 +1197,7 @@ public void testAssignToLocal18() throws Exception { // https://bugs.eclipse.org assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -1220,7 +1220,7 @@ public void testAssignToLocal18() throws Exception { // https://bugs.eclipse.org @Test public void testAssignParamToField() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(int count) {\n"); @@ -1236,7 +1236,7 @@ public void testAssignParamToField() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -1257,7 +1257,7 @@ public void testAssignParamToField2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1275,7 +1275,7 @@ public void testAssignParamToField2() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1300,7 +1300,7 @@ public void testAssignParamToField3() throws Exception { store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1320,7 +1320,7 @@ public void testAssignParamToField3() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1343,7 +1343,7 @@ public void testAssignParamToField4() throws Exception { store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private long count;\n"); @@ -1364,7 +1364,7 @@ public void testAssignParamToField4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private long count;\n"); @@ -1380,7 +1380,7 @@ public void testAssignParamToField4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private long count;\n"); @@ -1401,7 +1401,7 @@ public void testAssignParamToField5() throws Exception { store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int p1;\n"); @@ -1422,7 +1422,7 @@ public void testAssignParamToField5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int p1;\n"); @@ -1438,7 +1438,7 @@ public void testAssignParamToField5() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int p1;\n"); @@ -1459,7 +1459,7 @@ public void testAssignParamToField6() throws Exception { store.setValue(PreferenceConstants.CODEGEN_KEYWORD_THIS, true); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Float p1;\n"); @@ -1481,7 +1481,7 @@ public void testAssignParamToField6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Float p1;\n"); @@ -1497,7 +1497,7 @@ public void testAssignParamToField6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Float p1;\n"); @@ -1517,7 +1517,7 @@ public void testAssignParamToField6() throws Exception { @Test public void testAssignAllParamsToFields1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(int count, long size, boolean state) {\n"); @@ -1536,7 +1536,7 @@ public void testAssignAllParamsToFields1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -1550,7 +1550,7 @@ public void testAssignAllParamsToFields1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -1571,7 +1571,7 @@ public void testAssignAllParamsToFields1() throws Exception { @Test public void testAssignAllParamsToFields2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int count, long size, boolean state) {\n"); @@ -1590,7 +1590,7 @@ public void testAssignAllParamsToFields2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -1604,7 +1604,7 @@ public void testAssignAllParamsToFields2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -1629,7 +1629,7 @@ public void testAssignParamToFieldInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1647,7 +1647,7 @@ public void testAssignParamToFieldInGeneric() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1666,7 +1666,7 @@ public void testAssignParamToFieldInGeneric() throws Exception { @Test public void testAssignToLocal2CursorAtEnd() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1689,7 +1689,7 @@ public void testAssignToLocal2CursorAtEnd() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1706,7 +1706,7 @@ public void testAssignToLocal2CursorAtEnd() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -1725,7 +1725,7 @@ public void testAssignToLocal2CursorAtEnd() throws Exception { @Test public void testExtractToLocalVariable1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1744,7 +1744,7 @@ public void testExtractToLocalVariable1() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1756,7 +1756,7 @@ public void testExtractToLocalVariable1() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1768,7 +1768,7 @@ public void testExtractToLocalVariable1() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1783,7 +1783,7 @@ public void testExtractToLocalVariable1() throws Exception { buf.append("}\n"); String ex3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1794,7 +1794,7 @@ public void testExtractToLocalVariable1() throws Exception { buf.append("}\n"); String ex4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1812,7 +1812,7 @@ public void testExtractToLocalVariable1() throws Exception { public void testExtractToLocalVariable2() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=276467 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1832,7 +1832,7 @@ public void testExtractToLocalVariable2() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1845,7 +1845,7 @@ public void testExtractToLocalVariable2() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1858,7 +1858,7 @@ public void testExtractToLocalVariable2() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1877,7 +1877,7 @@ public void testExtractToLocalVariable2() throws Exception { public void testExtractToLocalVariable3() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=276467 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1898,7 +1898,7 @@ public void testExtractToLocalVariable3() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1912,7 +1912,7 @@ public void testExtractToLocalVariable3() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1926,7 +1926,7 @@ public void testExtractToLocalVariable3() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1946,7 +1946,7 @@ public void testExtractToLocalVariable3() throws Exception { public void testExtractToLocalVariable4() throws Exception { //bug 457547 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1964,7 +1964,7 @@ public void testExtractToLocalVariable4() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1975,7 +1975,7 @@ public void testExtractToLocalVariable4() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1986,7 +1986,7 @@ public void testExtractToLocalVariable4() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private static final int _1 = 1;\n"); @@ -2005,7 +2005,7 @@ public void testExtractToLocalVariable4() throws Exception { public void testExtractToMethod1() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=41302 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2024,7 +2024,7 @@ public void testExtractToMethod1() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2039,7 +2039,7 @@ public void testExtractToMethod1() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2051,7 +2051,7 @@ public void testExtractToMethod1() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2063,7 +2063,7 @@ public void testExtractToMethod1() throws Exception { buf.append("}\n"); String ex3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2074,7 +2074,7 @@ public void testExtractToMethod1() throws Exception { buf.append("}\n"); String ex4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2092,7 +2092,7 @@ public void testExtractToMethod1() throws Exception { public void testExtractToMethod2() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=41302 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2111,7 +2111,7 @@ public void testExtractToMethod2() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2126,7 +2126,7 @@ public void testExtractToMethod2() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2146,7 +2146,7 @@ public void testExtractToMethod2() throws Exception { public void testExtractToMethod3() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=41302 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2165,7 +2165,7 @@ public void testExtractToMethod3() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2180,7 +2180,7 @@ public void testExtractToMethod3() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2200,7 +2200,7 @@ public void testExtractToMethod3() throws Exception { public void testExtractToMethod4() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=41302 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2221,7 +2221,7 @@ public void testExtractToMethod4() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2237,7 +2237,7 @@ public void testExtractToMethod4() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2249,7 +2249,7 @@ public void testExtractToMethod4() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int j;\n"); @@ -2262,7 +2262,7 @@ public void testExtractToMethod4() throws Exception { buf.append("}\n"); String ex3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2281,7 +2281,7 @@ public void testExtractToMethod4() throws Exception { public void testReplaceCatchClauseWithThrowsWithFinally() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2305,7 +2305,7 @@ public void testReplaceCatchClauseWithThrowsWithFinally() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2321,7 +2321,7 @@ public void testReplaceCatchClauseWithThrowsWithFinally() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2342,7 +2342,7 @@ public void testReplaceCatchClauseWithThrowsWithFinally() throws Exception { public void testReplaceSingleCatchClauseWithThrows() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2365,7 +2365,7 @@ public void testReplaceSingleCatchClauseWithThrows() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2378,7 +2378,7 @@ public void testReplaceSingleCatchClauseWithThrows() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2391,7 +2391,7 @@ public void testReplaceSingleCatchClauseWithThrows() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2413,7 +2413,7 @@ public void testReplaceSingleCatchClauseWithThrows() throws Exception { public void testUnwrapForLoop() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2434,7 +2434,7 @@ public void testUnwrapForLoop() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2446,7 +2446,7 @@ public void testUnwrapForLoop() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2461,7 +2461,7 @@ public void testUnwrapForLoop() throws Exception { public void testUnwrapDoStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2484,7 +2484,7 @@ public void testUnwrapDoStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2500,7 +2500,7 @@ public void testUnwrapDoStatement() throws Exception { public void testUnwrapWhileLoop2Statements() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2522,7 +2522,7 @@ public void testUnwrapWhileLoop2Statements() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2537,7 +2537,7 @@ public void testUnwrapWhileLoop2Statements() throws Exception { public void testUnwrapIfStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2561,7 +2561,7 @@ public void testUnwrapIfStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2576,7 +2576,7 @@ public void testUnwrapIfStatement() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2594,7 +2594,7 @@ public void testUnwrapIfStatement() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2611,7 +2611,7 @@ public void testUnwrapIfStatement() throws Exception { proposal= (CUCorrectionProposal)proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2634,7 +2634,7 @@ public void testUnwrapIfStatement() throws Exception { public void testUnwrapTryStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2660,7 +2660,7 @@ public void testUnwrapTryStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2677,7 +2677,7 @@ public void testUnwrapTryStatement() throws Exception { public void testUnwrapAnonymous() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2700,7 +2700,7 @@ public void testUnwrapAnonymous() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2714,7 +2714,7 @@ public void testUnwrapAnonymous() throws Exception { public void testUnwrapBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2737,7 +2737,7 @@ public void testUnwrapBlock() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2753,7 +2753,7 @@ public void testUnwrapBlock() throws Exception { @Test public void testUnwrapMethodInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -2769,7 +2769,7 @@ public void testUnwrapMethodInvocation() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -2778,7 +2778,7 @@ public void testUnwrapMethodInvocation() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -2788,7 +2788,7 @@ public void testUnwrapMethodInvocation() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -2798,7 +2798,7 @@ public void testUnwrapMethodInvocation() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static final int ABS = Math.abs(9+ 8);\n"); @@ -2815,7 +2815,7 @@ public void testUnwrapMethodInvocation() throws Exception { @Test public void testSplitDeclaration1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2834,7 +2834,7 @@ public void testSplitDeclaration1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2848,7 +2848,7 @@ public void testSplitDeclaration1() throws Exception { @Test public void testSplitDeclaration2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2868,7 +2868,7 @@ public void testSplitDeclaration2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2883,7 +2883,7 @@ public void testSplitDeclaration2() throws Exception { @Test public void testSplitDeclaration3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2899,7 +2899,7 @@ public void testSplitDeclaration3() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2909,7 +2909,7 @@ public void testSplitDeclaration3() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2917,7 +2917,7 @@ public void testSplitDeclaration3() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int is[];\n"); @@ -2934,7 +2934,7 @@ public void testSplitDeclaration3() throws Exception { @Test public void testSplitDeclaration4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -2953,7 +2953,7 @@ public void testSplitDeclaration4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -2967,7 +2967,7 @@ public void testSplitDeclaration4() throws Exception { @Test public void testSplitDeclaration5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -2986,7 +2986,7 @@ public void testSplitDeclaration5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -3000,7 +3000,7 @@ public void testSplitDeclaration5() throws Exception { @Test public void testSplitDeclaration6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -3019,7 +3019,7 @@ public void testSplitDeclaration6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -3033,7 +3033,7 @@ public void testSplitDeclaration6() throws Exception { @Test public void testSplitDeclaration7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -3052,7 +3052,7 @@ public void testSplitDeclaration7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package e;\n"); buf.append("public class Test {\n"); buf.append(" public void test() {\n"); @@ -3066,7 +3066,7 @@ public void testSplitDeclaration7() throws Exception { @Test public void testSplitDeclaration8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3086,7 +3086,7 @@ public void testSplitDeclaration8() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3101,7 +3101,7 @@ public void testSplitDeclaration8() throws Exception { @Test public void testSplitDeclaration9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3121,7 +3121,7 @@ public void testSplitDeclaration9() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3136,7 +3136,7 @@ public void testSplitDeclaration9() throws Exception { @Test public void testSplitDeclaration10() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3156,7 +3156,7 @@ public void testSplitDeclaration10() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3171,7 +3171,7 @@ public void testSplitDeclaration10() throws Exception { @Test public void testSplitDeclaration11() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3191,7 +3191,7 @@ public void testSplitDeclaration11() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3206,7 +3206,7 @@ public void testSplitDeclaration11() throws Exception { @Test public void testJoinDeclaration1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3224,7 +3224,7 @@ public void testJoinDeclaration1() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3234,7 +3234,7 @@ public void testJoinDeclaration1() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int vars[];\n"); @@ -3253,7 +3253,7 @@ public void testJoinDeclaration1() throws Exception { @Test public void testJoinDeclaration2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3271,7 +3271,7 @@ public void testJoinDeclaration2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3281,7 +3281,7 @@ public void testJoinDeclaration2() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3293,7 +3293,7 @@ public void testJoinDeclaration2() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3305,7 +3305,7 @@ public void testJoinDeclaration2() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int vars[];\n"); @@ -3323,7 +3323,7 @@ public void testJoinDeclaration2() throws Exception { @Test public void testJoinDeclaration3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3341,7 +3341,7 @@ public void testJoinDeclaration3() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3351,7 +3351,7 @@ public void testJoinDeclaration3() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3363,7 +3363,7 @@ public void testJoinDeclaration3() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int vars[];\n"); @@ -3382,7 +3382,7 @@ public void testJoinDeclaration3() throws Exception { @Test public void testJoinDeclaration4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3406,7 +3406,7 @@ public void testJoinDeclaration4() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3422,7 +3422,7 @@ public void testJoinDeclaration4() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String message;\n"); @@ -3447,7 +3447,7 @@ public void testJoinDeclaration4() throws Exception { @Test public void testJoinDeclaration5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3471,7 +3471,7 @@ public void testJoinDeclaration5() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3488,7 +3488,7 @@ public void testJoinDeclaration5() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3506,7 +3506,7 @@ public void testJoinDeclaration5() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3524,7 +3524,7 @@ public void testJoinDeclaration5() throws Exception { buf.append("}\n"); String ex3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String message;\n"); @@ -3779,7 +3779,7 @@ public void testJoinDeclaration10() throws Exception { @Test public void testInvertEquals1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3798,7 +3798,7 @@ public void testInvertEquals1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3817,7 +3817,7 @@ public void testInvertEquals1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3830,7 +3830,7 @@ public void testInvertEquals1() throws Exception { @Test public void testInvertEquals2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3847,7 +3847,7 @@ public void testInvertEquals2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3857,7 +3857,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3867,7 +3867,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); String ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3877,7 +3877,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); String ex3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3901,7 +3901,7 @@ public void testInvertEquals2() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3911,7 +3911,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3922,7 +3922,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); ex2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3933,7 +3933,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); ex3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static final String A = \"a\";\n"); @@ -3945,7 +3945,7 @@ public void testInvertEquals2() throws Exception { buf.append("}\n"); ex4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3961,7 +3961,7 @@ public void testInvertEquals2() throws Exception { @Test public void testInvertEquals3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String a= \"a\";\n"); @@ -3982,7 +3982,7 @@ public void testInvertEquals3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String a= \"a\";\n"); @@ -4003,7 +4003,7 @@ public void testInvertEquals3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String a= \"a\";\n"); @@ -4018,7 +4018,7 @@ public void testInvertEquals3() throws Exception { @Test public void testInvertEquals4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class S {\n"); buf.append(" protected String sup= \"a\";\n"); @@ -4041,7 +4041,7 @@ public void testInvertEquals4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class S {\n"); buf.append(" protected String sup= \"a\";\n"); @@ -4064,7 +4064,7 @@ public void testInvertEquals4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class S {\n"); buf.append(" protected String sup= \"a\";\n"); @@ -4081,7 +4081,7 @@ public void testInvertEquals4() throws Exception { @Test public void testInvertEquals5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" static String A= \"a\";\n"); @@ -4103,7 +4103,7 @@ public void testInvertEquals5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" static String A= \"a\";\n"); @@ -4125,7 +4125,7 @@ public void testInvertEquals5() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" static String A= \"a\";\n"); @@ -4141,7 +4141,7 @@ public void testInvertEquals5() throws Exception { @Test public void testInvertEquals6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" static String get() {\n"); @@ -4166,7 +4166,7 @@ public void testInvertEquals6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" static String get() {\n"); @@ -4190,7 +4190,7 @@ public void testInvertEquals6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class A {\n"); buf.append(" static String get() {\n"); @@ -4208,7 +4208,7 @@ public void testInvertEquals6() throws Exception { @Test public void testInvertEquals7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4227,7 +4227,7 @@ public void testInvertEquals7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4246,7 +4246,7 @@ public void testInvertEquals7() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4259,7 +4259,7 @@ public void testInvertEquals7() throws Exception { @Test public void testInvertEquals8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4282,7 +4282,7 @@ public void testInvertEquals8() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4298,7 +4298,7 @@ public void testInvertEquals8() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4321,7 +4321,7 @@ public void testInvertEquals8() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4336,7 +4336,7 @@ public void testInvertEquals8() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4352,7 +4352,7 @@ public void testInvertEquals8() throws Exception { @Test public void testInvertEquals9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4371,7 +4371,7 @@ public void testInvertEquals9() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4390,7 +4390,7 @@ public void testInvertEquals9() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4647,7 +4647,7 @@ public void testInvertEquals18() throws Exception { @Test public void testInvertEquals19() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String a= \"a\";\n"); @@ -4667,7 +4667,7 @@ public void testInvertEquals19() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String a= \"a\";\n"); @@ -4687,7 +4687,7 @@ public void testInvertEquals19() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String a= \"a\";\n"); @@ -4701,7 +4701,7 @@ public void testInvertEquals19() throws Exception { @Test public void testInvertEquals20() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4721,7 +4721,7 @@ public void testInvertEquals20() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4741,7 +4741,7 @@ public void testInvertEquals20() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4755,7 +4755,7 @@ public void testInvertEquals20() throws Exception { @Test public void testInvertEquals21() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4774,7 +4774,7 @@ public void testInvertEquals21() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4793,7 +4793,7 @@ public void testInvertEquals21() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4806,7 +4806,7 @@ public void testInvertEquals21() throws Exception { @Test public void testInvertEquals22() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4825,7 +4825,7 @@ public void testInvertEquals22() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4844,7 +4844,7 @@ public void testInvertEquals22() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4857,7 +4857,7 @@ public void testInvertEquals22() throws Exception { @Test public void testInvertEquals23() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4876,7 +4876,7 @@ public void testInvertEquals23() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4895,7 +4895,7 @@ public void testInvertEquals23() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4909,7 +4909,7 @@ public void testInvertEquals23() throws Exception { public void testInvertEquals24() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=385389 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Enum e) {\n"); @@ -4931,7 +4931,7 @@ public void testInvertEquals24() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Enum e) {\n"); @@ -4953,7 +4953,7 @@ public void testInvertEquals24() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Enum e) {\n"); @@ -5016,19 +5016,19 @@ public void testAddTypeToArrayInitializer() throws Exception { public void testCreateInSuper() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface IB {\n"); buf.append("}\n"); pack1.createCompilationUnit("IB.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.Vector;\n"); @@ -5049,7 +5049,7 @@ public void testCreateInSuper() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -5064,7 +5064,7 @@ public void testCreateInSuper() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -5086,19 +5086,19 @@ public void testCreateInSuper() throws Exception { @Test public void testCreateInSuperInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface IB {\n"); buf.append("}\n"); pack1.createCompilationUnit("IB.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.Vector;\n"); @@ -5125,7 +5125,7 @@ public void testCreateInSuperInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -5146,7 +5146,7 @@ public void testCreateInSuperInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -5174,7 +5174,7 @@ public void testCreateInSuperInGeneric() throws Exception { public void testChangeIfStatementToBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5191,7 +5191,7 @@ public void testChangeIfStatementToBlock() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5202,7 +5202,7 @@ public void testChangeIfStatementToBlock() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5214,7 +5214,7 @@ public void testChangeIfStatementToBlock() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5223,7 +5223,7 @@ public void testChangeIfStatementToBlock() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5241,7 +5241,7 @@ public void testChangeIfStatementToBlock() throws Exception { public void testChangeElseStatementToBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5260,7 +5260,7 @@ public void testChangeElseStatementToBlock() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5273,7 +5273,7 @@ public void testChangeElseStatementToBlock() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5293,7 +5293,7 @@ public void testChangeElseStatementToBlock() throws Exception { public void testChangeIfWithElseStatementToBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5313,7 +5313,7 @@ public void testChangeIfWithElseStatementToBlock() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5326,7 +5326,7 @@ public void testChangeIfWithElseStatementToBlock() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5345,7 +5345,7 @@ public void testChangeIfWithElseStatementToBlock() throws Exception { public void testChangeIfAndElseStatementToBlock1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5364,7 +5364,7 @@ public void testChangeIfAndElseStatementToBlock1() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5376,7 +5376,7 @@ public void testChangeIfAndElseStatementToBlock1() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5389,7 +5389,7 @@ public void testChangeIfAndElseStatementToBlock1() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5408,7 +5408,7 @@ public void testChangeIfAndElseStatementToBlock1() throws Exception { public void testChangeIfAndElseStatementToBlock2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5427,7 +5427,7 @@ public void testChangeIfAndElseStatementToBlock2() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5440,7 +5440,7 @@ public void testChangeIfAndElseStatementToBlock2() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5453,7 +5453,7 @@ public void testChangeIfAndElseStatementToBlock2() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5472,7 +5472,7 @@ public void testChangeIfAndElseStatementToBlock2() throws Exception { public void testChangeIfAndElseIfStatementToBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5495,7 +5495,7 @@ public void testChangeIfAndElseIfStatementToBlock() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5513,7 +5513,7 @@ public void testChangeIfAndElseIfStatementToBlock() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5530,7 +5530,7 @@ public void testChangeIfAndElseIfStatementToBlock() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5554,7 +5554,7 @@ public void testChangeIfAndElseIfStatementToBlock() throws Exception { public void testChangeIfAndElseIfStatementWithBlockToBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5577,7 +5577,7 @@ public void testChangeIfAndElseIfStatementWithBlockToBlock() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5595,7 +5595,7 @@ public void testChangeIfAndElseIfStatementWithBlockToBlock() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5612,7 +5612,7 @@ public void testChangeIfAndElseIfStatementWithBlockToBlock() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5636,7 +5636,7 @@ public void testChangeIfAndElseIfStatementWithBlockToBlock() throws Exception { public void testRemoveIfBlock01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5654,7 +5654,7 @@ public void testRemoveIfBlock01() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5664,7 +5664,7 @@ public void testRemoveIfBlock01() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5676,7 +5676,7 @@ public void testRemoveIfBlock01() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5685,7 +5685,7 @@ public void testRemoveIfBlock01() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5703,7 +5703,7 @@ public void testRemoveIfBlock01() throws Exception { public void testRemoveIfBlock02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5723,7 +5723,7 @@ public void testRemoveIfBlock02() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5735,7 +5735,7 @@ public void testRemoveIfBlock02() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5748,7 +5748,7 @@ public void testRemoveIfBlock02() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5760,7 +5760,7 @@ public void testRemoveIfBlock02() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5780,7 +5780,7 @@ public void testRemoveIfBlock02() throws Exception { public void testRemoveIfBlock03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5800,7 +5800,7 @@ public void testRemoveIfBlock03() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5812,7 +5812,7 @@ public void testRemoveIfBlock03() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5825,7 +5825,7 @@ public void testRemoveIfBlock03() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5844,7 +5844,7 @@ public void testRemoveIfBlock03() throws Exception { public void testRemoveIfBlock04() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -5864,7 +5864,7 @@ public void testRemoveIfBlock04() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -5876,7 +5876,7 @@ public void testRemoveIfBlock04() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -5889,7 +5889,7 @@ public void testRemoveIfBlock04() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -5901,7 +5901,7 @@ public void testRemoveIfBlock04() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -5918,7 +5918,7 @@ public void testRemoveIfBlock04() throws Exception { public void testRemoveIfBlockBug128843() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5940,7 +5940,7 @@ public void testRemoveIfBlockBug128843() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5955,7 +5955,7 @@ public void testRemoveIfBlockBug128843() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5969,7 +5969,7 @@ public void testRemoveIfBlockBug128843() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5983,7 +5983,7 @@ public void testRemoveIfBlockBug128843() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6005,7 +6005,7 @@ public void testRemoveIfBlockBug128843() throws Exception { public void testRemoveIfBlockBug138628() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6025,7 +6025,7 @@ public void testRemoveIfBlockBug138628() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6046,7 +6046,7 @@ public void testRemoveIfBlockBug138628() throws Exception { public void testRemoveIfBlockBug149990_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6068,7 +6068,7 @@ public void testRemoveIfBlockBug149990_1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6091,7 +6091,7 @@ public void testRemoveIfBlockBug149990_1() throws Exception { public void testRemoveIfBlockBug139675() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6114,7 +6114,7 @@ public void testRemoveIfBlockBug139675() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6130,7 +6130,7 @@ public void testRemoveIfBlockBug139675() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6145,7 +6145,7 @@ public void testRemoveIfBlockBug139675() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6170,7 +6170,7 @@ public void testRemoveIfBlockBug139675() throws Exception { public void testRemoveIfBlockBug149990_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6194,7 +6194,7 @@ public void testRemoveIfBlockBug149990_2() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6217,7 +6217,7 @@ public void testRemoveIfBlockBug149990_2() throws Exception { public void testRemoveWhileBlock01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6235,7 +6235,7 @@ public void testRemoveWhileBlock01() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6244,7 +6244,7 @@ public void testRemoveWhileBlock01() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6260,7 +6260,7 @@ public void testRemoveWhileBlock01() throws Exception { public void testRemoveForBlock01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6278,7 +6278,7 @@ public void testRemoveForBlock01() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6287,7 +6287,7 @@ public void testRemoveForBlock01() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6303,7 +6303,7 @@ public void testRemoveForBlock01() throws Exception { public void testRemoveDoBlock01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6321,7 +6321,7 @@ public void testRemoveDoBlock01() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6330,7 +6330,7 @@ public void testRemoveDoBlock01() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6345,7 +6345,7 @@ public void testRemoveDoBlock01() throws Exception { @Test public void testMakeFinal01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private int i= 0;\n"); @@ -6363,7 +6363,7 @@ public void testMakeFinal01() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private final int i= 0;\n"); @@ -6381,7 +6381,7 @@ public void testMakeFinal01() throws Exception { @Test public void testMakeFinal02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private final int i= 0;\n"); @@ -6406,7 +6406,7 @@ public void testMakeFinal02() throws Exception { @Test public void testMakeFinal03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public int i= 0;\n"); @@ -6423,7 +6423,7 @@ public void testMakeFinal03() throws Exception { assertNumberOfProposals(proposals, 1); assertProposalDoesNotExist(proposals, CHANGE_MODIFIER_TO_FINAL); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private int i= 0;\n"); @@ -6444,7 +6444,7 @@ public void testMakeFinal03() throws Exception { @Test public void testMakeFinal04() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -6463,7 +6463,7 @@ public void testMakeFinal04() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -6479,7 +6479,7 @@ public void testMakeFinal04() throws Exception { @Test public void testMakeFinal05() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private void foo(int i, int j) {\n"); @@ -6497,7 +6497,7 @@ public void testMakeFinal05() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private void foo(final int i, int j) {\n"); @@ -6667,7 +6667,7 @@ public void testMakeFinal11() throws Exception { @Test public void testMakeFinal12() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6687,7 +6687,7 @@ public void testMakeFinal12() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6704,7 +6704,7 @@ public void testMakeFinal12() throws Exception { @Test public void testMakeFinal13() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6724,7 +6724,7 @@ public void testMakeFinal13() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6738,7 +6738,7 @@ public void testMakeFinal13() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6757,7 +6757,7 @@ public void testMakeFinal13() throws Exception { @Test public void testMakeFinal14() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6777,7 +6777,7 @@ public void testMakeFinal14() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6790,7 +6790,7 @@ public void testMakeFinal14() throws Exception { buf.append("}\n"); String ex1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6809,7 +6809,7 @@ public void testMakeFinal14() throws Exception { @Test public void testMakeFinal15() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class E {\n"); @@ -6834,7 +6834,7 @@ public void testMakeFinal15() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class E {\n"); @@ -6881,7 +6881,7 @@ public void testMakeFinal16() throws Exception { @Test public void testMakeFinal17() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private int i= 0;\n"); @@ -6898,7 +6898,7 @@ public void testMakeFinal17() throws Exception { assertNumberOfProposals(proposals, 1); assertProposalDoesNotExist(proposals, CHANGE_MODIFIER_TO_FINAL); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" private int i= 0;\n"); @@ -6961,7 +6961,7 @@ public void testMakeFinal19() throws Exception { @Test public void testMakeFinalBug148373() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer i) {\n"); @@ -6977,7 +6977,7 @@ public void testMakeFinalBug148373() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo(final Integer i) {\n"); @@ -6988,7 +6988,7 @@ public void testMakeFinalBug148373() throws Exception { @Test public void testConvertAnonymousToNested1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public Object foo(final String name) {\n"); @@ -7008,7 +7008,7 @@ public void testConvertAnonymousToNested1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private final class RunnableImplementation implements Runnable {\n"); @@ -7036,7 +7036,7 @@ public void testConvertAnonymousToNested2() throws Exception { corePrefs.setValue(JavaCore.CODEASSIST_ARGUMENT_PREFIXES, "p"); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -7061,7 +7061,7 @@ public void testConvertAnonymousToNested2() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -7091,7 +7091,7 @@ public void testConvertAnonymousToNested2() throws Exception { @Test public void testConvertToStringBuffer1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7106,7 +7106,7 @@ public void testConvertToStringBuffer1() throws Exception { assertNumberOfProposals(proposals, 7); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7120,7 +7120,7 @@ public void testConvertToStringBuffer1() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7130,7 +7130,7 @@ public void testConvertToStringBuffer1() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7140,7 +7140,7 @@ public void testConvertToStringBuffer1() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" private static final String FOO = \"foo\";\n"); @@ -7151,7 +7151,7 @@ public void testConvertToStringBuffer1() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7160,7 +7160,7 @@ public void testConvertToStringBuffer1() throws Exception { buf.append("}\n"); String expected5= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7169,7 +7169,7 @@ public void testConvertToStringBuffer1() throws Exception { buf.append("}\n"); String expected6= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7184,7 +7184,7 @@ public void testConvertToStringBuffer1() throws Exception { @Test public void testConvertToStringBufferStringAndVar() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7200,7 +7200,7 @@ public void testConvertToStringBufferStringAndVar() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7220,7 +7220,7 @@ public void testConvertToStringBufferStringAndVar() throws Exception { @Test public void testConvertToStringBufferNoFixWithoutString() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7238,7 +7238,7 @@ public void testConvertToStringBufferNoFixWithoutString() throws Exception { @Test public void testConvertToStringBufferNoFixWithoutString2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7257,7 +7257,7 @@ public void testConvertToStringBufferNoFixWithoutString2() throws Exception { @Test public void testConvertToStringBufferNoFixOutsideMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" String strX = \"foo\"+\"bar\"\n"); @@ -7275,7 +7275,7 @@ public void testConvertToStringBufferNoFixOutsideMethod() throws Exception { @Test public void testConvertToStringBufferDupVarName() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7292,7 +7292,7 @@ public void testConvertToStringBufferDupVarName() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7312,7 +7312,7 @@ public void testConvertToStringBufferDupVarName() throws Exception { @Test public void testConvertToStringBufferInIfStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7327,7 +7327,7 @@ public void testConvertToStringBufferInIfStatement() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7347,7 +7347,7 @@ public void testConvertToStringBufferInIfStatement() throws Exception { @Test public void testConvertToStringBufferAsParamter() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7361,7 +7361,7 @@ public void testConvertToStringBufferAsParamter() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7385,7 +7385,7 @@ public void testConvertToStringBufferJava14() throws Exception { try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7399,7 +7399,7 @@ public void testConvertToStringBufferJava14() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7419,7 +7419,7 @@ public void testConvertToStringBufferJava14() throws Exception { @Test public void testConvertToStringBufferExisting1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7434,7 +7434,7 @@ public void testConvertToStringBufferExisting1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7450,7 +7450,7 @@ public void testConvertToStringBufferExisting1() throws Exception { @Test public void testConvertToStringBufferExisting2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7465,7 +7465,7 @@ public void testConvertToStringBufferExisting2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7489,7 +7489,7 @@ public void testConvertToMessageFormat14() throws Exception { try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7503,7 +7503,7 @@ public void testConvertToMessageFormat14() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.text.MessageFormat;\n"); @@ -7525,7 +7525,7 @@ public void testConvertToMessageFormat14() throws Exception { public void testConvertToMessageFormatStringConcat() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7551,7 +7551,7 @@ public void testConvertToMessageFormatStringBoxing14() throws Exception { try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7565,7 +7565,7 @@ public void testConvertToMessageFormatStringBoxing14() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.text.MessageFormat;\n"); @@ -7585,7 +7585,7 @@ public void testConvertToMessageFormatStringBoxing14() throws Exception { @Test public void testConvertToMessageFormatStringBoxing15() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7599,7 +7599,7 @@ public void testConvertToMessageFormatStringBoxing15() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.text.MessageFormat;\n"); @@ -7617,7 +7617,7 @@ public void testConvertToMessageFormatStringBoxing15() throws Exception { public void testConvertToMessageFormat15() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7631,7 +7631,7 @@ public void testConvertToMessageFormat15() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.text.MessageFormat;\n"); @@ -7649,7 +7649,7 @@ public void testConvertToMessageFormat15() throws Exception { public void testConvertToMessageFormatApostrophe() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7663,7 +7663,7 @@ public void testConvertToMessageFormatApostrophe() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.text.MessageFormat;\n"); @@ -7680,7 +7680,7 @@ public void testConvertToMessageFormatApostrophe() throws Exception { @Test public void testConvertToMessageFormatExtendedOperands() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7694,7 +7694,7 @@ public void testConvertToMessageFormatExtendedOperands() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.text.MessageFormat;\n"); @@ -7718,7 +7718,7 @@ public void testConvertToStringFormat14() throws Exception { try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7742,7 +7742,7 @@ public void testConvertToStringFormat14() throws Exception { public void testConvertToStringFormatStringConcat() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7763,7 +7763,7 @@ public void testConvertToStringFormatStringConcat() throws Exception { public void testConvertToStringFormat() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7777,7 +7777,7 @@ public void testConvertToStringFormat() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo(Object o1, Object o2) {\n"); @@ -7791,7 +7791,7 @@ public void testConvertToStringFormat() throws Exception { @Test public void testConvertToStringFormatExtendedOperands() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7805,7 +7805,7 @@ public void testConvertToStringFormatExtendedOperands() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -7820,7 +7820,7 @@ public void testConvertToStringFormatExtendedOperands() throws Exception { public void testConvertToStringFormatPrimitives() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public String foo(byte b, short s, int i, long l, float f, double d, boolean bb, char c) {\n"); @@ -7839,7 +7839,7 @@ public void testConvertToStringFormatPrimitives() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public String foo(byte b, short s, int i, long l, float f, double d, boolean bb, char c) {\n"); @@ -7856,7 +7856,7 @@ public void testConvertToStringFormatPrimitives() throws Exception { @Test public void testMissingEnumConstantsInCase1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7879,7 +7879,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7897,7 +7897,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7921,7 +7921,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7940,7 +7940,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { @Test public void testMissingEnumConstantsInCase2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7965,7 +7965,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7985,7 +7985,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8009,7 +8009,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8030,7 +8030,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { @Test public void testMissingEnumConstantsInCase3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8055,7 +8055,7 @@ public void testMissingEnumConstantsInCase3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8075,7 +8075,7 @@ public void testMissingEnumConstantsInCase3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8105,7 +8105,7 @@ public void testMissingEnumConstantsInCase3() throws Exception { @Test public void testMissingEnumConstantsInCase4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8132,7 +8132,7 @@ public void testMissingEnumConstantsInCase4() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8161,7 +8161,7 @@ public void testMissingEnumConstantsInCase4() throws Exception { public void testMissingEnumConstantsInCase5() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=372840 IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8190,7 +8190,7 @@ public void testMissingEnumConstantsInCase5() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8214,7 +8214,7 @@ public void testMissingEnumConstantsInCase5() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -8237,7 +8237,7 @@ public void testMissingEnumConstantsInCase5() throws Exception { @Test public void testConvertEnhancedForArray01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void main(String... args) {\n"); @@ -8255,7 +8255,7 @@ public void testConvertEnhancedForArray01() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void main(String... args) {\n"); @@ -8267,7 +8267,7 @@ public void testConvertEnhancedForArray01() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void main(String... args) {\n"); @@ -8276,7 +8276,7 @@ public void testConvertEnhancedForArray01() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void main(String... args) {\n"); @@ -8292,7 +8292,7 @@ public void testConvertEnhancedForArray01() throws Exception { @Test public void testConvertEnhancedForArray02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int[][][] ints) {\n"); @@ -8315,7 +8315,7 @@ public void testConvertEnhancedForArray02() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int[][][] ints) {\n"); @@ -8333,7 +8333,7 @@ public void testConvertEnhancedForArray02() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int[][][] ints) {\n"); @@ -8353,7 +8353,7 @@ public void testConvertEnhancedForArray02() throws Exception { @Test public void testConvertEnhancedForList01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("import java.util.List;\n"); @@ -8376,7 +8376,7 @@ public void testConvertEnhancedForList01() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("import java.util.List;\n"); @@ -8394,7 +8394,7 @@ public void testConvertEnhancedForList01() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("import java.util.Iterator;\n"); @@ -8413,7 +8413,7 @@ public void testConvertEnhancedForList01() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("import java.util.List;\n"); @@ -8427,7 +8427,7 @@ public void testConvertEnhancedForList01() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("import java.util.List;\n"); @@ -8448,7 +8448,7 @@ public void testConvertEnhancedForList01() throws Exception { @Test public void testConvertEnhancedForCollection01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.List;\n"); @@ -8470,7 +8470,7 @@ public void testConvertEnhancedForCollection01() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -8488,7 +8488,7 @@ public void testConvertEnhancedForCollection01() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.List;\n"); @@ -8501,7 +8501,7 @@ public void testConvertEnhancedForCollection01() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.List;\n"); @@ -8521,7 +8521,7 @@ public void testConvertEnhancedForCollection01() throws Exception { @Test public void testGenerateForSimple() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -8544,7 +8544,7 @@ public void testGenerateForSimple() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -8556,7 +8556,7 @@ public void testGenerateForSimple() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -8580,7 +8580,7 @@ public void testGenerateForSimple() throws Exception { @Test public void testGenerateForWithSemicolon() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -8603,7 +8603,7 @@ public void testGenerateForWithSemicolon() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -8615,7 +8615,7 @@ public void testGenerateForWithSemicolon() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -8639,7 +8639,7 @@ public void testGenerateForWithSemicolon() throws Exception { @Test public void testGenerateForMethodInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -8662,7 +8662,7 @@ public void testGenerateForMethodInvocation() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -8674,7 +8674,7 @@ public void testGenerateForMethodInvocation() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Map;\n"); @@ -8698,7 +8698,7 @@ public void testGenerateForMethodInvocation() throws Exception { @Test public void testGenerateForComplexParametrization() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.LinkedList;\n"); buf.append("public class E {\n"); @@ -8724,7 +8724,7 @@ public void testGenerateForComplexParametrization() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.LinkedList;\n"); buf.append("public class E {\n"); @@ -8738,7 +8738,7 @@ public void testGenerateForComplexParametrization() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.LinkedList;\n"); @@ -8755,7 +8755,7 @@ public void testGenerateForComplexParametrization() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.LinkedList;\n"); buf.append("public class E {\n"); @@ -8779,7 +8779,7 @@ public void testGenerateForComplexParametrization() throws Exception { @Test public void testGenerateForGenerics() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Date;\n"); @@ -8803,7 +8803,7 @@ public void testGenerateForGenerics() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Date;\n"); @@ -8816,7 +8816,7 @@ public void testGenerateForGenerics() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Date;\n"); @@ -8840,7 +8840,7 @@ public void testGenerateForGenerics() throws Exception { @Test public void testGenerateForComplexGenerics() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -8866,7 +8866,7 @@ public void testGenerateForComplexGenerics() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -8881,7 +8881,7 @@ public void testGenerateForComplexGenerics() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.List;\n"); @@ -8908,7 +8908,7 @@ public void testGenerateForComplexGenerics() throws Exception { @Test public void testGenerateForUpperboundWildcard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.List;\n"); @@ -8932,7 +8932,7 @@ public void testGenerateForUpperboundWildcard() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.List;\n"); @@ -8945,7 +8945,7 @@ public void testGenerateForUpperboundWildcard() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.Iterator;\n"); @@ -8961,7 +8961,7 @@ public void testGenerateForUpperboundWildcard() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.List;\n"); @@ -8984,7 +8984,7 @@ public void testGenerateForUpperboundWildcard() throws Exception { @Test public void testGenerateForLowerboundWildcard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.List;\n"); @@ -9008,7 +9008,7 @@ public void testGenerateForLowerboundWildcard() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.List;\n"); @@ -9021,7 +9021,7 @@ public void testGenerateForLowerboundWildcard() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.Iterator;\n"); @@ -9037,7 +9037,7 @@ public void testGenerateForLowerboundWildcard() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Date;\n"); buf.append("import java.util.List;\n"); @@ -9060,7 +9060,7 @@ public void testGenerateForLowerboundWildcard() throws Exception { @Test public void testGenerateForComplexInnerLowerboundWildcard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -9087,7 +9087,7 @@ public void testGenerateForComplexInnerLowerboundWildcard() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -9103,7 +9103,7 @@ public void testGenerateForComplexInnerLowerboundWildcard() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.List;\n"); @@ -9131,7 +9131,7 @@ public void testGenerateForComplexInnerLowerboundWildcard() throws Exception { @Test public void testGenerateForMissingParametrization() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9154,7 +9154,7 @@ public void testGenerateForMissingParametrization() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9166,7 +9166,7 @@ public void testGenerateForMissingParametrization() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -9189,7 +9189,7 @@ public void testGenerateForMissingParametrization() throws Exception { @Test public void testGenerateForLowVersion() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9217,7 +9217,7 @@ public void testGenerateForLowVersion() throws Exception { String[] expected= new String[1]; // no generics should be added to iterator since the version is too low - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -9240,7 +9240,7 @@ public void testGenerateForLowVersion() throws Exception { @Test public void testGenerateForArray() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(String[] array) {\n"); @@ -9262,7 +9262,7 @@ public void testGenerateForArray() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(String[] array) {\n"); @@ -9274,7 +9274,7 @@ public void testGenerateForArray() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(String[] array) {\n"); @@ -9294,7 +9294,7 @@ public void testGenerateForArray() throws Exception { @Test public void testGenerateForMultiDimensionalArray() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(String[][] array) {\n"); @@ -9316,7 +9316,7 @@ public void testGenerateForMultiDimensionalArray() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(String[][] array) {\n"); @@ -9328,7 +9328,7 @@ public void testGenerateForMultiDimensionalArray() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(String[][] array) {\n"); @@ -9348,7 +9348,7 @@ public void testGenerateForMultiDimensionalArray() throws Exception { @Test public void testGenerateForNameClash() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] nums;\n"); @@ -9371,7 +9371,7 @@ public void testGenerateForNameClash() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] nums;\n"); @@ -9384,7 +9384,7 @@ public void testGenerateForNameClash() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] nums;\n"); @@ -9405,7 +9405,7 @@ public void testGenerateForNameClash() throws Exception { @Test public void testGenerateForImportsAndFormat1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" class Iterator {}\n"); @@ -9446,7 +9446,7 @@ public void testGenerateForImportsAndFormat1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Date;\n"); @@ -9461,7 +9461,7 @@ public void testGenerateForImportsAndFormat1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Date;\n"); @@ -9478,7 +9478,7 @@ public void testGenerateForImportsAndFormat1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Date;\n"); @@ -9503,7 +9503,7 @@ public void testGenerateForImportsAndFormat1() throws Exception { @Test public void testGenerateForImportsAndFormat2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" class Object {}\n"); @@ -9545,7 +9545,7 @@ public void testGenerateForImportsAndFormat2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" class Object {}\n"); @@ -9558,7 +9558,7 @@ public void testGenerateForImportsAndFormat2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" class Object {}\n"); @@ -9582,7 +9582,7 @@ public void testGenerateForImportsAndFormat2() throws Exception { @Test public void testGenerateForImportsArray() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" class Date {}\n"); @@ -9618,7 +9618,7 @@ public void testGenerateForImportsArray() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" class Date {}\n"); @@ -9638,7 +9638,7 @@ public void testGenerateForImportsArray() throws Exception { @Test public void testGenerateForQualified() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9661,7 +9661,7 @@ public void testGenerateForQualified() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9674,7 +9674,7 @@ public void testGenerateForQualified() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Create enhanced 'for' loop", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -9698,7 +9698,7 @@ public void testGenerateForQualified() throws Exception { @Test public void testGenerateForThis() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9721,7 +9721,7 @@ public void testGenerateForThis() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -9734,7 +9734,7 @@ public void testGenerateForThis() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Create enhanced 'for' loop", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -9759,7 +9759,7 @@ public void testGenerateForThis() throws Exception { @Test public void testConvertQualifiedNameToStaticImport() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" static String str;\n"); @@ -9767,7 +9767,7 @@ public void testConvertQualifiedNameToStaticImport() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("T.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class S {\n"); buf.append(" {\n"); @@ -9817,7 +9817,7 @@ public void testConvertQualifiedNameToStaticImport() throws Exception { @Test public void testConvertMethodInvocationWithTypeToStaticImport() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" static String str;\n"); @@ -9825,7 +9825,7 @@ public void testConvertMethodInvocationWithTypeToStaticImport() throws Exception buf.append("}\n"); pack1.createCompilationUnit("T.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class S {\n"); buf.append(" {\n"); @@ -9843,7 +9843,7 @@ public void testConvertMethodInvocationWithTypeToStaticImport() throws Exception assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - StringBuffer expectation= new StringBuffer(); + StringBuilder expectation= new StringBuilder(); expectation.append("package test1;\n"); expectation.append("\n"); expectation.append("import static test1.T.doIt;\n"); @@ -9856,7 +9856,7 @@ public void testConvertMethodInvocationWithTypeToStaticImport() throws Exception expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test1;\n"); expectation.append("\n"); expectation.append("import static test1.T.doIt;\n"); @@ -9882,14 +9882,14 @@ public void testConvertMethodInvocationWithTypeToStaticImport() throws Exception @Test public void testConvertConstantToStaticImport() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static final String FOO = \"BAR\";\n"); buf.append("}\n"); pack1.createCompilationUnit("T.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class S {\n"); buf.append(" {\n"); @@ -9970,7 +9970,7 @@ public void testConvertToStaticImportDoesNotAddImportWhenInScope() throws Except @Test public void testConvertToStaticImportDoesRemoveUnusedImport() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static final String FOO = \"BAR\";\n"); @@ -9978,7 +9978,7 @@ public void testConvertToStaticImportDoesRemoveUnusedImport() throws Exception { pack1.createCompilationUnit("T.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.T\n"); buf.append("public class S {\n"); @@ -9996,7 +9996,7 @@ public void testConvertToStaticImportDoesRemoveUnusedImport() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - StringBuffer expectation= new StringBuffer(); + StringBuilder expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("public class S {\n"); @@ -10006,7 +10006,7 @@ public void testConvertToStaticImportDoesRemoveUnusedImport() throws Exception { expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("public class S {\n"); @@ -10029,7 +10029,7 @@ public void testConvertToStaticImportDoesRemoveUnusedImport() throws Exception { @Test public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferentReferenceType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static final String FOO = \"BAR\";\n"); @@ -10038,7 +10038,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferent pack1.createCompilationUnit("T.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.T\n"); buf.append("public class S {\n"); @@ -10057,7 +10057,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferent assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - StringBuffer expectation= new StringBuffer(); + StringBuilder expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("\n"); @@ -10070,7 +10070,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferent expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("\n"); @@ -10091,7 +10091,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferent assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.bar;\n"); expectation.append("\n"); @@ -10104,7 +10104,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferent expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.bar;\n"); expectation.append("\n"); @@ -10130,7 +10130,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedByDifferent @Test public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameReferenceType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static final String FOO = \"BAR\";\n"); @@ -10139,7 +10139,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer pack1.createCompilationUnit("T.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.T\n"); buf.append("public class S {\n"); @@ -10158,7 +10158,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - StringBuffer expectation= new StringBuffer(); + StringBuilder expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("\n"); @@ -10171,7 +10171,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("\n"); @@ -10194,7 +10194,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer assertProposalDoesNotExist(proposals, "Convert to static import (replace all occurrences)"); IPackageFragment pack3= fSourceFolder.createPackageFragment("test3", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import test1.T\n"); buf.append("public class G {\n"); @@ -10213,7 +10213,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test3;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("\n"); @@ -10226,7 +10226,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test3;\n"); expectation.append("import static test1.T.FOO;\n"); expectation.append("public class G {\n"); @@ -10250,7 +10250,7 @@ public void testConvertToStaticImportDoesntRemoveImportWhenReferencedBySameRefer @Test public void testCanConvertToStaticImportWhenClassContainsMethodInvocationWithoutExpression() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static String bar() { return \"\"; };\n"); @@ -10258,7 +10258,7 @@ public void testCanConvertToStaticImportWhenClassContainsMethodInvocationWithout pack1.createCompilationUnit("T.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import static test1.T.bar;\n"); buf.append("\n"); @@ -10280,7 +10280,7 @@ public void testCanConvertToStaticImportWhenClassContainsMethodInvocationWithout assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - StringBuffer expectation= new StringBuffer(); + StringBuilder expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.bar;\n"); expectation.append("\n"); @@ -10294,7 +10294,7 @@ public void testCanConvertToStaticImportWhenClassContainsMethodInvocationWithout expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("import static test1.T.bar;\n"); expectation.append("public class S {\n"); @@ -10319,7 +10319,7 @@ public void testCanConvertToStaticImportWhenClassContainsMethodInvocationWithout @Test public void testDoesntRemoveImportWithReferenceFromClassInstanceCreation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static void foo() { };\n"); @@ -10328,7 +10328,7 @@ public void testDoesntRemoveImportWithReferenceFromClassInstanceCreation() throw pack1.createCompilationUnit("T.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("import test1.T;\n"); @@ -10350,7 +10350,7 @@ public void testDoesntRemoveImportWithReferenceFromClassInstanceCreation() throw assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - StringBuffer expectation= new StringBuffer(); + StringBuilder expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("\n"); expectation.append("import static test1.T.foo;\n"); @@ -10366,7 +10366,7 @@ public void testDoesntRemoveImportWithReferenceFromClassInstanceCreation() throw expectation.append("}\n"); assertProposalPreviewEquals(expectation.toString(), "Convert to static import", proposals); - expectation= new StringBuffer(); + expectation= new StringBuilder(); expectation.append("package test2;\n"); expectation.append("\n"); expectation.append("import static test1.T.foo;\n"); @@ -10386,7 +10386,7 @@ public void testDoesntRemoveImportWithReferenceFromClassInstanceCreation() throw @Test public void testDoesntOfferConvertToStaticImportForImportDeclarations() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class T {\n"); buf.append(" public static int bar = 1;\n"); @@ -10395,7 +10395,7 @@ public void testDoesntOfferConvertToStaticImportForImportDeclarations() throws E pack1.createCompilationUnit("T.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("import static test1.T.bar;\n"); @@ -10451,7 +10451,7 @@ public void testCreateJUnitTestCase() throws Exception { public void testAssignParameterInnerStatic() throws Exception { // assign parameter to field inside inner static nested class, https://bugs.eclipse.org/bugs/show_bug.cgi?id=539476 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int value;\n"); @@ -10475,7 +10475,7 @@ public void testAssignParameterInnerStatic() throws Exception { List proposals= collectAssists(context, false); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int value;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest10.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest10.java index 98ada535595..5b0800e05ba 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest10.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest10.java @@ -99,14 +99,14 @@ public void tearDown() throws Exception { @Test public void testChangeVarTypeToBindingTypeProposal() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" {\n"); @@ -124,7 +124,7 @@ public void testChangeVarTypeToBindingTypeProposal() throws Exception { assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" {\n"); @@ -136,14 +136,14 @@ public void testChangeVarTypeToBindingTypeProposal() throws Exception { @Test public void testChangeTypeToVarTypeProposal() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" {\n"); @@ -161,7 +161,7 @@ public void testChangeTypeToVarTypeProposal() throws Exception { assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" {\n"); @@ -174,14 +174,14 @@ public void testChangeTypeToVarTypeProposal() throws Exception { @Test public void testChangeVarTypeToBindingTypeProposalWithTypeAnnotation() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n\n"); @@ -204,7 +204,7 @@ public void testChangeVarTypeToBindingTypeProposalWithTypeAnnotation() throws Ex assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n\n"); @@ -221,14 +221,14 @@ public void testChangeVarTypeToBindingTypeProposalWithTypeAnnotation() throws Ex @Test public void testChangeTypeToVarTypeProposalWithoutTypeAnnotation() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n\n"); @@ -251,7 +251,7 @@ public void testChangeTypeToVarTypeProposalWithoutTypeAnnotation() throws Except assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n\n"); @@ -269,14 +269,14 @@ public void testChangeTypeToVarTypeProposalWithoutTypeAnnotation() throws Except @Test public void testChangeVarToTypeNoTypeChangeProposal() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" {\n"); @@ -308,14 +308,14 @@ public void testChangeVarToTypeNoTypeChangeProposal() throws Exception { @Test public void testChangeTypeToVarChangeProposalRemoveUnusedImport() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.List;\n\n"); buf.append("public class Second {\n"); @@ -326,7 +326,7 @@ public void testChangeTypeToVarChangeProposalRemoveUnusedImport() throws Excepti pack.createCompilationUnit("Second.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.List;\n\n"); buf.append("public class Cls {\n"); @@ -345,7 +345,7 @@ public void testChangeTypeToVarChangeProposalRemoveUnusedImport() throws Excepti assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("public class Cls {\n"); buf.append(" {\n"); @@ -357,14 +357,14 @@ public void testChangeTypeToVarChangeProposalRemoveUnusedImport() throws Excepti @Test public void testChangeTypeToVarChangeProposalDonotRemoveUsedImport() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.List;\n\n"); buf.append("public class Second {\n"); @@ -375,7 +375,7 @@ public void testChangeTypeToVarChangeProposalDonotRemoveUsedImport() throws Exce pack.createCompilationUnit("Second.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.List;\n\n"); buf.append("public class Cls {\n"); @@ -395,7 +395,7 @@ public void testChangeTypeToVarChangeProposalDonotRemoveUsedImport() throws Exce assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.List;\n\n"); buf.append("public class Cls {\n"); @@ -409,14 +409,14 @@ public void testChangeTypeToVarChangeProposalDonotRemoveUsedImport() throws Exce @Test public void testChangeParametrizedTypeToVarTypeProposalDoesNotLoseTypeArguments() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.ArrayList;\n\n"); buf.append("public class Cls {\n"); @@ -435,7 +435,7 @@ public void testChangeParametrizedTypeToVarTypeProposalDoesNotLoseTypeArguments( assertNumberOfProposals(proposals, 1); String preview= getPreviewContent((TypeChangeCorrectionProposal) proposals.get(0)); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("import java.util.ArrayList;\n\n"); buf.append("public class Cls {\n"); @@ -449,14 +449,14 @@ public void testChangeParametrizedTypeToVarTypeProposalDoesNotLoseTypeArguments( @Test public void testConvertToForUsingIndexWithVar() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("public class Cls {\n"); buf.append(" public void foo() {\n"); @@ -473,7 +473,7 @@ public void testConvertToForUsingIndexWithVar() throws Exception { assertNoErrors(context); List proposals= getExpectedProposals(collectAssists(context, false), LINKED_PROPOSAL_TYPE); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n\n"); buf.append("public class Cls {\n"); buf.append(" public void foo() {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest12.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest12.java index 2643dc7072d..272b029a7a8 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest12.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest12.java @@ -61,14 +61,14 @@ public void testSplitSwitchCaseStatement() throws Exception { JavaProjectHelper.set12CompilerOptions(fJProject1, true); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public static void foo(Day day) {\n"); @@ -93,7 +93,7 @@ public void testSplitSwitchCaseStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public static void foo(Day day) {\n"); @@ -127,14 +127,14 @@ public void testSplitSwitchCaseLabelRuleStatement() throws Exception { JavaProjectHelper.set12CompilerOptions(fJProject1, true); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public static void foo(Day day) {\n"); @@ -157,7 +157,7 @@ public void testSplitSwitchCaseLabelRuleStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public static void foo(Day day) {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest14.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest14.java index 1fb65b6a37f..eecb9b93156 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest14.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest14.java @@ -64,14 +64,14 @@ public void testConvertToSwitchExpression1() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(Day day) {\n"); @@ -105,8 +105,8 @@ public void testConvertToSwitchExpression1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); - buf= new StringBuffer(); + buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(Day day) {\n"); @@ -136,14 +136,14 @@ public void testConvertToSwitchExpression2() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(Day day) {\n"); @@ -178,8 +178,8 @@ public void testConvertToSwitchExpression2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); - buf= new StringBuffer(); + buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(Day day) {\n"); @@ -215,14 +215,14 @@ public void testConvertToSwitchExpression3() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" static int i;\n"); @@ -256,8 +256,8 @@ public void testConvertToSwitchExpression3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); - buf= new StringBuffer(); + buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" static int i;\n"); @@ -289,14 +289,14 @@ public void testConvertToSwitchExpression4() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(int j, int k) {\n"); @@ -326,8 +326,8 @@ public void testConvertToSwitchExpression4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); - buf= new StringBuffer(); + buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(int j, int k) {\n"); @@ -356,14 +356,14 @@ public void testNoConvertToSwitchExpression1() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" static int i;\n"); @@ -400,14 +400,14 @@ public void testNoConvertToSwitchExpression2() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(int k) {\n"); @@ -445,14 +445,14 @@ public void testNoConvertToSwitchExpression3() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(int k) {\n"); @@ -490,14 +490,14 @@ public void testNoConvertToSwitchExpression4() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(int k) {\n"); @@ -535,14 +535,14 @@ public void testNoConvertToSwitchExpression5() throws Exception { JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Cls {\n"); buf.append(" public int foo(int k) {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d7.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d7.java index 92a8efcfab4..c819fcd8c2b 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d7.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d7.java @@ -99,7 +99,7 @@ public void tearDown() throws Exception { @Test public void testConvertToMultiCatch1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -121,7 +121,7 @@ public void testConvertToMultiCatch1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -140,7 +140,7 @@ public void testConvertToMultiCatch1() throws Exception { @Test public void testConvertToMultiCatch2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -162,7 +162,7 @@ public void testConvertToMultiCatch2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -182,7 +182,7 @@ public void testConvertToMultiCatch2() throws Exception { @Test public void testConvertToMultiCatch3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -205,7 +205,7 @@ public void testConvertToMultiCatch3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -307,7 +307,7 @@ public void testConvertToMultiCatch6() throws Exception { @Test public void testUnrollMultiCatch1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -327,7 +327,7 @@ public void testUnrollMultiCatch1() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -348,7 +348,7 @@ public void testUnrollMultiCatch1() throws Exception { @Test public void testUnrollMultiCatch2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -370,7 +370,7 @@ public void testUnrollMultiCatch2() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -393,7 +393,7 @@ public void testUnrollMultiCatch2() throws Exception { @Test public void testUnrollMultiCatch3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -415,7 +415,7 @@ public void testUnrollMultiCatch3() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -438,7 +438,7 @@ public void testUnrollMultiCatch3() throws Exception { @Test public void testUnrollMultiCatch4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -462,7 +462,7 @@ public void testUnrollMultiCatch4() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -512,7 +512,7 @@ public void testUnrollMultiCatch5() throws Exception { public void testUnrollMultiCatch6() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=350285#c12 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -535,7 +535,7 @@ public void testUnrollMultiCatch6() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -565,7 +565,7 @@ public void testUnrollMultiCatch6() throws Exception { @Test public void testReplaceMultiCatchClauseWithThrows1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -584,7 +584,7 @@ public void testReplaceMultiCatchClauseWithThrows1() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() throws IllegalArgumentException, NullPointerException {\n"); @@ -593,7 +593,7 @@ public void testReplaceMultiCatchClauseWithThrows1() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -636,7 +636,7 @@ public void testReplaceMultiCatchClauseWithThrows2() throws Exception { @Test public void testReplaceMultiCatchClauseWithThrows3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -655,7 +655,7 @@ public void testReplaceMultiCatchClauseWithThrows3() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -667,7 +667,7 @@ public void testReplaceMultiCatchClauseWithThrows3() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() throws IllegalArgumentException {\n"); @@ -679,7 +679,7 @@ public void testReplaceMultiCatchClauseWithThrows3() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -698,7 +698,7 @@ public void testReplaceMultiCatchClauseWithThrows3() throws Exception { @Test public void testReplaceMultiCatchClauseWithThrows4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -721,7 +721,7 @@ public void testReplaceMultiCatchClauseWithThrows4() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -737,7 +737,7 @@ public void testReplaceMultiCatchClauseWithThrows4() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -753,7 +753,7 @@ public void testReplaceMultiCatchClauseWithThrows4() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -777,7 +777,7 @@ public void testReplaceMultiCatchClauseWithThrows4() throws Exception { @Test public void testPickoutTypeFromMulticatch1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -802,7 +802,7 @@ public void testPickoutTypeFromMulticatch1() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -812,7 +812,7 @@ public void testPickoutTypeFromMulticatch1() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -822,7 +822,7 @@ public void testPickoutTypeFromMulticatch1() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -839,7 +839,7 @@ public void testPickoutTypeFromMulticatch1() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -869,7 +869,7 @@ public void testPickoutTypeFromMulticatch1() throws Exception { @Test public void testPickoutTypeFromMulticatch2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -893,7 +893,7 @@ public void testPickoutTypeFromMulticatch2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -909,7 +909,7 @@ public void testPickoutTypeFromMulticatch2() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -925,7 +925,7 @@ public void testPickoutTypeFromMulticatch2() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.InvocationTargetException;\n"); buf.append("public class E {\n"); @@ -1004,7 +1004,7 @@ public void testUnwrapTryStatement() throws Exception { public void testInferDiamondArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashMap;\n"); buf.append("import java.util.Map;\n"); @@ -1025,7 +1025,7 @@ public void testInferDiamondArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashMap;\n"); buf.append("import java.util.Map;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d8.java index 80676e15b48..2ab494ceacd 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest1d8.java @@ -145,7 +145,7 @@ public void testAssignParamToField2() throws Exception { @Test public void testConvertToLambda1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -172,7 +172,7 @@ public void testConvertToLambda1() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -195,7 +195,7 @@ public void testConvertToLambda1() throws Exception { @Test public void testConvertToLambda2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method(int a, int b);\n"); @@ -222,7 +222,7 @@ public void testConvertToLambda2() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method(int a, int b);\n"); @@ -407,7 +407,7 @@ public void testConvertToLambda7() throws Exception { @Test public void testConvertToLambda8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -433,7 +433,7 @@ public void testConvertToLambda8() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -453,7 +453,7 @@ public void testConvertToLambda8() throws Exception { @Test public void testConvertToLambda9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int method();\n"); @@ -479,7 +479,7 @@ public void testConvertToLambda9() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int method();\n"); @@ -499,7 +499,7 @@ public void testConvertToLambda9() throws Exception { @Test public void testConvertToLambda10() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int foo(String s);\n"); @@ -533,7 +533,7 @@ public void testConvertToLambda10() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int foo(String s);\n"); @@ -560,7 +560,7 @@ public void testConvertToLambda10() throws Exception { @Test public void testConvertToLambda11() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int foo(String s);\n"); @@ -595,7 +595,7 @@ public void testConvertToLambda11() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int foo(String s);\n"); @@ -623,7 +623,7 @@ public void testConvertToLambda11() throws Exception { @Test public void testConvertToLambda12() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int foo(String s);\n"); @@ -658,7 +658,7 @@ public void testConvertToLambda12() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int foo(String s);\n"); @@ -714,7 +714,7 @@ public void testConvertToLambda13() throws Exception { @Test public void testConvertToLambda14() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface FI {\n"); @@ -743,7 +743,7 @@ public void testConvertToLambda14() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface FI {\n"); @@ -765,7 +765,7 @@ public void testConvertToLambda14() throws Exception { @Test public void testConvertToLambda15() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface FI {\n"); @@ -794,7 +794,7 @@ public void testConvertToLambda15() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface FI {\n"); @@ -818,7 +818,7 @@ public void testConvertToLambda15() throws Exception { @Test public void testConvertToLambda16() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface FI {\n"); buf.append(" void foo();\n"); @@ -846,7 +846,7 @@ public void testConvertToLambda16() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface FI {\n"); buf.append(" void foo();\n"); @@ -869,7 +869,7 @@ public void testConvertToLambda16() throws Exception { @Test public void testConvertToLambda17() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface X {\n"); buf.append(" void foo();\n"); @@ -896,7 +896,7 @@ public void testConvertToLambda17() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface X {\n"); buf.append(" void foo();\n"); @@ -918,7 +918,7 @@ public void testConvertToLambda17() throws Exception { @Test public void testConvertToLambda18() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface FIOther {\n"); buf.append(" void run(int x);\n"); @@ -950,7 +950,7 @@ public void testConvertToLambda18() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface FIOther {\n"); buf.append(" void run(int x);\n"); @@ -1002,7 +1002,7 @@ public void testConvertToLambda19() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("public class C1 {\n"); buf1.append(" Runnable r1 = () -> {\n"); @@ -1026,7 +1026,7 @@ public void testConvertToLambda19() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("public class C1 {\n"); buf1.append(" Runnable r1 = new/*[1]*/ Runnable() {\n"); @@ -1046,7 +1046,7 @@ public void testConvertToLambda19() throws Exception { @Test public void testConvertToLambda20() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class C1 {\n"); buf.append(" FI fi= new FI() {\n"); @@ -1069,7 +1069,7 @@ public void testConvertToLambda20() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class C1 {\n"); buf.append(" FI fi= (@A String... strs) -> {\n"); @@ -1087,7 +1087,7 @@ public void testConvertToLambda20() throws Exception { @Test public void testConvertToLambda21() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1115,7 +1115,7 @@ public void testConvertToLambda21() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1179,7 +1179,7 @@ public void testConvertToLambda22() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("import java.io.IOException;\n"); buf1.append("import java.lang.annotation.ElementType;\n"); @@ -1219,7 +1219,7 @@ public void testConvertToLambda22() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("import java.io.IOException;\n"); buf1.append("import java.lang.annotation.ElementType;\n"); @@ -1259,7 +1259,7 @@ public void testConvertToLambda22() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("import java.io.IOException;\n"); buf1.append("import java.lang.annotation.ElementType;\n"); @@ -1326,7 +1326,7 @@ public void testConvertToLambda23() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("import java.lang.annotation.ElementType;\n"); buf1.append("import java.lang.annotation.Target;\n"); @@ -1356,7 +1356,7 @@ public void testConvertToLambda23() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test;\n"); buf1.append("import java.lang.annotation.ElementType;\n"); buf1.append("import java.lang.annotation.Target;\n"); @@ -1382,7 +1382,7 @@ public void testConvertToLambda23() throws Exception { @Test public void testConvertToLambda24() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n"); @@ -1408,7 +1408,7 @@ public void testConvertToLambda24() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n"); @@ -1473,7 +1473,7 @@ public void testConvertToLambda26() throws Exception { @Test public void testConvertToLambda27() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI {\n"); @@ -1506,7 +1506,7 @@ public void testConvertToLambda27() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI {\n"); @@ -1602,7 +1602,7 @@ public void testConvertToLambda29() throws Exception { @Test public void testConvertToLambdaAmbiguousOverridden() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.function.Predicate;\n"); @@ -1627,7 +1627,7 @@ public void testConvertToLambdaAmbiguousOverridden() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -1644,7 +1644,7 @@ public void testConvertToLambdaAmbiguousOverridden() throws Exception { @Test public void testConvertToAnonymousClassCreation1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -1669,7 +1669,7 @@ public void testConvertToAnonymousClassCreation1() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -1695,7 +1695,7 @@ public void testConvertToAnonymousClassCreation1() throws Exception { @Test public void testConvertToAnonymousClassCreation2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method(int a, int b);\n"); @@ -1720,7 +1720,7 @@ public void testConvertToAnonymousClassCreation2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method(int a, int b);\n"); @@ -1746,7 +1746,7 @@ public void testConvertToAnonymousClassCreation2() throws Exception { @Test public void testConvertToAnonymousClassCreation3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -1768,7 +1768,7 @@ public void testConvertToAnonymousClassCreation3() throws Exception { assertNumberOfProposals(proposals, 6); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void method();\n"); @@ -1793,7 +1793,7 @@ public void testConvertToAnonymousClassCreation3() throws Exception { @Test public void testConvertToAnonymousClassCreation4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int method();\n"); @@ -1815,7 +1815,7 @@ public void testConvertToAnonymousClassCreation4() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int method();\n"); @@ -1840,7 +1840,7 @@ public void testConvertToAnonymousClassCreation4() throws Exception { @Test public void testConvertToAnonymousClassCreation5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface FX {\n"); buf.append(" default int defaultMethod(String x) {\n"); @@ -1870,7 +1870,7 @@ public void testConvertToAnonymousClassCreation5() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface FX {\n"); buf.append(" default int defaultMethod(String x) {\n"); @@ -1901,7 +1901,7 @@ public void testConvertToAnonymousClassCreation5() throws Exception { @Test public void testConvertToAnonymousClassCreation6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.UnaryOperator;\n"); buf.append("\n"); @@ -1920,7 +1920,7 @@ public void testConvertToAnonymousClassCreation6() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.UnaryOperator;\n"); buf.append("\n"); @@ -1940,7 +1940,7 @@ public void testConvertToAnonymousClassCreation6() throws Exception { // Bug 427694: [1.8][compiler] Functional interface not identified correctly public void _testConvertToAnonymousClassCreation7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I { Object m(Class c); }\n"); buf.append("interface J { S m(Class c); }\n"); @@ -1960,7 +1960,7 @@ public void _testConvertToAnonymousClassCreation7() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I { Object m(Class c); }\n"); buf.append("interface J { S m(Class c); }\n"); @@ -1983,7 +1983,7 @@ public void _testConvertToAnonymousClassCreation7() throws Exception { @Test public void testConvertToAnonymousClassCreation8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.IntSupplier;\n"); buf.append("public class B extends C {\n"); @@ -2017,7 +2017,7 @@ public void testConvertToAnonymousClassCreation8() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.IntSupplier;\n"); buf.append("public class B extends C {\n"); @@ -2053,7 +2053,7 @@ public void testConvertToAnonymousClassCreation8() throws Exception { @Test public void testConvertToAnonymousClassCreation9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.IntSupplier;\n"); buf.append("public class D {\n"); @@ -2095,7 +2095,7 @@ public void testConvertToAnonymousClassCreation9() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.IntSupplier;\n"); buf.append("\n"); @@ -2141,7 +2141,7 @@ public void testConvertToAnonymousClassCreation9() throws Exception { @Test public void testConvertToAnonymousClassCreationWithParameterName() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.IntFunction;\n"); buf.append("public class E {\n"); @@ -2157,7 +2157,7 @@ public void testConvertToAnonymousClassCreationWithParameterName() throws Except assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.IntFunction;\n"); buf.append("public class E {\n"); @@ -2176,7 +2176,7 @@ public void testConvertToAnonymousClassCreationWithParameterName() throws Except @Test public void testChangeLambdaBodyToBlock1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI1 fi1a= x -> -1;\n"); @@ -2196,7 +2196,7 @@ public void testChangeLambdaBodyToBlock1() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI1 fi1a= x -> {\n"); @@ -2216,7 +2216,7 @@ public void testChangeLambdaBodyToBlock1() throws Exception { @Test public void testChangeLambdaBodyToBlock2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI1 fi1b= x -> m1();\n"); @@ -2237,7 +2237,7 @@ public void testChangeLambdaBodyToBlock2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI1 fi1b= x -> {\n"); @@ -2258,7 +2258,7 @@ public void testChangeLambdaBodyToBlock2() throws Exception { @Test public void testChangeLambdaBodyToBlock3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2b= x -> m1();\n"); @@ -2279,7 +2279,7 @@ public void testChangeLambdaBodyToBlock3() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2b= x -> {\n"); @@ -2300,7 +2300,7 @@ public void testChangeLambdaBodyToBlock3() throws Exception { @Test public void testChangeLambdaBodyToBlock4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2a= x -> System.out.println();\n"); @@ -2320,7 +2320,7 @@ public void testChangeLambdaBodyToBlock4() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2a= x -> {\n"); @@ -2340,7 +2340,7 @@ public void testChangeLambdaBodyToBlock4() throws Exception { @Test public void testChangeLambdaBodyToExpression1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI1 fi1= x -> {\n"); @@ -2362,7 +2362,7 @@ public void testChangeLambdaBodyToExpression1() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI1 fi1= x -> x=0;\n"); @@ -2380,7 +2380,7 @@ public void testChangeLambdaBodyToExpression1() throws Exception { @Test public void testChangeLambdaBodyToExpression2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> {\n"); @@ -2405,7 +2405,7 @@ public void testChangeLambdaBodyToExpression2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> new Runnable() {\n"); @@ -2426,7 +2426,7 @@ public void testChangeLambdaBodyToExpression2() throws Exception { @Test public void testChangeLambdaBodyToExpression3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> { m1(); };\n"); @@ -2447,7 +2447,7 @@ public void testChangeLambdaBodyToExpression3() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> m1();\n"); @@ -2466,7 +2466,7 @@ public void testChangeLambdaBodyToExpression3() throws Exception { @Test public void testChangeLambdaBodyToExpression4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> {\n"); @@ -2484,7 +2484,7 @@ public void testChangeLambdaBodyToExpression4() throws Exception { AssistContext context= getCorrectionContext(cu, offset, 0); assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> super.toString();\n"); @@ -2505,7 +2505,7 @@ public void testChangeLambdaBodyToExpression4() throws Exception { @Test public void testChangeLambdaBodyToExpression5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> {\n"); @@ -2523,7 +2523,7 @@ public void testChangeLambdaBodyToExpression5() throws Exception { AssistContext context= getCorrectionContext(cu, offset, 0); assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" FI2 fi2= x -> --x;\n"); @@ -2620,7 +2620,7 @@ public void testChangeLambdaBodyToExpression8() throws Exception { @Test public void testBug433754() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("class E {\n"); @@ -2635,7 +2635,7 @@ public void testBug433754() throws Exception { AssistContext context= getCorrectionContext(cu, offset, 0); assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("class E {\n"); @@ -2657,7 +2657,7 @@ public void testBug433754() throws Exception { @Test public void testAddInferredLambdaParamTypes1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" FI fi= (i, s) -> {};\n"); @@ -2671,7 +2671,7 @@ public void testAddInferredLambdaParamTypes1() throws Exception { AssistContext context= getCorrectionContext(cu, offset, 0); assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" FI fi= (Integer i, String[][] s) -> {};\n"); // no varargs @@ -2690,7 +2690,7 @@ public void testAddInferredLambdaParamTypes1() throws Exception { @Test public void testAddInferredLambdaParamTypes2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E2 {\n"); @@ -2702,7 +2702,7 @@ public void testAddInferredLambdaParamTypes2() throws Exception { AssistContext context= getCorrectionContext(cu, offset, 0); assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E2 {\n"); @@ -2751,7 +2751,7 @@ public void testAddInferredLambdaParamTypes3() throws Exception { @Test public void testAddInferredLambdaParamTypes4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n"); @@ -2773,7 +2773,7 @@ public void testAddInferredLambdaParamTypes4() throws Exception { AssistContext context= getCorrectionContext(cu, offset, 0); assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.ElementType;\n"); buf.append("import java.lang.annotation.Target;\n"); @@ -2799,7 +2799,7 @@ public void testAddInferredLambdaParamTypes4() throws Exception { @Test public void testConvertMethodReferenceToLambda1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" Baz bm = E1::test;\n"); @@ -2819,7 +2819,7 @@ public void testConvertMethodReferenceToLambda1() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" Baz bm = arg2 -> test(arg2);\n"); @@ -2888,7 +2888,7 @@ public void testConvertMethodReferenceToLambda3() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashSet;\n"); buf.append("import java.util.function.*;\n"); @@ -2915,7 +2915,7 @@ public void testConvertMethodReferenceToLambda3() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashSet;\n"); buf.append("import java.util.function.*;\n"); @@ -2942,7 +2942,7 @@ public void testConvertMethodReferenceToLambda3() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashSet;\n"); buf.append("import java.util.function.*;\n"); @@ -2969,7 +2969,7 @@ public void testConvertMethodReferenceToLambda3() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashSet;\n"); buf.append("import java.util.function.*;\n"); @@ -2992,7 +2992,7 @@ public void testConvertMethodReferenceToLambda3() throws Exception { @Test public void testConvertMethodReferenceToLambda4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E4 {\n"); @@ -3010,7 +3010,7 @@ public void testConvertMethodReferenceToLambda4() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E4 {\n"); @@ -3053,7 +3053,7 @@ public void testConvertMethodReferenceToLambda5() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E5 {\n"); @@ -3081,7 +3081,7 @@ public void testConvertMethodReferenceToLambda5() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E5 {\n"); @@ -3109,7 +3109,7 @@ public void testConvertMethodReferenceToLambda5() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E5 {\n"); @@ -3164,7 +3164,7 @@ public void testConvertMethodReferenceToLambda6() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E6 {\n"); @@ -3197,7 +3197,7 @@ public void testConvertMethodReferenceToLambda6() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E6 {\n"); @@ -3230,7 +3230,7 @@ public void testConvertMethodReferenceToLambda6() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E6 {\n"); @@ -3263,7 +3263,7 @@ public void testConvertMethodReferenceToLambda6() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E6 {\n"); @@ -3296,7 +3296,7 @@ public void testConvertMethodReferenceToLambda6() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E6 {\n"); @@ -3346,7 +3346,7 @@ public void testConvertMethodReferenceToLambda7() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E7 {\n"); @@ -3369,7 +3369,7 @@ public void testConvertMethodReferenceToLambda7() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E7 {\n"); @@ -3392,7 +3392,7 @@ public void testConvertMethodReferenceToLambda7() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.*;\n"); buf.append("public class E7 {\n"); @@ -3411,7 +3411,7 @@ public void testConvertMethodReferenceToLambda7() throws Exception { @Test public void testConvertMethodReferenceToLambda8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("import java.util.function.Supplier;\n"); @@ -3428,7 +3428,7 @@ public void testConvertMethodReferenceToLambda8() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("import java.util.function.Supplier;\n"); @@ -3444,7 +3444,7 @@ public void testConvertMethodReferenceToLambda8() throws Exception { @Test public void testConvertMethodReferenceToLambda9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E9 {\n"); buf.append(" private void test(int t) {\n"); @@ -3464,7 +3464,7 @@ public void testConvertMethodReferenceToLambda9() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E9 {\n"); buf.append(" private void test(int t) {\n"); @@ -3483,7 +3483,7 @@ public void testConvertMethodReferenceToLambda9() throws Exception { @Test public void testConvertMethodReferenceToLambda10() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.*;\n"); buf.append("import java.util.function.*;\n"); @@ -3505,7 +3505,7 @@ public void testConvertMethodReferenceToLambda10() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.*;\n"); buf.append("import java.util.function.*;\n"); @@ -3577,7 +3577,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -3630,7 +3630,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -3683,7 +3683,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -3736,7 +3736,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -3789,7 +3789,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -3842,7 +3842,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -3895,7 +3895,7 @@ public void testConvertMethodReferenceToLambda11() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test01;\n"); buf.append("import java.util.function.Supplier;\n"); buf.append("public class E10 extends Sup {\n"); @@ -4088,7 +4088,7 @@ public void testConvertLambdaToMethodReference2() throws Exception { List proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E2 {\n"); @@ -4109,7 +4109,7 @@ public void testConvertLambdaToMethodReference2() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E2 {\n"); @@ -4130,7 +4130,7 @@ public void testConvertLambdaToMethodReference2() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E2 {\n"); @@ -4181,7 +4181,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { List proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4214,7 +4214,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4247,7 +4247,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4280,7 +4280,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4313,7 +4313,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4346,7 +4346,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4379,7 +4379,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4412,7 +4412,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4445,7 +4445,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4479,7 +4479,7 @@ public void testConvertLambdaToMethodReference3() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("public class E3 extends SuperE3 {\n"); @@ -4561,7 +4561,7 @@ public void testConvertLambdaToMethodReference4() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.BiFunction;\n"); buf.append("import java.util.function.Function;\n"); @@ -4589,7 +4589,7 @@ public void testConvertLambdaToMethodReference4() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.BiFunction;\n"); buf.append("import java.util.function.Function;\n"); @@ -4617,7 +4617,7 @@ public void testConvertLambdaToMethodReference4() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.BiFunction;\n"); buf.append("import java.util.function.Function;\n"); @@ -4666,7 +4666,7 @@ public void testConvertLambdaToMethodReference5() throws Exception { List proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface I {\n"); buf.append(" public default void i1() {\n"); @@ -4689,7 +4689,7 @@ public void testConvertLambdaToMethodReference5() throws Exception { proposals= collectAssists(context, false); assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface I {\n"); buf.append(" public default void i1() {\n"); @@ -4837,7 +4837,7 @@ public void testFixParenthesesInLambdaExpressionCannotRemove3() throws Exception @Test public void testBug514203_wildCard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -4853,7 +4853,7 @@ public void testBug514203_wildCard() throws Exception { List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -4864,7 +4864,7 @@ public void testBug514203_wildCard() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Add inferred lambda parameter types", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -4891,14 +4891,14 @@ public void testBug514203_capture1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Lambda2 {\n"); @@ -4920,7 +4920,7 @@ public void testBug514203_capture1() throws Exception { assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Lambda2 {\n"); @@ -4939,7 +4939,7 @@ public void testBug514203_capture1() throws Exception { assertProposalPreviewEquals(buf.toString(), "Convert to method reference", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Lambda2 {\n"); @@ -4957,7 +4957,7 @@ public void testBug514203_capture1() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Add inferred lambda parameter types", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Lambda2 {\n"); @@ -4991,14 +4991,14 @@ public void testBug514203_capture2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.math.BigDecimal;\n"); @@ -5022,7 +5022,7 @@ public void testBug514203_capture2() throws Exception { assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.math.BigDecimal;\n"); @@ -5043,7 +5043,7 @@ public void testBug514203_capture2() throws Exception { assertProposalPreviewEquals(buf.toString(), "Convert to method reference", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.math.BigDecimal;\n"); @@ -5063,7 +5063,7 @@ public void testBug514203_capture2() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Add inferred lambda parameter types", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.math.BigDecimal;\n"); @@ -5099,14 +5099,14 @@ public void testBug514203_capture3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -5131,7 +5131,7 @@ public void testBug514203_capture3() throws Exception { assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -5153,7 +5153,7 @@ public void testBug514203_capture3() throws Exception { assertProposalPreviewEquals(buf.toString(), "Convert to method reference", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -5174,7 +5174,7 @@ public void testBug514203_capture3() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Add inferred lambda parameter types", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -5211,11 +5211,11 @@ public void testBug514203_lambdaNN() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; // --- Set up @NonNullByDefault for the package, including ARRAY_CONTENTS -- - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@NonNullByDefault({ PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT, ARRAY_CONTENTS })\n"); buf.append("package test1;\n"); buf.append("\n"); @@ -5225,7 +5225,7 @@ public void testBug514203_lambdaNN() throws Exception { // --- Classes that are only referenced -- - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -5235,7 +5235,7 @@ public void testBug514203_lambdaNN() throws Exception { buf.append("@interface X {}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -5245,7 +5245,7 @@ public void testBug514203_lambdaNN() throws Exception { buf.append("@interface Y {}\n"); pack1.createCompilationUnit("Y.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -5255,13 +5255,13 @@ public void testBug514203_lambdaNN() throws Exception { buf.append("@interface Z {}\n"); pack1.createCompilationUnit("Z.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("class Ref {}\n"); pack1.createCompilationUnit("Ref.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface SAM {\n"); @@ -5269,7 +5269,7 @@ public void testBug514203_lambdaNN() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("SAM.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Test {\n"); @@ -5282,7 +5282,7 @@ public void testBug514203_lambdaNN() throws Exception { // --- Classes in which the quick assists are checked (without and with NonNullByDefault in effect at the target location) --- - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5300,7 +5300,7 @@ public void testBug514203_lambdaNN() throws Exception { assertNoErrors(context1); List proposals1= collectAssists(context1, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5320,7 +5320,7 @@ public void testBug514203_lambdaNN() throws Exception { // --- Convert to method reference without and with NNBD --- - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5335,7 +5335,7 @@ public void testBug514203_lambdaNN() throws Exception { assertProposalPreviewEquals(buf.toString(), "Convert to method reference", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5350,7 +5350,7 @@ public void testBug514203_lambdaNN() throws Exception { // --- Add inferred lambda parameter types without and with NNBD --- - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5364,7 +5364,7 @@ public void testBug514203_lambdaNN() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Add inferred lambda parameter types", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5378,7 +5378,7 @@ public void testBug514203_lambdaNN() throws Exception { assertProposalPreviewEquals(buf.toString(), "Add inferred lambda parameter types", proposals2); // --- Convert to anonymous class creation without and with NNBD -- - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5398,7 +5398,7 @@ public void testBug514203_lambdaNN() throws Exception { buf.append("}\n"); assertProposalPreviewEquals(buf.toString(), "Convert to anonymous class creation", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -5420,7 +5420,7 @@ public void testBug514203_lambdaNN() throws Exception { @Test public void testBug514203_annotatedParametrizedType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Example {\n"); @@ -5440,7 +5440,7 @@ public void testBug514203_annotatedParametrizedType() throws Exception { assertNoErrors(context); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Example {\n"); @@ -5467,7 +5467,7 @@ public void testNoRedundantNonNullInConvertArrayForLoop() throws Exception { NullTestUtils.prepareNullTypeAnnotations(fSourceFolder); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import annots.*;\n"); buf.append("public class A {\n"); @@ -5485,7 +5485,7 @@ public void testNoRedundantNonNullInConvertArrayForLoop() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 3); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import annots.*;\n"); buf.append("public class A {\n"); @@ -5505,7 +5505,7 @@ public void testNoRedundantNonNullInConvertIterableForLoop() throws Exception { NullTestUtils.prepareNullTypeAnnotations(fSourceFolder); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import annots.*;\n"); @@ -5525,7 +5525,7 @@ public void testNoRedundantNonNullInConvertIterableForLoop() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 3); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import annots.*;\n"); buf.append("@NonNullByDefault\n"); @@ -5545,7 +5545,7 @@ public void testNoRedundantNonNullInConvertIterableForLoop() throws Exception { @Test public void testSurroundWithTryWithResource_01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer bufOrg= new StringBuffer(); + StringBuilder bufOrg= new StringBuilder(); bufOrg.append("package p;\n"); bufOrg.append("\n"); bufOrg.append("import java.io.IOException;\n"); @@ -5576,7 +5576,7 @@ public void testSurroundWithTryWithResource_01() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -5609,7 +5609,7 @@ public void testSurroundWithTryWithResource_01() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -5641,7 +5641,7 @@ public void testSurroundWithTryWithResource_01() throws Exception { @Test public void testSurroundWithTryWithResource_02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer bufOrg= new StringBuffer(); + StringBuilder bufOrg= new StringBuilder(); bufOrg.append("package p;\n"); bufOrg.append("\n"); bufOrg.append("import java.io.FileInputStream;\n"); @@ -5674,7 +5674,7 @@ public void testSurroundWithTryWithResource_02() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.io.FileInputStream;\n"); @@ -5715,7 +5715,7 @@ public void testSurroundWithTryWithResource_02() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.io.FileInputStream;\n"); @@ -5755,7 +5755,7 @@ public void testSurroundWithTryWithResource_02() throws Exception { @Test public void testSurroundWithTryWithResource_03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer bufOrg= new StringBuffer(); + StringBuilder bufOrg= new StringBuilder(); bufOrg.append("package p;\n"); bufOrg.append("\n"); bufOrg.append("import java.io.FileInputStream;\n"); @@ -5790,7 +5790,7 @@ public void testSurroundWithTryWithResource_03() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.io.FileInputStream;\n"); @@ -5824,7 +5824,7 @@ public void testSurroundWithTryWithResource_03() throws Exception { @Test public void testSurroundWithTryWithResource_04() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer bufOrg= new StringBuffer(); + StringBuilder bufOrg= new StringBuilder(); bufOrg.append("package p;\n"); bufOrg.append("\n"); bufOrg.append("import java.io.FileInputStream;\n"); @@ -5859,7 +5859,7 @@ public void testSurroundWithTryWithResource_04() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.io.FileInputStream;\n"); @@ -5893,7 +5893,7 @@ public void testSurroundWithTryWithResource_04() throws Exception { @Test public void testWrapInOptional_01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5909,7 +5909,7 @@ public void testWrapInOptional_01() throws Exception { assertNumberOfProposals(proposals, 3); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5917,7 +5917,7 @@ public void testWrapInOptional_01() throws Exception { buf.append("}\n"); assertExpectedExistInProposals(proposals, new String[] { buf.toString() }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5928,7 +5928,7 @@ public void testWrapInOptional_01() throws Exception { @Test public void testWrapInOptional_02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5949,7 +5949,7 @@ public void testWrapInOptional_02() throws Exception { assertNumberOfProposals(proposals, 6); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5962,7 +5962,7 @@ public void testWrapInOptional_02() throws Exception { buf.append("}\n"); assertExpectedExistInProposals(proposals, new String[] { buf.toString() }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5975,7 +5975,7 @@ public void testWrapInOptional_02() throws Exception { buf.append("}\n"); assertExpectedExistInProposals(proposals, new String[] { buf.toString() }); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -5991,7 +5991,7 @@ public void testWrapInOptional_02() throws Exception { @Test public void testWrapInOptional_03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); @@ -6007,7 +6007,7 @@ public void testWrapInOptional_03() throws Exception { assertNumberOfProposals(proposals, 2); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.Optional;\n"); buf.append("public class E {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ChangeNonStaticToStaticTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ChangeNonStaticToStaticTest.java index 5f7250e3120..00255eddcd1 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ChangeNonStaticToStaticTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ChangeNonStaticToStaticTest.java @@ -115,7 +115,7 @@ private CodeStyleCleanUp createCleanUp() { @Test public void testNonStaticAccessTest01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); @@ -131,7 +131,7 @@ public void testNonStaticAccessTest01() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); @@ -147,7 +147,7 @@ public void testNonStaticAccessTest01() throws Exception { @Test public void testNonStaticAccessTest02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); @@ -163,7 +163,7 @@ public void testNonStaticAccessTest02() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); @@ -179,7 +179,7 @@ public void testNonStaticAccessTest02() throws Exception { @Test public void testNonStaticAccessTest03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); @@ -195,7 +195,7 @@ public void testNonStaticAccessTest03() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); @@ -211,14 +211,14 @@ public void testNonStaticAccessTest03() throws Exception { @Test public void testNonStaticAccessTest04() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" private static class E1 {\n"); @@ -240,7 +240,7 @@ public void testNonStaticAccessTest04() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" private static class E1 {\n"); @@ -262,20 +262,20 @@ public void testNonStaticAccessTest04() throws Exception { @Test public void testNonStaticAccessTest05() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E1 {}\n"); pack1.createCompilationUnit("E2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -292,7 +292,7 @@ public void testNonStaticAccessTest05() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E1;\n"); buf.append("import test1.E2;\n"); @@ -310,20 +310,20 @@ public void testNonStaticAccessTest05() throws Exception { @Test public void testNonStaticAccessTest06() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E1 {}\n"); pack1.createCompilationUnit("E2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -340,7 +340,7 @@ public void testNonStaticAccessTest06() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E1;\n"); buf.append("import test1.E2;\n"); @@ -358,20 +358,20 @@ public void testNonStaticAccessTest06() throws Exception { @Test public void testNonStaticAccessTest07() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E1 {}\n"); pack1.createCompilationUnit("E2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -389,7 +389,7 @@ public void testNonStaticAccessTest07() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -407,20 +407,20 @@ public void testNonStaticAccessTest07() throws Exception { @Test public void testNonStaticAccessTest08() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E1 {}\n"); pack1.createCompilationUnit("E2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -441,7 +441,7 @@ public void testNonStaticAccessTest08() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -462,20 +462,20 @@ public void testNonStaticAccessTest08() throws Exception { @Test public void testNonStaticAccessTest09() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E1 {}\n"); pack1.createCompilationUnit("E2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E2;\n"); buf.append("public class E3 {\n"); @@ -496,7 +496,7 @@ public void testNonStaticAccessTest09() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.E1;\n"); buf.append("import test1.E2;\n"); @@ -518,14 +518,14 @@ public void testNonStaticAccessTest09() throws Exception { @Test public void testNonStaticAccessTest10() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static void foo() {};\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" private static String E1= \"\";\n"); @@ -542,7 +542,7 @@ public void testNonStaticAccessTest10() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" private static String E1= \"\";\n"); @@ -559,14 +559,14 @@ public void testNonStaticAccessTest10() throws Exception { @Test public void testNonStaticAccessTest11() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static void foo() {};\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" private static String E1= \"\";\n"); @@ -583,7 +583,7 @@ public void testNonStaticAccessTest11() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" private static String E1= \"\";\n"); @@ -600,14 +600,14 @@ public void testNonStaticAccessTest11() throws Exception { @Test public void testNonStaticAccessTest12() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public static int I;\n"); buf.append("}\n"); pack1.createCompilationUnit("E1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.E1;\n"); buf.append("public class E2 {\n"); @@ -620,7 +620,7 @@ public void testNonStaticAccessTest12() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("E2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class E1 {}\n"); pack2.createCompilationUnit("E1.java", buf.toString(), false, null); @@ -631,7 +631,7 @@ public void testNonStaticAccessTest12() throws Exception { ICleanUp cleanUp= createCleanUp(); refactoring.addCleanUp(cleanUp); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.E1;\n"); buf.append("public class E2 {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpActionTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpActionTest.java index 11cd7fe2152..ba79b2c06ba 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpActionTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpActionTest.java @@ -63,7 +63,7 @@ protected IClasspathEntry[] getDefaultClasspath() throws CoreException { @Test public void testSortMembersAction() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("testSortMembersAction", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package testSortMembersAction;\n"); buf.append("public class E1 {\n"); buf.append(" private void methodX() {}\n"); @@ -89,7 +89,7 @@ protected Map getSettings() { action.run(selection); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package testSortMembersAction;\n"); buf.append("public class E1 {\n"); buf.append(" private int fieldA;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpAnnotationTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpAnnotationTest.java index 05ef5a25106..3366709bd39 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpAnnotationTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpAnnotationTest.java @@ -96,7 +96,7 @@ private IMarker addMarker(String markerType, ICompilationUnit unit, int lineNumb @Test public void testSortMembersTask() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void x() {\n"); @@ -112,7 +112,7 @@ public void testSortMembersTask() throws Exception { enable(CleanUpConstants.SORT_MEMBERS); enable(CleanUpConstants.SORT_MEMBERS_ALL); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void a() {}\n"); @@ -135,7 +135,7 @@ public void testSortMembersTask() throws Exception { @Test public void testSortMembersBookmarks() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void x() {\n"); @@ -151,7 +151,7 @@ public void testSortMembersBookmarks() throws Exception { enable(CleanUpConstants.SORT_MEMBERS); enable(CleanUpConstants.SORT_MEMBERS_ALL); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void a() {}\n"); @@ -174,7 +174,7 @@ public void testSortMembersBookmarks() throws Exception { @Test public void testSortMembersBreakpoints() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void x() {\n"); @@ -190,7 +190,7 @@ public void testSortMembersBreakpoints() throws Exception { enable(CleanUpConstants.SORT_MEMBERS); enable(CleanUpConstants.SORT_MEMBERS_ALL); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void a() {}\n"); @@ -213,7 +213,7 @@ public void testSortMembersBreakpoints() throws Exception { @Test public void testSortMembersProblemMarker() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" private void x() {\n"); @@ -234,7 +234,7 @@ public void testSortMembersProblemMarker() throws Exception { enable(CleanUpConstants.SORT_MEMBERS); enable(CleanUpConstants.SORT_MEMBERS_ALL); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public void a() {}\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java index 8e6ee2084d2..4126dc705f7 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/CleanUpTest.java @@ -27362,10 +27362,10 @@ public void testConstantsForSystemProperty_donttouch() throws Exception { @Test public void testRemoveRedundantModifiers () throws Exception { - StringBuffer buf; + StringBuilder buf; IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public abstract interface IFoo {\n"); buf.append(" public static final int MAGIC_NUMBER = 646;\n"); @@ -27375,7 +27375,7 @@ public void testRemoveRedundantModifiers () throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("IFoo.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public interface IFoo {\n"); buf.append(" int MAGIC_NUMBER = 646;\n"); @@ -27385,7 +27385,7 @@ public void testRemoveRedundantModifiers () throws Exception { buf.append("}\n"); String expected1 = buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public final class Sealed {\n"); buf.append(" public final void foo () {};\n"); @@ -27395,7 +27395,7 @@ public void testRemoveRedundantModifiers () throws Exception { buf.append("}\n"); ICompilationUnit cu2= pack1.createCompilationUnit("Sealed.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public final class Sealed {\n"); buf.append(" public void foo () {};\n"); @@ -27407,7 +27407,7 @@ public void testRemoveRedundantModifiers () throws Exception { // Anonymous class within an interface: // public keyword must not be removed (see bug#536612) - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public interface X {\n"); buf.append(" void B();\n"); @@ -27442,7 +27442,7 @@ public void testRemoveRedundantModifiers () throws Exception { + "}\n"; // public modifier must not be removed from enum methods - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public interface A {\n"); buf.append(" public static enum B {\n"); @@ -27456,7 +27456,7 @@ public void testRemoveRedundantModifiers () throws Exception { String expected5 = buf.toString().replace("static enum", "enum"); // Bug#551038: final keyword must not be removed from method with varargs - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public final class SafeVarargsExample {\n"); buf.append(" @SafeVarargs\n"); @@ -27467,7 +27467,7 @@ public void testRemoveRedundantModifiers () throws Exception { ICompilationUnit cu6= pack1.createCompilationUnit("SafeVarargsExample.java", buf.toString(), false, null); // Bug#553608: modifiers public static final must not be removed from inner enum within interface - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public interface Foo {\n"); buf.append(" enum Bar {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ContributedQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ContributedQuickFixTest.java index 9dc4ed11594..0b8fa9507db 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ContributedQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ContributedQuickFixTest.java @@ -69,7 +69,7 @@ public void tearDown() throws Exception { @Test public void testContributedQuickAssist1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public String foo() {\n"); @@ -88,7 +88,7 @@ public void testContributedQuickAssist1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public String foo() {\n"); @@ -104,7 +104,7 @@ public void testContributedQuickAssist1() throws Exception { @Test public void testContributedQuickFix1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public int foo() {\n"); @@ -122,7 +122,7 @@ public void testContributedQuickFix1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public int foo() {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/GetterSetterQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/GetterSetterQuickFixTest.java index aa41f44f6c2..e401944f446 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/GetterSetterQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/GetterSetterQuickFixTest.java @@ -79,7 +79,7 @@ public void tearDown() throws Exception { @Test public void testInvisibleFieldToGetterSetter() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("b112441", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package b112441;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -109,7 +109,7 @@ public void testInvisibleFieldToGetterSetter() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package b112441;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -132,7 +132,7 @@ public void testInvisibleFieldToGetterSetter() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package b112441;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -161,7 +161,7 @@ public void testInvisibleFieldToGetterSetter() throws Exception { @Test public void testInvisibleFieldToGetterSetterBug335173_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -191,7 +191,7 @@ public void testInvisibleFieldToGetterSetterBug335173_1() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -220,7 +220,7 @@ public void testInvisibleFieldToGetterSetterBug335173_1() throws Exception { @Test public void testInvisibleFieldToGetterSetterBug335173_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -250,7 +250,7 @@ public void testInvisibleFieldToGetterSetterBug335173_2() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -279,7 +279,7 @@ public void testInvisibleFieldToGetterSetterBug335173_2() throws Exception { @Test public void testInvisibleFieldToGetterSetterBug335173_3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -309,7 +309,7 @@ public void testInvisibleFieldToGetterSetterBug335173_3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -338,7 +338,7 @@ public void testInvisibleFieldToGetterSetterBug335173_3() throws Exception { @Test public void testInvisibleFieldToGetterSetterBug335173_4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -368,7 +368,7 @@ public void testInvisibleFieldToGetterSetterBug335173_4() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class C {\n"); @@ -397,7 +397,7 @@ public void testInvisibleFieldToGetterSetterBug335173_4() throws Exception { @Test public void testCreateFieldUsingSef() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("\n"); buf.append("public class A {\n"); buf.append(" private int t;\n"); @@ -420,7 +420,7 @@ public void testCreateFieldUsingSef() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("\n"); buf.append("public class A {\n"); buf.append(" int t;\n"); @@ -436,7 +436,7 @@ public void testCreateFieldUsingSef() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("\n"); buf.append("public class A {\n"); buf.append(" private int t;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/JavadocQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/JavadocQuickFixTest.java index d0c78a56399..4b38021074c 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/JavadocQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/JavadocQuickFixTest.java @@ -64,7 +64,7 @@ public void setUp() throws Exception { options.put(JavaCore.COMPILER_PB_MISSING_JAVADOC_COMMENTS_OVERRIDING, JavaCore.ENABLED); JavaCore.setOptions(options); - StringBuffer comment= new StringBuffer(); + StringBuilder comment= new StringBuilder(); comment.append("/**\n"); comment.append(" * A comment.\n"); comment.append(" * ${tags}\n"); @@ -74,20 +74,20 @@ public void setUp() throws Exception { StubUtility.setCodeTemplate(CodeTemplateContextType.METHODCOMMENT_ID, res, null); StubUtility.setCodeTemplate(CodeTemplateContextType.TYPECOMMENT_ID, res, null); - comment= new StringBuffer(); + comment= new StringBuilder(); comment.append("/**\n"); comment.append(" * A field comment for ${field}.\n"); comment.append(" */"); StubUtility.setCodeTemplate(CodeTemplateContextType.FIELDCOMMENT_ID, comment.toString(), null); - comment= new StringBuffer(); + comment= new StringBuilder(); comment.append("/**\n"); comment.append(" * A override comment.\n"); comment.append(" * ${see_to_overridden}\n"); comment.append(" */"); StubUtility.setCodeTemplate(CodeTemplateContextType.OVERRIDECOMMENT_ID, comment.toString(), null); - comment= new StringBuffer(); + comment= new StringBuilder(); comment.append("/**\n"); comment.append(" * A delegate comment.\n"); comment.append(" * ${see_to_target}\n"); @@ -109,7 +109,7 @@ public void tearDown() throws Exception { @Test public void testMissingParam1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -134,7 +134,7 @@ public void testMissingParam1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -158,7 +158,7 @@ public void testMissingParam1() throws Exception { @Test public void testMissingParam2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -182,7 +182,7 @@ public void testMissingParam2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -203,7 +203,7 @@ public void testMissingParam2() throws Exception { @Test public void testMissingParam3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -227,7 +227,7 @@ public void testMissingParam3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -249,7 +249,7 @@ public void testMissingParam3() throws Exception { @Test public void testMissingParam4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -273,7 +273,7 @@ public void testMissingParam4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -295,7 +295,7 @@ public void testMissingParam4() throws Exception { @Test public void testMissingParam5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @param Hello\n"); @@ -313,7 +313,7 @@ public void testMissingParam5() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @param \n"); @@ -329,7 +329,7 @@ public void testMissingParam5() throws Exception { @Test public void testMissingParam6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @author ae\n"); @@ -347,7 +347,7 @@ public void testMissingParam6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @author ae\n"); @@ -363,7 +363,7 @@ public void testMissingParam6() throws Exception { @Test public void testMissingReturn1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -388,7 +388,7 @@ public void testMissingReturn1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -411,7 +411,7 @@ public void testMissingReturn1() throws Exception { @Test public void testMissingReturn2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -433,7 +433,7 @@ public void testMissingReturn2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -453,7 +453,7 @@ public void testMissingReturn2() throws Exception { @Test public void testMissingReturn3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -476,7 +476,7 @@ public void testMissingReturn3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -497,7 +497,7 @@ public void testMissingReturn3() throws Exception { @Test public void testMissingThrows() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -520,7 +520,7 @@ public void testMissingThrows() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -541,7 +541,7 @@ public void testMissingThrows() throws Exception { @Test public void testInsertAllMissing1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -558,7 +558,7 @@ public void testInsertAllMissing1() throws Exception { ArrayList proposals= collectCorrections2(cu, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -582,7 +582,7 @@ public void testInsertAllMissing1() throws Exception { @Test public void testInsertAllMissing2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -600,7 +600,7 @@ public void testInsertAllMissing2() throws Exception { ArrayList proposals= collectCorrections2(cu, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -625,7 +625,7 @@ public void testInsertAllMissing2() throws Exception { @Test public void testInsertAllMissing3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -636,7 +636,7 @@ public void testInsertAllMissing3() throws Exception { ArrayList proposals= collectCorrections2(cu, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @param \n"); @@ -652,7 +652,7 @@ public void testInsertAllMissing3() throws Exception { @Test public void testInsertAllMissing4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -671,7 +671,7 @@ public void testInsertAllMissing4() throws Exception { ArrayList proposals= collectCorrections2(cu, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -695,7 +695,7 @@ public void testInsertAllMissing4() throws Exception { @Test public void testRemoveParamTag1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -717,7 +717,7 @@ public void testRemoveParamTag1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -735,7 +735,7 @@ public void testRemoveParamTag1() throws Exception { @Test public void testRemoveParamTag2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -757,7 +757,7 @@ public void testRemoveParamTag2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -777,7 +777,7 @@ public void testRemoveParamTag2() throws Exception { @Test public void testRemoveThrowsTag1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -800,7 +800,7 @@ public void testRemoveThrowsTag1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -820,7 +820,7 @@ public void testRemoveThrowsTag1() throws Exception { @Test public void testRemoveThrowsTag2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -842,7 +842,7 @@ public void testRemoveThrowsTag2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -861,7 +861,7 @@ public void testRemoveThrowsTag2() throws Exception { @Test public void testRemoveThrowsTag3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("/**\n"); @@ -886,7 +886,7 @@ public void testRemoveThrowsTag3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("/**\n"); @@ -908,7 +908,7 @@ public void testRemoveThrowsTag3() throws Exception { @Test public void testRemoveReturnTag1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -932,7 +932,7 @@ public void testRemoveReturnTag1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -952,7 +952,7 @@ public void testRemoveReturnTag1() throws Exception { @Test public void testRemoveUnknownTag1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -976,7 +976,7 @@ public void testRemoveUnknownTag1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -996,7 +996,7 @@ public void testRemoveUnknownTag1() throws Exception { @Test public void testMissingMethodComment1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("/**\n"); @@ -1014,7 +1014,7 @@ public void testMissingMethodComment1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("/**\n"); @@ -1036,7 +1036,7 @@ public void testMissingMethodComment1() throws Exception { @Test public void testMissingMethodComment2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -1054,7 +1054,7 @@ public void testMissingMethodComment2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -1074,7 +1074,7 @@ public void testMissingMethodComment2() throws Exception { @Test public void testMissingMethodComment3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -1091,7 +1091,7 @@ public void testMissingMethodComment3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -1109,7 +1109,7 @@ public void testMissingMethodComment3() throws Exception { @Test public void testMissingMethodComment4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("/**\n"); @@ -1134,7 +1134,7 @@ public void testMissingMethodComment4() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("/**\n"); @@ -1163,7 +1163,7 @@ public void testMissingMethodComment4() throws Exception { @Test public void testMissingConstructorComment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("/**\n"); @@ -1181,7 +1181,7 @@ public void testMissingConstructorComment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("/**\n"); @@ -1202,7 +1202,7 @@ public void testMissingConstructorComment() throws Exception { @Test public void testMissingTypeComment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("}\n"); @@ -1215,7 +1215,7 @@ public void testMissingTypeComment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * A comment.\n"); @@ -1231,7 +1231,7 @@ public void testMissingTypeComment() throws Exception { @Test public void testMissingFieldComment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -1247,7 +1247,7 @@ public void testMissingFieldComment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" */\n"); @@ -1270,7 +1270,7 @@ public void testInvalidQualification1() throws Exception { try { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -1283,7 +1283,7 @@ public void testInvalidQualification1() throws Exception { pack1.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack.A.B.C;\n"); @@ -1302,7 +1302,7 @@ public void testInvalidQualification1() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack.A.B.C;\n"); @@ -1323,7 +1323,7 @@ public void testInvalidQualification1() throws Exception { @Test public void testInvalidQualification2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -1333,7 +1333,7 @@ public void testInvalidQualification2() throws Exception { pack1.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack.A;\n"); @@ -1352,7 +1352,7 @@ public void testInvalidQualification2() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack.A;\n"); @@ -1370,7 +1370,7 @@ public void testInvalidQualification2() throws Exception { @Test public void testInvalidQualification3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -1381,7 +1381,7 @@ public void testInvalidQualification3() throws Exception { pack1.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("pack2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack.A;\n"); @@ -1400,7 +1400,7 @@ public void testInvalidQualification3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack2;\n"); buf.append("\n"); buf.append("import pack.A;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java index 76f6207d905..9f48f971252 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java @@ -107,7 +107,7 @@ public void tearDown() throws Exception { @Test public void testFieldAccessToStatic() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class E {\n"); @@ -125,7 +125,7 @@ public void testFieldAccessToStatic() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class E {\n"); @@ -141,7 +141,7 @@ public void testFieldAccessToStatic() throws Exception { @Test public void testInheritedAccessOnStatic() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public static void foo() {\n"); @@ -149,14 +149,14 @@ public void testInheritedAccessOnStatic() throws Exception { buf.append("}\n"); pack0.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B extends A {\n"); buf.append("}\n"); pack0.createCompilationUnit("B.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.B;\n"); buf.append("public class E {\n"); @@ -174,7 +174,7 @@ public void testInheritedAccessOnStatic() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.B;\n"); buf.append("public class E {\n"); @@ -187,7 +187,7 @@ public void testInheritedAccessOnStatic() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.A;\n"); buf.append("import pack.B;\n"); @@ -201,7 +201,7 @@ public void testInheritedAccessOnStatic() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -215,7 +215,7 @@ public void testInheritedAccessOnStatic() throws Exception { @Test public void testInheritedAccessOnStaticInGeneric() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public static void foo() {\n"); @@ -223,14 +223,14 @@ public void testInheritedAccessOnStaticInGeneric() throws Exception { buf.append("}\n"); pack0.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B extends A {\n"); buf.append("}\n"); pack0.createCompilationUnit("B.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.B;\n"); buf.append("public class E {\n"); @@ -248,7 +248,7 @@ public void testInheritedAccessOnStaticInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.B;\n"); buf.append("public class E {\n"); @@ -261,7 +261,7 @@ public void testInheritedAccessOnStaticInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.A;\n"); buf.append("import pack.B;\n"); @@ -275,7 +275,7 @@ public void testInheritedAccessOnStaticInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -289,7 +289,7 @@ public void testInheritedAccessOnStaticInGeneric() throws Exception { @Test public void testQualifiedAccessToStatic() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Thread t) throws InterruptedException {\n"); @@ -306,7 +306,7 @@ public void testQualifiedAccessToStatic() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Thread t) throws InterruptedException {\n"); @@ -319,7 +319,7 @@ public void testQualifiedAccessToStatic() throws Exception { @Test public void testThisAccessToStatic() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void goo() {\n"); @@ -338,7 +338,7 @@ public void testThisAccessToStatic() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void goo() {\n"); @@ -352,7 +352,7 @@ public void testThisAccessToStatic() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void goo() {\n"); @@ -369,7 +369,7 @@ public void testThisAccessToStatic() throws Exception { @Test public void testThisAccessToStaticField() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static int fCount;\n"); @@ -388,7 +388,7 @@ public void testThisAccessToStaticField() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static int fCount;\n"); @@ -402,7 +402,7 @@ public void testThisAccessToStaticField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int fCount;\n"); @@ -420,7 +420,7 @@ public void testThisAccessToStaticField() throws Exception { @Test public void testCastMissingInVarDecl() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -437,7 +437,7 @@ public void testCastMissingInVarDecl() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -449,7 +449,7 @@ public void testCastMissingInVarDecl() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -461,7 +461,7 @@ public void testCastMissingInVarDecl() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Thread o) {\n"); @@ -476,7 +476,7 @@ public void testCastMissingInVarDecl() throws Exception { @Test public void testCastMissingInVarDecl2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class Container {\n"); @@ -486,7 +486,7 @@ public void testCastMissingInVarDecl2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -504,7 +504,7 @@ public void testCastMissingInVarDecl2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -517,7 +517,7 @@ public void testCastMissingInVarDecl2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -531,7 +531,7 @@ public void testCastMissingInVarDecl2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -549,7 +549,7 @@ public void testCastMissingInVarDecl2() throws Exception { @Test public void testCastMissingInVarDecl3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -565,7 +565,7 @@ public void testCastMissingInVarDecl3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Thread foo() {\n"); @@ -580,7 +580,7 @@ public void testCastMissingInVarDecl3() throws Exception { @Test public void testCastMissingInVarDecl4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class Container {\n"); @@ -590,7 +590,7 @@ public void testCastMissingInVarDecl4() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E extends Container {\n"); @@ -608,7 +608,7 @@ public void testCastMissingInVarDecl4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E extends Container {\n"); @@ -621,7 +621,7 @@ public void testCastMissingInVarDecl4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -635,7 +635,7 @@ public void testCastMissingInVarDecl4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -654,7 +654,7 @@ public void testCastMissingInVarDecl4() throws Exception { @Test public void testCastMissingInFieldDecl() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int time= System.currentTimeMillis();\n"); @@ -669,7 +669,7 @@ public void testCastMissingInFieldDecl() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int time= (int) System.currentTimeMillis();\n"); @@ -679,7 +679,7 @@ public void testCastMissingInFieldDecl() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" long time= System.currentTimeMillis();\n"); @@ -692,7 +692,7 @@ public void testCastMissingInFieldDecl() throws Exception { @Test public void testCastMissingInAssignment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -711,7 +711,7 @@ public void testCastMissingInAssignment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -725,7 +725,7 @@ public void testCastMissingInAssignment() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -743,7 +743,7 @@ public void testCastMissingInAssignment() throws Exception { @Test public void testCastMissingInAssignment2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -762,7 +762,7 @@ public void testCastMissingInAssignment2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -776,7 +776,7 @@ public void testCastMissingInAssignment2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -795,7 +795,7 @@ public void testCastMissingInAssignment2() throws Exception { @Test public void testCastMissingInExpression() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -813,7 +813,7 @@ public void testCastMissingInExpression() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -826,7 +826,7 @@ public void testCastMissingInExpression() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -842,7 +842,7 @@ public void testCastMissingInExpression() throws Exception { @Test public void testCastOnCastExpression() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -861,7 +861,7 @@ public void testCastOnCastExpression() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -875,7 +875,7 @@ public void testCastOnCastExpression() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -894,7 +894,7 @@ public void testCastOnCastExpression() throws Exception { public void testUncaughtException() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -915,7 +915,7 @@ public void testUncaughtException() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -930,7 +930,7 @@ public void testUncaughtException() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -952,7 +952,7 @@ public void testUncaughtException() throws Exception { public void testUncaughtException2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -977,7 +977,7 @@ public void testUncaughtException2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -997,7 +997,7 @@ public void testUncaughtException2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1024,7 +1024,7 @@ public void testUncaughtException3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1051,7 +1051,7 @@ public void testUncaughtException3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1073,7 +1073,7 @@ public void testUncaughtException3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1102,7 +1102,7 @@ public void testUncaughtException3() throws Exception { public void testUncaughtException4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.InterruptedIOException;\n"); @@ -1131,7 +1131,7 @@ public void testUncaughtException4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.InterruptedIOException;\n"); @@ -1156,7 +1156,7 @@ public void testUncaughtException4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.InterruptedIOException;\n"); @@ -1187,7 +1187,7 @@ public void testUncaughtException4() throws Exception { public void testUncaughtException5() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=31554 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1210,7 +1210,7 @@ public void testUncaughtException5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1230,7 +1230,7 @@ public void testUncaughtException5() throws Exception { @Test public void testUncaughtExceptionImportConflict() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Test {\n"); buf.append(" public void test1() {\n"); @@ -1252,7 +1252,7 @@ public void testUncaughtExceptionImportConflict() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Test.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("de.muenchen.test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package de.muenchen.test;\n"); buf.append("\n"); buf.append("public class Exception extends java.lang.Throwable {\n"); @@ -1268,7 +1268,7 @@ public void testUncaughtExceptionImportConflict() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Test {\n"); buf.append(" public void test1() {\n"); @@ -1295,7 +1295,7 @@ public void testUncaughtExceptionImportConflict() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Test {\n"); buf.append(" public void test1() throws de.muenchen.test.Exception {\n"); @@ -1323,7 +1323,7 @@ public void testUncaughtExceptionImportConflict() throws Exception { public void testUncaughtExceptionExtendedSelection() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1351,7 +1351,7 @@ public void testUncaughtExceptionExtendedSelection() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1368,7 +1368,7 @@ public void testUncaughtExceptionExtendedSelection() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1393,7 +1393,7 @@ public void testUncaughtExceptionExtendedSelection() throws Exception { public void testUncaughtExceptionRemoveMoreSpecific() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.net.SocketException;\n"); @@ -1420,7 +1420,7 @@ public void testUncaughtExceptionRemoveMoreSpecific() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.net.SocketException;\n"); @@ -1441,7 +1441,7 @@ public void testUncaughtExceptionRemoveMoreSpecific() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.net.SocketException;\n"); @@ -1469,7 +1469,7 @@ public void testUncaughtExceptionRemoveMoreSpecific() throws Exception { public void testUncaughtExceptionToSurroundingTry() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1495,7 +1495,7 @@ public void testUncaughtExceptionToSurroundingTry() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1515,7 +1515,7 @@ public void testUncaughtExceptionToSurroundingTry() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1538,7 +1538,7 @@ public void testUncaughtExceptionToSurroundingTry() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1563,7 +1563,7 @@ public void testUncaughtExceptionToSurroundingTry() throws Exception { public void testUncaughtExceptionOnSuper1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("public class E extends FileInputStream {\n"); @@ -1582,7 +1582,7 @@ public void testUncaughtExceptionOnSuper1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -1599,7 +1599,7 @@ public void testUncaughtExceptionOnSuper1() throws Exception { public void testUncaughtExceptionOnSuper2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A() throws Exception {\n"); @@ -1607,7 +1607,7 @@ public void testUncaughtExceptionOnSuper2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" /**\n"); @@ -1628,7 +1628,7 @@ public void testUncaughtExceptionOnSuper2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" /**\n"); @@ -1646,7 +1646,7 @@ public void testUncaughtExceptionOnSuper2() throws Exception { public void testUncaughtExceptionOnSuper3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A implements Runnable {\n"); buf.append(" public void run() {\n"); @@ -1663,7 +1663,7 @@ public void testUncaughtExceptionOnSuper3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A implements Runnable {\n"); buf.append(" public void run() {\n"); @@ -1681,7 +1681,7 @@ public void testUncaughtExceptionOnSuper3() throws Exception { public void testUncaughtExceptionOnSuper4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -1689,7 +1689,7 @@ public void testUncaughtExceptionOnSuper4() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public void foo() {\n"); @@ -1707,7 +1707,7 @@ public void testUncaughtExceptionOnSuper4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public void foo() throws Exception {\n"); @@ -1724,7 +1724,7 @@ public void testUncaughtExceptionOnSuper4() throws Exception { public void testUncaughtExceptionOnSuper5() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=349051 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Closeable;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -1744,7 +1744,7 @@ public void testUncaughtExceptionOnSuper5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Closeable;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -1782,7 +1782,7 @@ public void testUncaughtExceptionOnSuper6() throws Exception { public void testUncaughtExceptionOnThis() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1803,7 +1803,7 @@ public void testUncaughtExceptionOnThis() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -1820,13 +1820,13 @@ public void testUncaughtExceptionOnThis() throws Exception { @Test public void testUncaughtExceptionDuplicate() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class MyException extends Exception {\n"); buf.append("}\n"); pack1.createCompilationUnit("MyException.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1848,7 +1848,7 @@ public void testUncaughtExceptionDuplicate() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1864,7 +1864,7 @@ public void testUncaughtExceptionDuplicate() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1889,7 +1889,7 @@ public void testUncaughtExceptionDuplicate() throws Exception { public void testMultipleUncaughtExceptions() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1911,7 +1911,7 @@ public void testMultipleUncaughtExceptions() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1927,7 +1927,7 @@ public void testMultipleUncaughtExceptions() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1951,7 +1951,7 @@ public void testMultipleUncaughtExceptions() throws Exception { public void testUncaughtExceptionInInitializer() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" {\n"); @@ -1968,7 +1968,7 @@ public void testUncaughtExceptionInInitializer() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" {\n"); @@ -1988,7 +1988,7 @@ public void testUncaughtExceptionInInitializer() throws Exception { public void testUnneededCatchBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -2014,7 +2014,7 @@ public void testUnneededCatchBlock() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -2033,7 +2033,7 @@ public void testUnneededCatchBlock() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -2056,7 +2056,7 @@ public void testUnneededCatchBlock() throws Exception { public void testUnneededCatchBlockInInitializer() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.text.ParseException;\n"); buf.append("public class E {\n"); @@ -2077,7 +2077,7 @@ public void testUnneededCatchBlockInInitializer() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.text.ParseException;\n"); buf.append("public class E {\n"); @@ -2094,7 +2094,7 @@ public void testUnneededCatchBlockInInitializer() throws Exception { public void testUnneededCatchBlockSingle() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2118,7 +2118,7 @@ public void testUnneededCatchBlockSingle() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2133,7 +2133,7 @@ public void testUnneededCatchBlockSingle() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2152,7 +2152,7 @@ public void testUnneededCatchBlockSingle() throws Exception { public void testUnneededCatchBlockBug47221() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2176,7 +2176,7 @@ public void testUnneededCatchBlockBug47221() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2191,7 +2191,7 @@ public void testUnneededCatchBlockBug47221() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2211,7 +2211,7 @@ public void testUnneededCatchBlockBug47221() throws Exception { public void testUnneededCatchBlockWithFinally() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2236,7 +2236,7 @@ public void testUnneededCatchBlockWithFinally() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2254,7 +2254,7 @@ public void testUnneededCatchBlockWithFinally() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -2276,7 +2276,7 @@ public void testUnneededCatchBlockWithFinally() throws Exception { @Test public void testUninitializedField() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2302,7 +2302,7 @@ public void testUninitializedField() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2323,7 +2323,7 @@ public void testUninitializedField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2344,7 +2344,7 @@ public void testUninitializedField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2365,7 +2365,7 @@ public void testUninitializedField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2386,7 +2386,7 @@ public void testUninitializedField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview5= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2407,7 +2407,7 @@ public void testUninitializedField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview6= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2428,7 +2428,7 @@ public void testUninitializedField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview7= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("import java.util.List;\n"); @@ -2452,7 +2452,7 @@ public void testUninitializedField() throws Exception { public void testUninitializedField_2() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo;\n"); @@ -2474,7 +2474,7 @@ public void testUninitializedField_2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo;\n"); @@ -2496,7 +2496,7 @@ public void testUninitializedField_2() throws Exception { public void testUninitializedField_3() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo;\n"); @@ -2521,7 +2521,7 @@ public void testUninitializedField_3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo;\n"); @@ -2546,7 +2546,7 @@ public void testUninitializedField_3() throws Exception { public void testUninitializedField_4() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo;\n"); @@ -2563,7 +2563,7 @@ public void testUninitializedField_4() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo;\n"); @@ -2580,7 +2580,7 @@ public void testUninitializedField_4() throws Exception { public void testUninitializedField_5() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final Object foo;\n"); @@ -2597,7 +2597,7 @@ public void testUninitializedField_5() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final Object foo;\n"); @@ -2614,7 +2614,7 @@ public void testUninitializedField_5() throws Exception { public void testUninitializedField_6() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo1;\n"); @@ -2635,7 +2635,7 @@ public void testUninitializedField_6() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo1;\n"); @@ -2656,7 +2656,7 @@ public void testUninitializedField_6() throws Exception { public void testUninitializedField_7() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo1;\n"); @@ -2676,7 +2676,7 @@ public void testUninitializedField_7() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo1;\n"); @@ -2696,7 +2696,7 @@ public void testUninitializedField_7() throws Exception { public void testUninitializedField_8() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo1;\n"); @@ -2718,7 +2718,7 @@ public void testUninitializedField_8() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int foo1;\n"); @@ -2740,7 +2740,7 @@ public void testUninitializedField_8() throws Exception { public void testUninitializedField_9() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int a;\n"); @@ -2759,7 +2759,7 @@ public void testUninitializedField_9() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int a;\n"); @@ -2771,7 +2771,7 @@ public void testUninitializedField_9() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int a;\n"); @@ -2790,7 +2790,7 @@ public void testUninitializedField_9() throws Exception { public void testUninitializedField_10() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=37872 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int b;\n"); @@ -2809,7 +2809,7 @@ public void testUninitializedField_10() throws Exception { assertNumberOfProposals(proposals, 2); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int b;\n"); @@ -2821,7 +2821,7 @@ public void testUninitializedField_10() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public final int b;\n"); @@ -2840,7 +2840,7 @@ public void testUninitializedField_10() throws Exception { public void testUninitializedField_11() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=563285 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public enum E {\n"); buf.append(" a, b, c;\n"); @@ -2863,7 +2863,7 @@ public void testUninitializedField_11() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public enum E {\n"); buf.append(" a, b, c;\n"); @@ -2886,7 +2886,7 @@ public void testUninitializedField_11() throws Exception { public void testUninitializedField_12() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=572571 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" final Class i1;\n"); @@ -2909,7 +2909,7 @@ public void testUninitializedField_12() throws Exception { } String[] expected = new String[previews.length]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" final Class i1 = new Class();\n"); @@ -2919,7 +2919,7 @@ public void testUninitializedField_12() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" final Class i1;\n"); @@ -2929,7 +2929,7 @@ public void testUninitializedField_12() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" final Class i1;\n"); @@ -2939,7 +2939,7 @@ public void testUninitializedField_12() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" final Class i1;\n"); @@ -2955,7 +2955,7 @@ public void testUninitializedField_12() throws Exception { @Test public void testUnimplementedMethods() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -2965,7 +2965,7 @@ public void testUnimplementedMethods() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public class E implements Inter{\n"); @@ -2980,7 +2980,7 @@ public void testUnimplementedMethods() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public abstract class E implements Inter{\n"); @@ -2990,7 +2990,7 @@ public void testUnimplementedMethods() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("\n"); @@ -3010,7 +3010,7 @@ public void testUnimplementedMethods() throws Exception { @Test public void testUnimplementedMethods2() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -3018,7 +3018,7 @@ public void testUnimplementedMethods2() throws Exception { buf.append("}\n"); pack2.createCompilationUnit("Inter.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.io.IOException;\n"); buf.append("public abstract class InterImpl implements Inter {\n"); @@ -3028,7 +3028,7 @@ public void testUnimplementedMethods2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.InterImpl;\n"); buf.append("public class E extends InterImpl {\n"); @@ -3043,7 +3043,7 @@ public void testUnimplementedMethods2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.InterImpl;\n"); buf.append("public abstract class E extends InterImpl {\n"); @@ -3053,7 +3053,7 @@ public void testUnimplementedMethods2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("\n"); @@ -3077,14 +3077,14 @@ public void testUnimplementedMethods2() throws Exception { @Test public void testUnimplementedMethods_bug62931() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public interface Inter {\n"); buf.append(" int foo();\n"); buf.append("}\n"); pack2.createCompilationUnit("Inter.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class A {\n"); buf.append(" int foo() { }\n"); // package visible @@ -3093,7 +3093,7 @@ public void testUnimplementedMethods_bug62931() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.A;\n"); buf.append("import test2.Inter;\n"); @@ -3109,7 +3109,7 @@ public void testUnimplementedMethods_bug62931() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.A;\n"); buf.append("import test2.Inter;\n"); @@ -3124,7 +3124,7 @@ public void testUnimplementedMethods_bug62931() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.A;\n"); buf.append("import test2.Inter;\n"); @@ -3138,7 +3138,7 @@ public void testUnimplementedMethods_bug62931() throws Exception { @Test public void testUnimplementedMethods_bug113665() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public interface F {\n"); buf.append(" public void c() throws Exception;\n"); @@ -3146,7 +3146,7 @@ public void testUnimplementedMethods_bug113665() throws Exception { buf.append("}\n"); pack2.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class A implements F {\n"); buf.append(" public void c() throws Exception, RuntimeException { }\n"); @@ -3161,7 +3161,7 @@ public void testUnimplementedMethods_bug113665() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class A implements F {\n"); buf.append(" public void c() throws Exception, RuntimeException { }\n"); @@ -3174,7 +3174,7 @@ public void testUnimplementedMethods_bug113665() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public abstract class A implements F {\n"); buf.append(" public void c() throws Exception, RuntimeException { }\n"); @@ -3187,7 +3187,7 @@ public void testUnimplementedMethods_bug113665() throws Exception { @Test public void testUnimplementedMethods_bug122906() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.util.Properties;\n"); buf.append("public interface F {\n"); @@ -3196,12 +3196,12 @@ public void testUnimplementedMethods_bug122906() throws Exception { buf.append("}\n"); pack2.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class Properties {}\n"); pack2.createCompilationUnit("Properties.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class A implements F {\n"); buf.append("}\n"); @@ -3215,7 +3215,7 @@ public void testUnimplementedMethods_bug122906() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -3233,7 +3233,7 @@ public void testUnimplementedMethods_bug122906() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public abstract class A implements F {\n"); buf.append("}\n"); @@ -3245,19 +3245,19 @@ public void testUnimplementedMethods_bug122906() throws Exception { @Test public void testUnimplementedMethods_bug123084() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class Class {}\n"); pack2.createCompilationUnit("Class.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public interface IT {\n"); buf.append(" public void foo(java.lang.Class clazz);\n"); buf.append("}\n"); pack2.createCompilationUnit("IT.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class A implements IT {\n"); buf.append("}\n"); @@ -3271,7 +3271,7 @@ public void testUnimplementedMethods_bug123084() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class A implements IT {\n"); buf.append("\n"); @@ -3283,7 +3283,7 @@ public void testUnimplementedMethods_bug123084() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public abstract class A implements IT {\n"); buf.append("}\n"); @@ -3295,7 +3295,7 @@ public void testUnimplementedMethods_bug123084() throws Exception { @Test public void testUnimplementedMethodsExtendingGenericType1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public interface Inter {\n"); @@ -3303,7 +3303,7 @@ public void testUnimplementedMethodsExtendingGenericType1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Inter.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements Inter {\n"); buf.append("}\n"); @@ -3317,7 +3317,7 @@ public void testUnimplementedMethodsExtendingGenericType1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements Inter {\n"); buf.append("}\n"); @@ -3326,7 +3326,7 @@ public void testUnimplementedMethodsExtendingGenericType1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Collection;\n"); @@ -3345,14 +3345,14 @@ public void testUnimplementedMethodsExtendingGenericType1() throws Exception { @Test public void testUnimplementedMethodsExtendingGenericType2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Inter {\n"); buf.append(" T doT(T in);\n"); buf.append("}\n"); pack1.createCompilationUnit("Inter.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements Inter {\n"); buf.append("}\n"); @@ -3366,7 +3366,7 @@ public void testUnimplementedMethodsExtendingGenericType2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements Inter {\n"); buf.append("}\n"); @@ -3375,7 +3375,7 @@ public void testUnimplementedMethodsExtendingGenericType2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements Inter {\n"); buf.append("\n"); @@ -3394,7 +3394,7 @@ public void testUnimplementedMethodsExtendingGenericType2() throws Exception { @Test public void testUnimplementedMethodsWithTypeParameters() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public interface Inter {\n"); @@ -3403,7 +3403,7 @@ public void testUnimplementedMethodsWithTypeParameters() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Inter.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements Inter {\n"); buf.append("}\n"); @@ -3417,7 +3417,7 @@ public void testUnimplementedMethodsWithTypeParameters() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements Inter {\n"); buf.append("}\n"); @@ -3426,7 +3426,7 @@ public void testUnimplementedMethodsWithTypeParameters() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Collection;\n"); @@ -3450,7 +3450,7 @@ public void testUnimplementedMethodsWithTypeParameters() throws Exception { public void testUnimplementedMethodsWithTypeParameters2() throws Exception { // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=330241 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public interface Inter {\n"); @@ -3459,7 +3459,7 @@ public void testUnimplementedMethodsWithTypeParameters2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Inter.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E implements Inter {\n"); @@ -3477,7 +3477,7 @@ public void testUnimplementedMethodsWithTypeParameters2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public abstract class E implements Inter {\n"); @@ -3490,7 +3490,7 @@ public void testUnimplementedMethodsWithTypeParameters2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E implements Inter {\n"); @@ -3510,7 +3510,7 @@ public void testUnimplementedMethodsWithTypeParameters2() throws Exception { @Test public void testUnimplementedEnumConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public enum E {\n"); buf.append(" E(1, \"E\");\n"); @@ -3526,7 +3526,7 @@ public void testUnimplementedEnumConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(1); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public enum E {\n"); buf.append(" E(1, \"E\");\n"); @@ -3541,7 +3541,7 @@ public void testUnimplementedEnumConstructor() throws Exception { @Test public void testUnimplementedMethodsInEnum() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("enum TestEnum implements IA {\n"); buf.append(" test1,test2;\n"); @@ -3558,7 +3558,7 @@ public void testUnimplementedMethodsInEnum() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("enum TestEnum implements IA {\n"); buf.append(" test1,test2;\n"); @@ -3577,7 +3577,7 @@ public void testUnimplementedMethodsInEnum() throws Exception { @Test public void testUnimplementedMethodsInEnumConstant1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("enum TestEnum {\n"); buf.append(" A {\n"); @@ -3598,7 +3598,7 @@ public void testUnimplementedMethodsInEnumConstant1() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("enum TestEnum {\n"); buf.append(" A {\n"); @@ -3622,7 +3622,7 @@ public void testUnimplementedMethodsInEnumConstant1() throws Exception { @Test public void testUnimplementedMethodsInEnumConstant2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("enum TestEnum {\n"); buf.append(" A {\n"); @@ -3639,7 +3639,7 @@ public void testUnimplementedMethodsInEnumConstant2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("enum TestEnum {\n"); buf.append(" A {\n"); @@ -3664,7 +3664,7 @@ public void testUnimplementedMethodsInEnumConstant2() throws Exception { @Test public void testUnimplementedMethodsInEnumConstant3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("enum TestEnum implements Runnable {\n"); buf.append(" A;\n"); @@ -3679,7 +3679,7 @@ public void testUnimplementedMethodsInEnumConstant3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("enum TestEnum implements Runnable {\n"); buf.append(" A {\n"); @@ -3705,7 +3705,7 @@ public void testUnimplementedMethodsWithAnnotations() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import java.lang.annotation.Retention;\n"); @@ -3744,7 +3744,7 @@ public void testUnimplementedMethodsWithAnnotations() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import java.lang.annotation.Retention;\n"); @@ -3788,7 +3788,7 @@ public void testUnimplementedMethodsWithAnnotations() throws Exception { public void testUnimplementedMethodsWithAnnotations2() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=387940 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class A implements I {\n"); buf.append("}\n"); @@ -3806,7 +3806,7 @@ public void testUnimplementedMethodsWithAnnotations2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class A implements I {\n"); buf.append("\n"); @@ -3832,21 +3832,21 @@ public void testUnimplementedMethodsWithAnnotations3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack0= fSourceFolder.createPackageFragment("annots", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); buf.append("public @interface NonNull {}\n"); pack0.createCompilationUnit("NonNull.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); buf.append("public @interface Nullable {}\n"); pack0.createCompilationUnit("Nullable.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); @@ -3854,12 +3854,12 @@ public void testUnimplementedMethodsWithAnnotations3() throws Exception { pack0.createCompilationUnit("NonNullByDefault.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@annots.NonNullByDefault\n"); buf.append("package test;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import annots.*;\n"); @@ -3879,7 +3879,7 @@ public void testUnimplementedMethodsWithAnnotations3() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import annots.*;\n"); @@ -3911,21 +3911,21 @@ public void testUnimplementedMethodsWithAnnotations4() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("annots", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); buf.append("public @interface NonNull {}\n"); pack0.createCompilationUnit("NonNull.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); buf.append("public @interface Nullable {}\n"); pack0.createCompilationUnit("Nullable.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); @@ -3933,12 +3933,12 @@ public void testUnimplementedMethodsWithAnnotations4() throws Exception { pack0.createCompilationUnit("NonNullByDefault.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@annots.NonNullByDefault(true)\n"); buf.append("package test;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import annots.*;\n"); @@ -3959,7 +3959,7 @@ public void testUnimplementedMethodsWithAnnotations4() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import annots.*;\n"); @@ -3992,21 +3992,21 @@ public void testUnimplementedMethodsWithAnnotations5() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("annots", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); buf.append("public @interface NonNull {}\n"); pack0.createCompilationUnit("NonNull.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); buf.append("public @interface Nullable {}\n"); pack0.createCompilationUnit("Nullable.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS)\n"); @@ -4016,7 +4016,7 @@ public void testUnimplementedMethodsWithAnnotations5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // no package default - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import annots.*;\n"); @@ -4039,7 +4039,7 @@ public void testUnimplementedMethodsWithAnnotations5() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import annots.*;\n"); @@ -4067,7 +4067,7 @@ public void testUnimplementedMethodsWithAnnotations5() throws Exception { public void testUnimplementedMethodsWithCovariantReturn() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=272657 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" interface Interface1 { Object getX(); }\n"); @@ -4084,7 +4084,7 @@ public void testUnimplementedMethodsWithCovariantReturn() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" interface Interface1 { Object getX(); }\n"); @@ -4098,7 +4098,7 @@ public void testUnimplementedMethodsWithCovariantReturn() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Test {\n"); buf.append(" interface Interface1 { Object getX(); }\n"); @@ -4115,7 +4115,7 @@ public void testUnimplementedMethodsWithCovariantReturn() throws Exception { public void testUnimplementedMethodsWithSubsignature() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=272657 , https://bugs.eclipse.org/bugs/show_bug.cgi?id=424509#c6 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -4136,7 +4136,7 @@ public void testUnimplementedMethodsWithSubsignature() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -4161,7 +4161,7 @@ public void testUnimplementedMethodsWithSubsignature() throws Exception { public void testUnimplementedMethodsWithSubsignature2() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=272657 , https://bugs.eclipse.org/bugs/show_bug.cgi?id=424509#c6 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -4180,7 +4180,7 @@ public void testUnimplementedMethodsWithSubsignature2() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -4203,7 +4203,7 @@ public void testUnimplementedMethodsWithSubsignature2() throws Exception { public void testUnimplementedMethodsWithSubsignature3() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=272657 , https://bugs.eclipse.org/bugs/show_bug.cgi?id=424509#c6 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -4222,7 +4222,7 @@ public void testUnimplementedMethodsWithSubsignature3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -4244,7 +4244,7 @@ public void testUnimplementedMethodsWithSubsignature3() throws Exception { @Test public void testUnitializedVariable() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4266,7 +4266,7 @@ public void testUnitializedVariable() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4284,7 +4284,7 @@ public void testUnitializedVariable() throws Exception { @Test public void testUndefinedConstructorInDefaultConstructor1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(Runnable runnable) {\n"); @@ -4292,7 +4292,7 @@ public void testUndefinedConstructorInDefaultConstructor1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("}\n"); @@ -4306,7 +4306,7 @@ public void testUndefinedConstructorInDefaultConstructor1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("\n"); @@ -4320,7 +4320,7 @@ public void testUndefinedConstructorInDefaultConstructor1() throws Exception { @Test public void testUndefinedConstructorInDefaultConstructor2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class F {\n"); @@ -4332,7 +4332,7 @@ public void testUndefinedConstructorInDefaultConstructor2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("}\n"); @@ -4346,7 +4346,7 @@ public void testUndefinedConstructorInDefaultConstructor2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("\n"); @@ -4359,7 +4359,7 @@ public void testUndefinedConstructorInDefaultConstructor2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -4378,7 +4378,7 @@ public void testUndefinedConstructorInDefaultConstructor2() throws Exception { @Test public void testUndefinedConstructorWithGenericSuperClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(Runnable runnable) {\n"); @@ -4386,7 +4386,7 @@ public void testUndefinedConstructorWithGenericSuperClass() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("}\n"); @@ -4400,7 +4400,7 @@ public void testUndefinedConstructorWithGenericSuperClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("\n"); @@ -4421,7 +4421,7 @@ public void testUndefinedConstructorWithLineBreaks() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(Runnable runnable, boolean isGreen, boolean isBlue, boolean isRed) {\n"); @@ -4429,7 +4429,7 @@ public void testUndefinedConstructorWithLineBreaks() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("}\n"); @@ -4443,7 +4443,7 @@ public void testUndefinedConstructorWithLineBreaks() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("\n"); @@ -4465,7 +4465,7 @@ public void testUndefinedConstructorWithLineBreaks() throws Exception { @Test public void testUndefinedConstructorWithEnclosing1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public class SubF {\n"); @@ -4475,7 +4475,7 @@ public void testUndefinedConstructorWithEnclosing1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class SubE extends F.SubF {\n"); @@ -4491,7 +4491,7 @@ public void testUndefinedConstructorWithEnclosing1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class SubE extends F.SubF {\n"); @@ -4507,7 +4507,7 @@ public void testUndefinedConstructorWithEnclosing1() throws Exception { @Test public void testUndefinedConstructorWithEnclosing2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static class SubF {\n"); @@ -4517,7 +4517,7 @@ public void testUndefinedConstructorWithEnclosing2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class SubE extends F.SubF {\n"); @@ -4533,7 +4533,7 @@ public void testUndefinedConstructorWithEnclosing2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class SubE extends F.SubF {\n"); @@ -4549,7 +4549,7 @@ public void testUndefinedConstructorWithEnclosing2() throws Exception { @Test public void testUndefinedConstructorWithEnclosingInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public class SubF {\n"); @@ -4559,7 +4559,7 @@ public void testUndefinedConstructorWithEnclosingInGeneric() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F.SubF {\n"); buf.append("}\n"); @@ -4573,7 +4573,7 @@ public void testUndefinedConstructorWithEnclosingInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F.SubF {\n"); buf.append("\n"); @@ -4587,7 +4587,7 @@ public void testUndefinedConstructorWithEnclosingInGeneric() throws Exception { @Test public void testUndefinedConstructorWithEnclosing3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static class SubF {\n"); @@ -4607,7 +4607,7 @@ public void testUndefinedConstructorWithEnclosing3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static class SubF {\n"); @@ -4628,7 +4628,7 @@ public void testUndefinedConstructorWithEnclosing3() throws Exception { @Test public void testNotVisibleConstructorInDefaultConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" private F() {\n"); @@ -4638,7 +4638,7 @@ public void testNotVisibleConstructorInDefaultConstructor() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("}\n"); @@ -4652,7 +4652,7 @@ public void testNotVisibleConstructorInDefaultConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("\n"); @@ -4666,7 +4666,7 @@ public void testNotVisibleConstructorInDefaultConstructor() throws Exception { @Test public void testUnhandledExceptionInDefaultConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class F {\n"); @@ -4675,7 +4675,7 @@ public void testUnhandledExceptionInDefaultConstructor() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append("}\n"); @@ -4689,7 +4689,7 @@ public void testUnhandledExceptionInDefaultConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -4710,7 +4710,7 @@ public void testUnusedPrivateField() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -4724,13 +4724,13 @@ public void testUnusedPrivateField() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -4755,7 +4755,7 @@ public void testUnusedPrivateField1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count, color= count;\n"); @@ -4769,14 +4769,14 @@ public void testUnusedPrivateField1() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count, color= count;\n"); @@ -4801,7 +4801,7 @@ public void testUnusedPrivateField2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count= 0;\n"); @@ -4818,7 +4818,7 @@ public void testUnusedPrivateField2() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4826,7 +4826,7 @@ public void testUnusedPrivateField2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count= 0;\n"); @@ -4852,7 +4852,7 @@ public void testUnusedPrivateField3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private E e= new E();\n"); @@ -4873,7 +4873,7 @@ public void testUnusedPrivateField3() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private E e= new E();\n"); @@ -4882,7 +4882,7 @@ public void testUnusedPrivateField3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private E e= new E();\n"); @@ -4912,7 +4912,7 @@ public void testUnusedPrivateFieldBug328481() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -4934,7 +4934,7 @@ public void testUnusedPrivateFieldBug328481() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(){;\n"); @@ -4944,7 +4944,7 @@ public void testUnusedPrivateFieldBug328481() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -4976,7 +4976,7 @@ public void testUnusedVariable() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -4995,7 +4995,7 @@ public void testUnusedVariable() throws Exception { assertCorrectLabels(proposals); String expected[]=new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5008,7 +5008,7 @@ public void testUnusedVariable() throws Exception { buf.append("}\n"); expected[0]=buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -5030,7 +5030,7 @@ public void testUnusedVariable1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Object[] foo() {\n"); @@ -5048,7 +5048,7 @@ public void testUnusedVariable1() throws Exception { assertCorrectLabels(proposals); String[] expected=new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Object[] foo() {\n"); @@ -5059,7 +5059,7 @@ public void testUnusedVariable1() throws Exception { buf.append("}\n"); expected[0]=buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private Object[] foo() {\n"); @@ -5080,7 +5080,7 @@ public void testUnusedVariable2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5097,7 +5097,7 @@ public void testUnusedVariable2() throws Exception { assertCorrectLabels(proposals); String[] expected=new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5107,7 +5107,7 @@ public void testUnusedVariable2() throws Exception { buf.append("}\n"); expected[0]=buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5129,7 +5129,7 @@ public void testUnusedVariable4() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -5148,7 +5148,7 @@ public void testUnusedVariable4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -5167,7 +5167,7 @@ public void testUnusedVariable5() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" private final String c=\"Test\";\n"); @@ -5181,13 +5181,13 @@ public void testUnusedVariable5() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected=new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append("}\n"); expected[0]=buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" private final String c=\"Test\";\n"); @@ -5210,7 +5210,7 @@ public void testUnusedVariable6() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" private String c=String.valueOf(true),d=\"test\";\n"); @@ -5225,7 +5225,7 @@ public void testUnusedVariable6() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" private String d=\"test\";\n"); @@ -5233,7 +5233,7 @@ public void testUnusedVariable6() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" private String c=String.valueOf(true),d=\"test\";\n"); @@ -5259,7 +5259,7 @@ public void testUnusedVariable7() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" void test(){\n"); @@ -5278,7 +5278,7 @@ public void testUnusedVariable7() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" void test(){\n"); @@ -5291,7 +5291,7 @@ public void testUnusedVariable7() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" void test(){\n"); @@ -5311,7 +5311,7 @@ public void testUnusedVariable8() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5332,7 +5332,7 @@ public void testUnusedVariable8() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5346,7 +5346,7 @@ public void testUnusedVariable8() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5370,7 +5370,7 @@ public void testUnusedVariableBug328481_1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5391,7 +5391,7 @@ public void testUnusedVariableBug328481_1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5401,7 +5401,7 @@ public void testUnusedVariableBug328481_1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5422,7 +5422,7 @@ public void testUnusedVariableBug328481_2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(boolean b) {\n"); @@ -5441,7 +5441,7 @@ public void testUnusedVariableBug328481_2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(boolean b) {\n"); @@ -5452,7 +5452,7 @@ public void testUnusedVariableBug328481_2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(boolean b) {\n"); @@ -5474,7 +5474,7 @@ public void testUnusedVariableBug513404_1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5489,7 +5489,7 @@ public void testUnusedVariableBug513404_1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5497,7 +5497,7 @@ public void testUnusedVariableBug513404_1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5520,7 +5520,7 @@ public void testUnusedVariableBug513404_2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5535,7 +5535,7 @@ public void testUnusedVariableBug513404_2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5543,7 +5543,7 @@ public void testUnusedVariableBug513404_2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5562,7 +5562,7 @@ public void testUnusedVariableBug513404_3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5577,7 +5577,7 @@ public void testUnusedVariableBug513404_3() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5585,7 +5585,7 @@ public void testUnusedVariableBug513404_3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object o) {\n"); @@ -5607,7 +5607,7 @@ public void testUnusedVariableBug513404_4() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5623,7 +5623,7 @@ public void testUnusedVariableBug513404_4() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5632,7 +5632,7 @@ public void testUnusedVariableBug513404_4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5657,7 +5657,7 @@ public void testUnusedVariableAsSwitchStatement() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" void test(int i){\n"); @@ -5679,7 +5679,7 @@ public void testUnusedVariableAsSwitchStatement() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" void test(int i){\n"); @@ -5695,7 +5695,7 @@ public void testUnusedVariableAsSwitchStatement() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B {\n"); buf.append(" void test(int i){\n"); @@ -5744,7 +5744,7 @@ public void testUnusedVariableWithSideEffectAssignments() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5761,7 +5761,7 @@ public void testUnusedVariableWithSideEffectAssignments() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5770,7 +5770,7 @@ public void testUnusedVariableWithSideEffectAssignments() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5791,7 +5791,7 @@ public void testUnusedVariableWithSideEffectAssignments2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5812,7 +5812,7 @@ public void testUnusedVariableWithSideEffectAssignments2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5821,7 +5821,7 @@ public void testUnusedVariableWithSideEffectAssignments2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5845,7 +5845,7 @@ public void testUnusedVariableWithSideEffectAssignments3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5864,7 +5864,7 @@ public void testUnusedVariableWithSideEffectAssignments3() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5876,7 +5876,7 @@ public void testUnusedVariableWithSideEffectAssignments3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5902,7 +5902,7 @@ public void testUnusedVariableWithSideEffectAssignments4() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5921,7 +5921,7 @@ public void testUnusedVariableWithSideEffectAssignments4() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5933,7 +5933,7 @@ public void testUnusedVariableWithSideEffectAssignments4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5957,7 +5957,7 @@ public void testUnusedParam() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(Object str) {\n"); @@ -5976,7 +5976,7 @@ public void testUnusedParam() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -5988,7 +5988,7 @@ public void testUnusedParam() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -6014,7 +6014,7 @@ public void testUnusedParam2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -6032,7 +6032,7 @@ public void testUnusedParam2() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -6043,7 +6043,7 @@ public void testUnusedParam2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -6066,7 +6066,7 @@ public void testUnusedParamBug328481() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(int a) {\n"); @@ -6087,7 +6087,7 @@ public void testUnusedParamBug328481() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -6097,7 +6097,7 @@ public void testUnusedParamBug328481() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -6124,7 +6124,7 @@ public void testUnusedPrivateMethod() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int fCount;\n"); @@ -6143,7 +6143,7 @@ public void testUnusedPrivateMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int fCount;\n"); @@ -6158,7 +6158,7 @@ public void testUnusedPrivateConstructor() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -6177,7 +6177,7 @@ public void testUnusedPrivateConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -6193,7 +6193,7 @@ public void testUnusedPrivateType() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private class F {\n"); @@ -6212,7 +6212,7 @@ public void testUnusedPrivateType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -6228,7 +6228,7 @@ public void testUnnecessaryCast1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -6245,7 +6245,7 @@ public void testUnnecessaryCast1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -6262,7 +6262,7 @@ public void testUnnecessaryCast2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -6279,7 +6279,7 @@ public void testUnnecessaryCast2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -6296,7 +6296,7 @@ public void testUnnecessaryCast3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -6313,7 +6313,7 @@ public void testUnnecessaryCast3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -6330,7 +6330,7 @@ public void testUnnecessaryCastBug335173_1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer n) {\n"); @@ -6347,7 +6347,7 @@ public void testUnnecessaryCastBug335173_1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer n) {\n"); @@ -6364,7 +6364,7 @@ public void testUnnecessaryCastBug335173_2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer n) {\n"); @@ -6381,7 +6381,7 @@ public void testUnnecessaryCastBug335173_2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer n) {\n"); @@ -6398,7 +6398,7 @@ public void testSuperfluousSemicolon() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -6415,7 +6415,7 @@ public void testSuperfluousSemicolon() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -6432,7 +6432,7 @@ public void testIndirectStaticAccess1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment other= fSourceFolder.createPackageFragment("other", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package other;\n"); buf.append("public class A {\n"); buf.append(" public static final int CONST=1;\n"); @@ -6440,14 +6440,14 @@ public void testIndirectStaticAccess1() throws Exception { other.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B extends other.A {\n"); buf.append("}\n"); pack0.createCompilationUnit("B.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import pack.B;\n"); buf.append("public class E {\n"); @@ -6465,7 +6465,7 @@ public void testIndirectStaticAccess1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import other.A;\n"); buf.append("import pack.B;\n"); @@ -6484,7 +6484,7 @@ public void testIndirectStaticAccess2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment other= fSourceFolder.createPackageFragment("other", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package other;\n"); buf.append("public class A {\n"); buf.append(" public static int foo() {\n"); @@ -6494,14 +6494,14 @@ public void testIndirectStaticAccess2() throws Exception { other.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class B extends other.A {\n"); buf.append("}\n"); pack0.createCompilationUnit("B.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -6518,7 +6518,7 @@ public void testIndirectStaticAccess2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import other.A;\n"); @@ -6539,14 +6539,14 @@ public void testIndirectStaticAccess_bug40880() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class FileType {\n"); buf.append(" public String extension;\n"); buf.append("}\n"); pack1.createCompilationUnit("FileType.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface ToolConfigurationSettingsConstants {\n"); buf.append(" FileType FILE_TYPE = null;\n"); @@ -6554,13 +6554,13 @@ public void testIndirectStaticAccess_bug40880() throws Exception { pack1.createCompilationUnit("ToolConfigurationSettingsConstants.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface ToolUserSettingsConstants extends ToolConfigurationSettingsConstants {\n"); buf.append("}\n"); pack1.createCompilationUnit("ToolUserSettingsConstants.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6578,7 +6578,7 @@ public void testIndirectStaticAccess_bug40880() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -6596,14 +6596,14 @@ public void testIndirectStaticAccess_bug32022() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class StaticField {\n"); buf.append(" public boolean flag;\n"); buf.append("}\n"); pack1.createCompilationUnit("StaticField.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ConstClass {\n"); buf.append(" public static StaticField staticField = new StaticField();\n"); @@ -6611,7 +6611,7 @@ public void testIndirectStaticAccess_bug32022() throws Exception { pack1.createCompilationUnit("ConstClass.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(ConstClass constclass) {\n"); @@ -6629,7 +6629,7 @@ public void testIndirectStaticAccess_bug32022() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(ConstClass constclass) {\n"); @@ -6641,7 +6641,7 @@ public void testIndirectStaticAccess_bug32022() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ConstClass {\n"); buf.append(" public StaticField staticField = new StaticField();\n"); @@ -6658,7 +6658,7 @@ public void testIndirectStaticAccess_bug307407() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final String localString = new MyClass().getMyString();\n"); @@ -6678,7 +6678,7 @@ public void testIndirectStaticAccess_bug307407() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final String localString = MyClass.getMyString();\n"); @@ -6693,7 +6693,7 @@ public void testIndirectStaticAccess_bug307407() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final String localString = new MyClass().getMyString();\n"); @@ -6716,7 +6716,7 @@ public void testUnnecessaryInstanceof1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(String b) {\n"); @@ -6733,7 +6733,7 @@ public void testUnnecessaryInstanceof1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(String b) {\n"); @@ -6750,7 +6750,7 @@ public void testUnnecessaryInstanceof2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String b) {\n"); @@ -6769,7 +6769,7 @@ public void testUnnecessaryInstanceof2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String b) {\n"); @@ -6788,7 +6788,7 @@ public void testUnnecessaryThrownException1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -6807,7 +6807,7 @@ public void testUnnecessaryThrownException1() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -6819,7 +6819,7 @@ public void testUnnecessaryThrownException1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E {\n"); @@ -6844,7 +6844,7 @@ public void testUnnecessaryThrownException2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -6867,7 +6867,7 @@ public void testUnnecessaryThrownException2() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -6883,7 +6883,7 @@ public void testUnnecessaryThrownException2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -6911,7 +6911,7 @@ public void testUnnecessaryThrownException3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -6937,7 +6937,7 @@ public void testUnnecessaryThrownException3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -6963,7 +6963,7 @@ public void testUnqualifiedFieldAccess1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -6979,7 +6979,7 @@ public void testUnqualifiedFieldAccess1() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -6998,15 +6998,15 @@ public void testUnqualifiedFieldAccess2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); - buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public int count;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private F f= new F();\n"); @@ -7022,7 +7022,7 @@ public void testUnqualifiedFieldAccess2() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private F f= new F();\n"); @@ -7042,15 +7042,15 @@ public void testUnqualifiedFieldAccess3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); - buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public void setCount(int i) {}\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private F f= new F();\n"); @@ -7066,7 +7066,7 @@ public void testUnqualifiedFieldAccess3() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private F f= new F();\n"); @@ -7086,7 +7086,7 @@ public void testUnqualifiedFieldAccess4() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -7106,7 +7106,7 @@ public void testUnqualifiedFieldAccess4() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int count;\n"); @@ -7130,14 +7130,14 @@ public void testUnqualifiedFieldAccess_bug50960() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" private int count;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" private int count;\n"); @@ -7153,7 +7153,7 @@ public void testUnqualifiedFieldAccess_bug50960() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" private int count;\n"); @@ -7173,14 +7173,14 @@ public void testUnqualifiedFieldAccess_bug88313() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" protected Object someObject;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public void foo() {\n"); @@ -7199,7 +7199,7 @@ public void testUnqualifiedFieldAccess_bug88313() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public void foo() {\n"); @@ -7260,7 +7260,7 @@ public void testUnqualifiedFieldAccess_bug138325_1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int i;\n"); @@ -7276,7 +7276,7 @@ public void testUnqualifiedFieldAccess_bug138325_1() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int i;\n"); @@ -7296,7 +7296,7 @@ public void testUnqualifiedFieldAccess_bug138325_2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int i;\n"); @@ -7316,7 +7316,7 @@ public void testUnqualifiedFieldAccess_bug138325_2() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int i;\n"); @@ -7340,14 +7340,14 @@ public void testUnqualifiedFieldAccessWithGenerics() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" protected T someObject;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public void foo() {\n"); @@ -7366,7 +7366,7 @@ public void testUnqualifiedFieldAccessWithGenerics() throws Exception { assertCorrectLabels(proposals); String[] expecteds=new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public void foo() {\n"); @@ -7546,7 +7546,7 @@ public void testSetParenteses1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object x) {\n"); @@ -7564,7 +7564,7 @@ public void testSetParenteses1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object x) {\n"); @@ -7584,7 +7584,7 @@ public void testSetParenteses2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7601,7 +7601,7 @@ public void testSetParenteses2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7619,7 +7619,7 @@ public void testUnnecessaryElse1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7640,7 +7640,7 @@ public void testUnnecessaryElse1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7660,7 +7660,7 @@ public void testUnnecessaryElse2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7682,7 +7682,7 @@ public void testUnnecessaryElse2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7704,7 +7704,7 @@ public void testUnnecessaryElse3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7724,7 +7724,7 @@ public void testUnnecessaryElse3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7745,7 +7745,7 @@ public void testUnnecessaryElse4() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7767,7 +7767,7 @@ public void testUnnecessaryElse4() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7792,7 +7792,7 @@ public void testUnnecessaryElse5() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7816,7 +7816,7 @@ public void testUnnecessaryElse5() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -7842,7 +7842,7 @@ public void testInterfaceExtendsClass() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E extends List {\n"); @@ -7857,7 +7857,7 @@ public void testInterfaceExtendsClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E implements List {\n"); @@ -7867,7 +7867,7 @@ public void testInterfaceExtendsClass() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public interface E extends List {\n"); @@ -7884,7 +7884,7 @@ public void testRemoveUnreachableCodeStmt() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7905,7 +7905,7 @@ public void testRemoveUnreachableCodeStmt() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(int x) {\n"); @@ -7922,7 +7922,7 @@ public void testRemoveUnreachableCodeStmt() throws Exception { @Test public void testRemoveUnreachableCodeStmt2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public String getName() {\n"); @@ -7944,7 +7944,7 @@ public void testRemoveUnreachableCodeStmt2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public String getName() {\n"); @@ -7964,7 +7964,7 @@ public void testRemoveUnreachableCodeStmt2() throws Exception { @Test public void testRemoveUnreachableCodeWhile() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo() {\n"); @@ -7984,7 +7984,7 @@ public void testRemoveUnreachableCodeWhile() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo() {\n"); @@ -8001,7 +8001,7 @@ public void testRemoveDeadCodeIfThen() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8022,7 +8022,7 @@ public void testRemoveDeadCodeIfThen() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8034,7 +8034,7 @@ public void testRemoveDeadCodeIfThen() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8058,7 +8058,7 @@ public void testRemoveDeadCodeIfThen2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8082,7 +8082,7 @@ public void testRemoveDeadCodeIfThen2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8097,7 +8097,7 @@ public void testRemoveDeadCodeIfThen2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8124,7 +8124,7 @@ public void testRemoveDeadCodeIfThen3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8148,7 +8148,7 @@ public void testRemoveDeadCodeIfThen3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8164,7 +8164,7 @@ public void testRemoveDeadCodeIfThen3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8191,7 +8191,7 @@ public void testRemoveDeadCodeIfThen4() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8213,7 +8213,7 @@ public void testRemoveDeadCodeIfThen4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8229,7 +8229,7 @@ public void testRemoveDeadCodeIfThen4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8254,7 +8254,7 @@ public void testRemoveDeadCodeIfThen5() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8276,7 +8276,7 @@ public void testRemoveDeadCodeIfThen5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8291,7 +8291,7 @@ public void testRemoveDeadCodeIfThen5() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8316,7 +8316,7 @@ public void testRemoveDeadCodeIfThenSwitch() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8347,7 +8347,7 @@ public void testRemoveDeadCodeIfThenSwitch() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8368,7 +8368,7 @@ public void testRemoveDeadCodeIfThenSwitch() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8402,7 +8402,7 @@ public void testRemoveDeadCodeIfElse() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8423,7 +8423,7 @@ public void testRemoveDeadCodeIfElse() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -8435,7 +8435,7 @@ public void testRemoveDeadCodeIfElse() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8459,7 +8459,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo() {\n"); @@ -8477,7 +8477,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo() {\n"); @@ -8489,7 +8489,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8500,7 +8500,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public boolean foo() {\n"); @@ -8519,7 +8519,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" public boolean foo() {\n"); @@ -8538,7 +8538,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public boolean foo() {\n"); @@ -8547,7 +8547,7 @@ public void testRemoveDeadCodeAfterIf() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" public boolean foo() {\n"); @@ -8565,7 +8565,7 @@ public void testRemoveDeadCodeAfterIf2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8585,7 +8585,7 @@ public void testRemoveDeadCodeAfterIf2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8600,7 +8600,7 @@ public void testRemoveDeadCodeAfterIf2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8623,7 +8623,7 @@ public void testRemoveDeadCodeAfterIf3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8643,7 +8643,7 @@ public void testRemoveDeadCodeAfterIf3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8658,7 +8658,7 @@ public void testRemoveDeadCodeAfterIf3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8674,7 +8674,7 @@ public void testRemoveDeadCodeAfterIf3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8698,7 +8698,7 @@ public void testRemoveDeadCodeAfterIf4() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8718,7 +8718,7 @@ public void testRemoveDeadCodeAfterIf4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8733,7 +8733,7 @@ public void testRemoveDeadCodeAfterIf4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8749,7 +8749,7 @@ public void testRemoveDeadCodeAfterIf4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8773,7 +8773,7 @@ public void testRemoveDeadCodeAfterIf5() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8793,7 +8793,7 @@ public void testRemoveDeadCodeAfterIf5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8808,7 +8808,7 @@ public void testRemoveDeadCodeAfterIf5() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8831,7 +8831,7 @@ public void testRemoveDeadCodeAfterIf6() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8851,7 +8851,7 @@ public void testRemoveDeadCodeAfterIf6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8866,7 +8866,7 @@ public void testRemoveDeadCodeAfterIf6() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8889,7 +8889,7 @@ public void testRemoveDeadCodeAfterIf7() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8909,7 +8909,7 @@ public void testRemoveDeadCodeAfterIf7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -8924,7 +8924,7 @@ public void testRemoveDeadCodeAfterIf7() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -8947,7 +8947,7 @@ public void testRemoveDeadCodeAfterIf8() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1) {\n"); @@ -8967,7 +8967,7 @@ public void testRemoveDeadCodeAfterIf8() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1) {\n"); @@ -8982,7 +8982,7 @@ public void testRemoveDeadCodeAfterIf8() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9005,7 +9005,7 @@ public void testRemoveDeadCodeAfterIf9() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9025,7 +9025,7 @@ public void testRemoveDeadCodeAfterIf9() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9040,7 +9040,7 @@ public void testRemoveDeadCodeAfterIf9() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9056,7 +9056,7 @@ public void testRemoveDeadCodeAfterIf9() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9080,7 +9080,7 @@ public void testRemoveDeadCodeAfterIf10() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9100,7 +9100,7 @@ public void testRemoveDeadCodeAfterIf10() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9115,7 +9115,7 @@ public void testRemoveDeadCodeAfterIf10() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9138,7 +9138,7 @@ public void testRemoveDeadCodeAfterIf11() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1) {\n"); @@ -9158,7 +9158,7 @@ public void testRemoveDeadCodeAfterIf11() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1) {\n"); @@ -9173,7 +9173,7 @@ public void testRemoveDeadCodeAfterIf11() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9196,7 +9196,7 @@ public void testRemoveDeadCodeAfterIf12() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2, boolean b3) {\n"); @@ -9216,7 +9216,7 @@ public void testRemoveDeadCodeAfterIf12() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2, boolean b3) {\n"); @@ -9231,7 +9231,7 @@ public void testRemoveDeadCodeAfterIf12() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9254,7 +9254,7 @@ public void testRemoveDeadCodeAfterIf13() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9274,7 +9274,7 @@ public void testRemoveDeadCodeAfterIf13() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean foo(boolean b1, boolean b2) {\n"); @@ -9289,7 +9289,7 @@ public void testRemoveDeadCodeAfterIf13() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9312,7 +9312,7 @@ public void testRemoveDeadCodeConditional() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -9329,7 +9329,7 @@ public void testRemoveDeadCodeConditional() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -9341,7 +9341,7 @@ public void testRemoveDeadCodeConditional() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9361,7 +9361,7 @@ public void testRemoveDeadCodeConditional2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9376,7 +9376,7 @@ public void testRemoveDeadCodeConditional2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9396,7 +9396,7 @@ public void testRemoveDeadCodeConditional3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9410,7 +9410,7 @@ public void testRemoveDeadCodeConditional3() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9429,7 +9429,7 @@ public void testRemoveDeadCodeMultiStatements() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9450,7 +9450,7 @@ public void testRemoveDeadCodeMultiStatements() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9462,7 +9462,7 @@ public void testRemoveDeadCodeMultiStatements() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"unused\")\n"); @@ -9486,7 +9486,7 @@ public void testRemoveUnreachableCodeMultiStatementsSwitch() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9514,7 +9514,7 @@ public void testRemoveUnreachableCodeMultiStatementsSwitch() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9540,7 +9540,7 @@ public void testUnusedObjectAllocation1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9560,7 +9560,7 @@ public void testUnusedObjectAllocation1() throws Exception { assertNumberOfProposals(proposals, 6); String[] expected= new String[5]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9573,7 +9573,7 @@ public void testUnusedObjectAllocation1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9585,7 +9585,7 @@ public void testUnusedObjectAllocation1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9599,7 +9599,7 @@ public void testUnusedObjectAllocation1() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9612,7 +9612,7 @@ public void testUnusedObjectAllocation1() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9637,7 +9637,7 @@ public void testUnusedObjectAllocation2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9654,7 +9654,7 @@ public void testUnusedObjectAllocation2() throws Exception { assertNumberOfProposals(proposals, 7); String[] expected= new String[6]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9664,7 +9664,7 @@ public void testUnusedObjectAllocation2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9673,7 +9673,7 @@ public void testUnusedObjectAllocation2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9684,7 +9684,7 @@ public void testUnusedObjectAllocation2() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9694,7 +9694,7 @@ public void testUnusedObjectAllocation2() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9704,7 +9704,7 @@ public void testUnusedObjectAllocation2() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9726,7 +9726,7 @@ public void testUnusedObjectAllocation3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9744,7 +9744,7 @@ public void testUnusedObjectAllocation3() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 6); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9766,7 +9766,7 @@ public void testUnnessecaryNLSTag1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9781,7 +9781,7 @@ public void testUnnessecaryNLSTag1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9789,7 +9789,7 @@ public void testUnnessecaryNLSTag1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("@SuppressWarnings(\"nls\")\n"); @@ -9808,7 +9808,7 @@ public void testUnnessecaryNLSTag2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9823,7 +9823,7 @@ public void testUnnessecaryNLSTag2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -9831,7 +9831,7 @@ public void testUnnessecaryNLSTag2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("@SuppressWarnings(\"nls\")\n"); @@ -9850,7 +9850,7 @@ public void testUnnessecaryNLSTag3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9866,7 +9866,7 @@ public void testUnnessecaryNLSTag3() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9875,7 +9875,7 @@ public void testUnnessecaryNLSTag3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"nls\")\n"); @@ -9895,7 +9895,7 @@ public void testUnnessecaryNLSTag4() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9911,7 +9911,7 @@ public void testUnnessecaryNLSTag4() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9920,7 +9920,7 @@ public void testUnnessecaryNLSTag4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"nls\")\n"); @@ -9940,7 +9940,7 @@ public void testUnnessecaryNLSTag5() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9956,7 +9956,7 @@ public void testUnnessecaryNLSTag5() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -9965,7 +9965,7 @@ public void testUnnessecaryNLSTag5() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"nls\")\n"); @@ -9985,7 +9985,7 @@ public void testUnnessecaryNLSTag6() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -10001,7 +10001,7 @@ public void testUnnessecaryNLSTag6() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -10010,7 +10010,7 @@ public void testUnnessecaryNLSTag6() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"nls\")\n"); @@ -10027,7 +10027,7 @@ public void testUnnessecaryNLSTag6() throws Exception { @Test public void testAssignmentWithoutSideEffect1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -10045,7 +10045,7 @@ public void testAssignmentWithoutSideEffect1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -10056,7 +10056,7 @@ public void testAssignmentWithoutSideEffect1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -10073,7 +10073,7 @@ public void testAssignmentWithoutSideEffect1() throws Exception { @Test public void testAssignmentWithoutSideEffect2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -10091,7 +10091,7 @@ public void testAssignmentWithoutSideEffect2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -10102,7 +10102,7 @@ public void testAssignmentWithoutSideEffect2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -10119,7 +10119,7 @@ public void testAssignmentWithoutSideEffect2() throws Exception { @Test public void testAssignmentWithoutSideEffect3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" int bar;\n"); @@ -10136,7 +10136,7 @@ public void testAssignmentWithoutSideEffect3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" int bar;\n"); @@ -10152,7 +10152,7 @@ public void testAssignmentWithoutSideEffect3() throws Exception { @Test public void testAddTypeParametersToClassInstanceCreationTest01() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10174,7 +10174,7 @@ public void testAddTypeParametersToClassInstanceCreationTest01() throws Exceptio assertNumberOfProposals(proposals, 5); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10191,7 +10191,7 @@ public void testAddTypeParametersToClassInstanceCreationTest01() throws Exceptio @Test public void testAddTypeParametersToClassInstanceCreationTest02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.HashSet;\n"); @@ -10215,7 +10215,7 @@ public void testAddTypeParametersToClassInstanceCreationTest02() throws Exceptio assertNumberOfProposals(proposals, 5); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.HashSet;\n"); @@ -10234,7 +10234,7 @@ public void testAddTypeParametersToClassInstanceCreationTest02() throws Exceptio @Test public void testMissingAnnotationAttributes1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -10253,7 +10253,7 @@ public void testMissingAnnotationAttributes1() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -10271,7 +10271,7 @@ public void testMissingAnnotationAttributes1() throws Exception { @Test public void testMissingAnnotationAttributes2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Other {\n"); @@ -10293,7 +10293,7 @@ public void testMissingAnnotationAttributes2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Other {\n"); @@ -10314,7 +10314,7 @@ public void testMissingAnnotationAttributes2() throws Exception { @Test public void testMissingAnnotationAttributes3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -10334,7 +10334,7 @@ public void testMissingAnnotationAttributes3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -10353,7 +10353,7 @@ public void testMissingAnnotationAttributes3() throws Exception { @Test public void testMissingAnnotationAttributes_bug179316 () throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("e", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package e;\n"); buf.append("@Requires1\n"); buf.append("@interface Requires1 {\n"); @@ -10368,7 +10368,7 @@ public void testMissingAnnotationAttributes_bug179316 () throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package e;\n"); buf.append("@Requires1(value = \"\")\n"); buf.append("@interface Requires1 {\n"); @@ -10387,7 +10387,7 @@ public void testTypeParametersToRawTypeReference01() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10405,7 +10405,7 @@ public void testTypeParametersToRawTypeReference01() throws Exception { String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10416,7 +10416,7 @@ public void testTypeParametersToRawTypeReference01() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10427,7 +10427,7 @@ public void testTypeParametersToRawTypeReference01() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10447,7 +10447,7 @@ public void testTypeParametersToRawTypeReference02() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {}\n"); @@ -10465,7 +10465,7 @@ public void testTypeParametersToRawTypeReference02() throws Exception { String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {}\n"); @@ -10476,7 +10476,7 @@ public void testTypeParametersToRawTypeReference02() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {}\n"); @@ -10487,7 +10487,7 @@ public void testTypeParametersToRawTypeReference02() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {}\n"); @@ -10664,7 +10664,7 @@ public void testTypeParametersToRawTypeReference06() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10681,7 +10681,7 @@ public void testTypeParametersToRawTypeReference06() throws Exception { String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10691,7 +10691,7 @@ public void testTypeParametersToRawTypeReference06() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10700,7 +10700,7 @@ public void testTypeParametersToRawTypeReference06() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10719,7 +10719,7 @@ public void testTypeParametersToRawTypeReference07() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10738,7 +10738,7 @@ public void testTypeParametersToRawTypeReference07() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10750,7 +10750,7 @@ public void testTypeParametersToRawTypeReference07() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -10771,7 +10771,7 @@ public void testTypeParametersToRawTypeReference08() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {\n"); @@ -10793,7 +10793,7 @@ public void testTypeParametersToRawTypeReference08() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {\n"); @@ -10808,7 +10808,7 @@ public void testTypeParametersToRawTypeReference08() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" private class E1 {\n"); @@ -10832,7 +10832,7 @@ public void testTypeParametersToRawTypeReference09() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10849,7 +10849,7 @@ public void testTypeParametersToRawTypeReference09() throws Exception { String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10859,7 +10859,7 @@ public void testTypeParametersToRawTypeReference09() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -10878,7 +10878,7 @@ public void testTypeParametersToRawTypeReferenceBug212557() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" public Class[] get() {\n"); @@ -10894,7 +10894,7 @@ public void testTypeParametersToRawTypeReferenceBug212557() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E1 {\n"); buf.append(" @SuppressWarnings(\"rawtypes\")\n"); @@ -10915,7 +10915,7 @@ public void testTypeParametersToRawTypeReferenceBug280193() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("\n"); @@ -10932,7 +10932,7 @@ public void testTypeParametersToRawTypeReferenceBug280193() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("\n"); @@ -10942,7 +10942,7 @@ public void testTypeParametersToRawTypeReferenceBug280193() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("\n"); @@ -10963,7 +10963,7 @@ public void testSwitchCaseFallThrough1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -10986,7 +10986,7 @@ public void testSwitchCaseFallThrough1() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11003,7 +11003,7 @@ public void testSwitchCaseFallThrough1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"fallthrough\")\n"); @@ -11020,7 +11020,7 @@ public void testSwitchCaseFallThrough1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11047,7 +11047,7 @@ public void testSwitchCaseFallThrough2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11070,7 +11070,7 @@ public void testSwitchCaseFallThrough2() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11087,7 +11087,7 @@ public void testSwitchCaseFallThrough2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"fallthrough\")\n"); @@ -11104,7 +11104,7 @@ public void testSwitchCaseFallThrough2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11131,7 +11131,7 @@ public void testSwitchCaseFallThrough3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11155,7 +11155,7 @@ public void testSwitchCaseFallThrough3() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11173,7 +11173,7 @@ public void testSwitchCaseFallThrough3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"fallthrough\")\n"); @@ -11191,7 +11191,7 @@ public void testSwitchCaseFallThrough3() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public long foo(int i) {\n"); @@ -11215,7 +11215,7 @@ public void testSwitchCaseFallThrough3() throws Exception { @Test public void testReplaceWithUnqualifiedEnumConstant1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public enum color {black, white}\n"); @@ -11238,7 +11238,7 @@ public void testReplaceWithUnqualifiedEnumConstant1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public enum color {black, white}\n"); @@ -11258,7 +11258,7 @@ public void testReplaceWithUnqualifiedEnumConstant1() throws Exception { @Test public void testReplaceWithUnqualifiedEnumConstant2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public enum color {black, white}\n"); @@ -11281,7 +11281,7 @@ public void testReplaceWithUnqualifiedEnumConstant2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public enum color {black, white}\n"); @@ -11307,7 +11307,7 @@ public void testCollectionsFieldMethodReplacement() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("b112441", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package b112441;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -11325,7 +11325,7 @@ public void testCollectionsFieldMethodReplacement() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package b112441;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -11348,7 +11348,7 @@ public void testCollectionsFieldMethodReplacement2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -11369,7 +11369,7 @@ public void testCollectionsFieldMethodReplacement2() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -11395,7 +11395,7 @@ public void testCollectionsFieldMethodReplacement3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -11415,7 +11415,7 @@ public void testCollectionsFieldMethodReplacement3() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -11440,7 +11440,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11463,7 +11463,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11481,7 +11481,7 @@ public void testMissingEnumConstantsInCase1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11516,7 +11516,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11540,7 +11540,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11559,7 +11559,7 @@ public void testMissingEnumConstantsInCase2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11595,7 +11595,7 @@ public void testMissingEnumConstantsInCase3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11623,7 +11623,7 @@ public void testMissingEnumConstantsInCase3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11659,7 +11659,7 @@ public void testMissingEnumConstantsInCase4() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11685,7 +11685,7 @@ public void testMissingEnumConstantsInCase4() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11706,7 +11706,7 @@ public void testMissingEnumConstantsInCase4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11739,7 +11739,7 @@ public void testMissingEnumConstantsInCase4() throws Exception { @Test public void testMissingHashCode1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11758,7 +11758,7 @@ public void testMissingHashCode1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -11804,7 +11804,7 @@ public void testUnusedTypeParameter1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public void foo(Object str);\n"); @@ -11818,14 +11818,14 @@ public void testUnusedTypeParameter1() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public void foo(Object str);\n"); buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @param \n"); @@ -11846,7 +11846,7 @@ public void testUnusedTypeParameter2() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append(" /**\n"); buf.append(" * @param \n"); @@ -11864,7 +11864,7 @@ public void testUnusedTypeParameter2() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append(" /**\n"); buf.append(" * @param \n"); @@ -11875,7 +11875,7 @@ public void testUnusedTypeParameter2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append(" /**\n"); buf.append(" * @param \n"); @@ -11897,7 +11897,7 @@ public void testUnusedTypeParameter3() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object str){}\n"); @@ -11911,14 +11911,14 @@ public void testUnusedTypeParameter3() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object str){}\n"); buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -11942,7 +11942,7 @@ public void testUnusedTypeParameter3() throws Exception { public void testLoopOverAddedToFixesForVariable() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -11963,7 +11963,7 @@ public void testLoopOverAddedToFixesForVariable() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -11975,7 +11975,7 @@ public void testLoopOverAddedToFixesForVariable() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -12005,7 +12005,7 @@ public void testLoopOverAddedToFixesForVariable() throws Exception { @Test public void testLoopOverAddedToFixesForMethodInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -12026,7 +12026,7 @@ public void testLoopOverAddedToFixesForMethodInvocation() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -12038,7 +12038,7 @@ public void testLoopOverAddedToFixesForMethodInvocation() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Map;\n"); @@ -12070,7 +12070,7 @@ public void testLoopOverAddedToFixesForMethodInvocation() throws Exception { public void testGenerateForeachNotAddedForLowVersion() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("public class E {\n"); @@ -12095,7 +12095,7 @@ public void testGenerateForeachNotAddedForLowVersion() throws Exception { String[] expected= new String[1]; // no generics should be added to iterator since the version is too low - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collection;\n"); buf.append("import java.util.Iterator;\n"); @@ -12119,7 +12119,7 @@ public void testGenerateForeachNotAddedForLowVersion() throws Exception { public void testInsertInferredTypeArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -12139,7 +12139,7 @@ public void testInsertInferredTypeArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -12209,7 +12209,7 @@ public void testConvertLambdaToAnonymous() throws Exception { assertFalse("error should not appear in 1.8 or higher", JavaModelUtil.is1d8OrHigher(fJProject1)); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class Lambda {\n"); @@ -12224,7 +12224,7 @@ public void testConvertLambdaToAnonymous() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class Lambda {\n"); @@ -12241,7 +12241,7 @@ public void testConvertLambdaToAnonymous() throws Exception { public void testCreateNewObjectProposal_1() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public void foo(String s) {\n"); @@ -12249,7 +12249,7 @@ public void testCreateNewObjectProposal_1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12264,7 +12264,7 @@ public void testCreateNewObjectProposal_1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12274,7 +12274,7 @@ public void testCreateNewObjectProposal_1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static void foo(String s) {\n"); @@ -12288,7 +12288,7 @@ public void testCreateNewObjectProposal_1() throws Exception { public void testCreateNewObjectProposal_2() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(int i, String s) {\n"); @@ -12298,7 +12298,7 @@ public void testCreateNewObjectProposal_2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12316,7 +12316,7 @@ public void testCreateNewObjectProposal_2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12329,7 +12329,7 @@ public void testCreateNewObjectProposal_2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(int i, String s) {\n"); @@ -12345,7 +12345,7 @@ public void testCreateNewObjectProposal_2() throws Exception { public void testCreateNewObjectProposal_3() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(int i, String s) {\n"); @@ -12354,7 +12354,7 @@ public void testCreateNewObjectProposal_3() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12372,7 +12372,7 @@ public void testCreateNewObjectProposal_3() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12384,7 +12384,7 @@ public void testCreateNewObjectProposal_3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(int i, String s) {\n"); @@ -12393,7 +12393,7 @@ public void testCreateNewObjectProposal_3() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12413,7 +12413,7 @@ public void testCreateNewObjectProposal_3() throws Exception { public void testCreateNewObjectProposal_4() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(int i, String s) {\n"); @@ -12422,7 +12422,7 @@ public void testCreateNewObjectProposal_4() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12440,7 +12440,7 @@ public void testCreateNewObjectProposal_4() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12452,7 +12452,7 @@ public void testCreateNewObjectProposal_4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(int i, String s) {\n"); @@ -12461,7 +12461,7 @@ public void testCreateNewObjectProposal_4() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -12481,8 +12481,8 @@ public void testCreateNewObjectProposal_4() throws Exception { public void testCreateNewObjectProposal_5() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); - buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E e;\n"); @@ -12498,7 +12498,7 @@ public void testCreateNewObjectProposal_5() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E e;\n"); @@ -12508,7 +12508,7 @@ public void testCreateNewObjectProposal_5() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static E e;\n"); @@ -12518,7 +12518,7 @@ public void testCreateNewObjectProposal_5() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E e;\n"); @@ -12536,8 +12536,8 @@ public void testCreateNewObjectProposal_5() throws Exception { public void testCreateNewObjectProposal_6() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); - buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E e;\n"); @@ -12553,8 +12553,8 @@ public void testCreateNewObjectProposal_6() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); - buf= new StringBuffer(); + buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E e;\n"); @@ -12564,7 +12564,7 @@ public void testCreateNewObjectProposal_6() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static E e;\n"); @@ -12574,7 +12574,7 @@ public void testCreateNewObjectProposal_6() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E e;\n"); @@ -12591,7 +12591,7 @@ public void testCreateNewObjectProposal_6() throws Exception { public void testCreateNewObjectReferenceProposal_1() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public void foo(String s) {\n"); @@ -12599,7 +12599,7 @@ public void testCreateNewObjectReferenceProposal_1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12615,7 +12615,7 @@ public void testCreateNewObjectReferenceProposal_1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12625,7 +12625,7 @@ public void testCreateNewObjectReferenceProposal_1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12636,7 +12636,7 @@ public void testCreateNewObjectReferenceProposal_1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static void foo(String s) {\n"); @@ -12650,7 +12650,7 @@ public void testCreateNewObjectReferenceProposal_1() throws Exception { public void testCreateNewObjectReferenceProposal_2() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public void foo(String s) {\n"); @@ -12658,7 +12658,7 @@ public void testCreateNewObjectReferenceProposal_2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12674,7 +12674,7 @@ public void testCreateNewObjectReferenceProposal_2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12684,7 +12684,7 @@ public void testCreateNewObjectReferenceProposal_2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12695,7 +12695,7 @@ public void testCreateNewObjectReferenceProposal_2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static void foo(String s) {\n"); @@ -12709,14 +12709,14 @@ public void testCreateNewObjectReferenceProposal_2() throws Exception { public void testCreateNewObjectReferenceProposal_3() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public String fld;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12732,7 +12732,7 @@ public void testCreateNewObjectReferenceProposal_3() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12742,7 +12742,7 @@ public void testCreateNewObjectReferenceProposal_3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12753,7 +12753,7 @@ public void testCreateNewObjectReferenceProposal_3() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -12763,7 +12763,7 @@ public void testCreateNewObjectReferenceProposal_3() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static String fld;\n"); @@ -12776,14 +12776,14 @@ public void testCreateNewObjectReferenceProposal_3() throws Exception { public void testCreateNewObjectReferenceProposal_4() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public String fld;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12799,7 +12799,7 @@ public void testCreateNewObjectReferenceProposal_4() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12809,7 +12809,7 @@ public void testCreateNewObjectReferenceProposal_4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12820,7 +12820,7 @@ public void testCreateNewObjectReferenceProposal_4() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static F f2 = new F();\n"); @@ -12830,7 +12830,7 @@ public void testCreateNewObjectReferenceProposal_4() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static String fld;\n"); @@ -12843,7 +12843,7 @@ public void testCreateNewObjectReferenceProposal_4() throws Exception { public void testCreateNewVariableReferenceProposal_1() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public String s;\n"); @@ -12852,7 +12852,7 @@ public void testCreateNewVariableReferenceProposal_1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12868,7 +12868,7 @@ public void testCreateNewVariableReferenceProposal_1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12878,7 +12878,7 @@ public void testCreateNewVariableReferenceProposal_1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12888,7 +12888,7 @@ public void testCreateNewVariableReferenceProposal_1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static String s;\n"); @@ -12897,7 +12897,7 @@ public void testCreateNewVariableReferenceProposal_1() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12915,7 +12915,7 @@ public void testCreateNewVariableReferenceProposal_1() throws Exception { public void testCreateNewVariableReferenceProposal_2() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public String s;\n"); @@ -12924,7 +12924,7 @@ public void testCreateNewVariableReferenceProposal_2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12941,7 +12941,7 @@ public void testCreateNewVariableReferenceProposal_2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12952,7 +12952,7 @@ public void testCreateNewVariableReferenceProposal_2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12963,7 +12963,7 @@ public void testCreateNewVariableReferenceProposal_2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static String s;\n"); @@ -12972,7 +12972,7 @@ public void testCreateNewVariableReferenceProposal_2() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" static String s2;\n"); @@ -12992,14 +12992,14 @@ public void testCreateNewVariableReferenceProposal_2() throws Exception { public void testCreateNewVariableReferenceProposal_3() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=395216 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F f1;\n"); buf.append("}\n"); pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -13014,7 +13014,7 @@ public void testCreateNewVariableReferenceProposal_3() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -13023,7 +13023,7 @@ public void testCreateNewVariableReferenceProposal_3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -13032,14 +13032,14 @@ public void testCreateNewVariableReferenceProposal_3() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public static F f1;\n"); buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public static void main(String[] args) {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d7.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d7.java index 54819c90a64..3da92d93d50 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d7.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d7.java @@ -90,7 +90,7 @@ public void tearDown() throws Exception { @Test public void testUncaughtExceptionUnionType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -118,7 +118,7 @@ public void testUncaughtExceptionUnionType() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -141,7 +141,7 @@ public void testUncaughtExceptionUnionType() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -165,7 +165,7 @@ public void testUncaughtExceptionUnionType() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -391,7 +391,7 @@ public void testUncaughtSuperExceptionUnionType() throws Exception { public void testUncaughtExceptionTryWithResources1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -422,7 +422,7 @@ public void testUncaughtExceptionTryWithResources1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -448,7 +448,7 @@ public void testUncaughtExceptionTryWithResources1() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -480,7 +480,7 @@ public void testUncaughtExceptionTryWithResources1() throws Exception { public void testUncaughtExceptionTryWithResources2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -511,7 +511,7 @@ public void testUncaughtExceptionTryWithResources2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -537,7 +537,7 @@ public void testUncaughtExceptionTryWithResources2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -569,7 +569,7 @@ public void testUncaughtExceptionTryWithResources2() throws Exception { public void testUncaughtExceptionTryWithResources3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -600,7 +600,7 @@ public void testUncaughtExceptionTryWithResources3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -624,7 +624,7 @@ public void testUncaughtExceptionTryWithResources3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -650,7 +650,7 @@ public void testUncaughtExceptionTryWithResources3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -675,7 +675,7 @@ public void testUncaughtExceptionTryWithResources3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -703,7 +703,7 @@ public void testUncaughtExceptionTryWithResources3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(4); String preview5= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("class MyException extends Exception {\n"); @@ -734,7 +734,7 @@ public void testUncaughtExceptionTryWithResources3() throws Exception { public void testUncaughtExceptionTryWithResources4() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=351464 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.IOException;\n"); @@ -763,7 +763,7 @@ public void testUncaughtExceptionTryWithResources4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.IOException;\n"); @@ -785,7 +785,7 @@ public void testUncaughtExceptionTryWithResources4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.IOException;\n"); @@ -808,7 +808,7 @@ public void testUncaughtExceptionTryWithResources4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.IOException;\n"); @@ -837,7 +837,7 @@ public void testUncaughtExceptionTryWithResources4() throws Exception { public void testUncaughtExceptionTryWithResources5() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=139231 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("public class E {\n"); @@ -859,7 +859,7 @@ public void testUncaughtExceptionTryWithResources5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -876,7 +876,7 @@ public void testUncaughtExceptionTryWithResources5() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileInputStream;\n"); buf.append("import java.io.FileNotFoundException;\n"); @@ -899,7 +899,7 @@ public void testUncaughtExceptionTryWithResources5() throws Exception { public void testUncaughtExceptionTryWithResources6() throws Exception { //https://bugs.eclipse.org/bugs/show_bug.cgi?id=478714 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.ByteArrayInputStream;\n"); @@ -930,7 +930,7 @@ public void testUncaughtExceptionTryWithResources6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.ByteArrayInputStream;\n"); @@ -956,7 +956,7 @@ public void testUncaughtExceptionTryWithResources6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.ByteArrayInputStream;\n"); @@ -985,7 +985,7 @@ public void testUncaughtExceptionTryWithResources6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.ByteArrayInputStream;\n"); @@ -1011,7 +1011,7 @@ public void testUncaughtExceptionTryWithResources6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.ByteArrayInputStream;\n"); @@ -1039,7 +1039,7 @@ public void testUncaughtExceptionTryWithResources6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(4); String preview5= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.ByteArrayInputStream;\n"); @@ -1074,7 +1074,7 @@ public void testUncaughtExceptionTryWithResources6() throws Exception { public void testUnneededCaughtException1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.IOException;\n"); @@ -1097,7 +1097,7 @@ public void testUnneededCaughtException1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.IOException;\n"); @@ -1114,7 +1114,7 @@ public void testUnneededCaughtException1() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.IOException;\n"); @@ -1135,7 +1135,7 @@ public void testUnneededCaughtException1() throws Exception { public void testUnneededCaughtException2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.IOException;\n"); @@ -1158,7 +1158,7 @@ public void testUnneededCaughtException2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.IOException;\n"); @@ -1175,7 +1175,7 @@ public void testUnneededCaughtException2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.IOException;\n"); @@ -1196,7 +1196,7 @@ public void testUnneededCaughtException2() throws Exception { public void testUnneededCatchBlockTryWithResources() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileReader;\n"); buf.append("class MyException extends Exception {\n"); @@ -1224,7 +1224,7 @@ public void testUnneededCatchBlockTryWithResources() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileReader;\n"); buf.append("class MyException extends Exception {\n"); @@ -1245,7 +1245,7 @@ public void testUnneededCatchBlockTryWithResources() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileReader;\n"); buf.append("class MyException extends Exception {\n"); @@ -1270,7 +1270,7 @@ public void testUnneededCatchBlockTryWithResources() throws Exception { public void testRemoveRedundantTypeArguments1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1286,7 +1286,7 @@ public void testRemoveRedundantTypeArguments1() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1304,7 +1304,7 @@ public void testRemoveRedundantTypeArguments1() throws Exception { public void testRemoveRedundantTypeArguments2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashMap;\n"); buf.append("import java.util.Map;\n"); @@ -1320,7 +1320,7 @@ public void testRemoveRedundantTypeArguments2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashMap;\n"); buf.append("import java.util.Map;\n"); @@ -1338,7 +1338,7 @@ public void testRemoveRedundantTypeArguments2() throws Exception { public void testRemoveRedundantTypeArguments3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1355,7 +1355,7 @@ public void testRemoveRedundantTypeArguments3() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1374,7 +1374,7 @@ public void testRemoveRedundantTypeArguments3() throws Exception { public void testRemoveRedundantTypeArguments4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashMap;\n"); buf.append("import java.util.Map;\n"); @@ -1390,7 +1390,7 @@ public void testRemoveRedundantTypeArguments4() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.HashMap;\n"); buf.append("import java.util.Map;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d8.java index 293fd1da6a2..498ce0345f1 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest1d8.java @@ -91,7 +91,7 @@ public void tearDown() throws Exception { @Test public void testUncaughtExceptionTypeUseAnnotation1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -112,7 +112,7 @@ public void testUncaughtExceptionTypeUseAnnotation1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -134,7 +134,7 @@ public void testUncaughtExceptionTypeUseAnnotation1() throws Exception { @Test public void testUncaughtExceptionInLambda1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class C1 {\n"); buf.append(" Runnable r = () -> info(\"Processing rule #{} {}\", \"\");\n"); @@ -150,7 +150,7 @@ public void testUncaughtExceptionInLambda1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class C1 {\n"); buf.append(" Runnable r = () -> {\n"); @@ -172,7 +172,7 @@ public void testUncaughtExceptionInLambda1() throws Exception { @Test public void testUncaughtExceptionInLambda2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class C2 {\n"); buf.append(" void test() {\n"); @@ -192,7 +192,7 @@ public void testUncaughtExceptionInLambda2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class C2 {\n"); buf.append(" void test() {\n"); @@ -218,7 +218,7 @@ public void testUncaughtExceptionInLambda2() throws Exception { @Test public void testUncaughtExceptionInLambda3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class C3 {\n"); @@ -243,7 +243,7 @@ public void testUncaughtExceptionInLambda3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class C3 {\n"); @@ -270,7 +270,7 @@ public void testUncaughtExceptionInLambda3() throws Exception { @Test public void testUncaughtExceptionInLambda4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.File;\n"); buf.append("import java.io.IOException;\n"); @@ -300,7 +300,7 @@ public void testUncaughtExceptionInLambda4() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.File;\n"); buf.append("import java.io.IOException;\n"); @@ -334,7 +334,7 @@ public void testUncaughtExceptionInLambda4() throws Exception { @Test public void testUncaughtExceptionInLambda5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.File;\n"); buf.append("import java.io.IOException;\n"); @@ -369,7 +369,7 @@ public void testUncaughtExceptionInLambda5() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.File;\n"); buf.append("import java.io.IOException;\n"); @@ -408,7 +408,7 @@ public void testUncaughtExceptionInLambda5() throws Exception { @Test public void testUncaughtExceptionInLambda6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.File;\n"); buf.append("import java.io.IOException;\n"); @@ -443,7 +443,7 @@ public void testUncaughtExceptionInLambda6() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.File;\n"); buf.append("import java.io.IOException;\n"); @@ -482,7 +482,7 @@ public void testUncaughtExceptionInLambda6() throws Exception { @Test public void testUncaughtExceptionInLambda7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.InvalidClassException;\n"); @@ -510,7 +510,7 @@ public void testUncaughtExceptionInLambda7() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.InvalidClassException;\n"); @@ -532,7 +532,7 @@ public void testUncaughtExceptionInLambda7() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.io.InvalidClassException;\n"); @@ -559,7 +559,7 @@ public void testUncaughtExceptionInLambda7() throws Exception { @Test public void testUncaughtExceptionInMethodReference1() throws Exception { // ExpressionMethodReference IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.util.function.Consumer;\n"); @@ -580,7 +580,7 @@ public void testUncaughtExceptionInMethodReference1() throws Exception { // Expr assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.util.function.Consumer;\n"); @@ -605,7 +605,7 @@ public void testUncaughtExceptionInMethodReference1() throws Exception { // Expr @Test public void testUncaughtExceptionInMethodReference2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.util.Optional;\n"); @@ -629,7 +629,7 @@ public void testUncaughtExceptionInMethodReference2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.util.Optional;\n"); @@ -657,7 +657,7 @@ public void testUncaughtExceptionInMethodReference2() throws Exception { @Test public void testUncaughtExceptionInMethodReference3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.util.Optional;\n"); @@ -683,7 +683,7 @@ public void testUncaughtExceptionInMethodReference3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.FileNotFoundException;\n"); buf.append("import java.util.Optional;\n"); @@ -738,7 +738,7 @@ public void testUncaughtExceptionInMethodReference4() throws Exception { // Gene @Test public void testUncaughtExceptionInMethodReference5() throws Exception { // CreationReference IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.HashSet;\n"); @@ -762,7 +762,7 @@ public void testUncaughtExceptionInMethodReference5() throws Exception { // Crea assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.HashSet;\n"); @@ -790,7 +790,7 @@ public void testUncaughtExceptionInMethodReference5() throws Exception { // Crea @Test public void testUncaughtExceptionInMethodReference6() throws Exception { // TypeMethodReference IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.function.Function;\n"); @@ -813,7 +813,7 @@ public void testUncaughtExceptionInMethodReference6() throws Exception { // Type assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.function.Function;\n"); @@ -840,7 +840,7 @@ public void testUncaughtExceptionInMethodReference6() throws Exception { // Type @Test public void testUncaughtExceptionInMethodReference7() throws Exception { // SuperMethodReference IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.function.Supplier;\n"); @@ -861,7 +861,7 @@ public void testUncaughtExceptionInMethodReference7() throws Exception { // Supe assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.function.Supplier;\n"); @@ -887,7 +887,7 @@ public void testUncaughtExceptionInMethodReference7() throws Exception { // Supe @Test public void testOverrideDefaultMethod1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -908,7 +908,7 @@ public void testOverrideDefaultMethod1() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -927,7 +927,7 @@ public void testOverrideDefaultMethod1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -952,7 +952,7 @@ public void testOverrideDefaultMethod1() throws Exception { @Test public void testOverrideDefaultMethod2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -973,7 +973,7 @@ public void testOverrideDefaultMethod2() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -992,7 +992,7 @@ public void testOverrideDefaultMethod2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -1017,7 +1017,7 @@ public void testOverrideDefaultMethod2() throws Exception { @Test public void testOverrideDefaultMethod3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -1038,7 +1038,7 @@ public void testOverrideDefaultMethod3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -1058,7 +1058,7 @@ public void testOverrideDefaultMethod3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface FI1 {\n"); @@ -1084,7 +1084,7 @@ public void testOverrideDefaultMethod3() throws Exception { @Test public void testOverrideDefaultMethod4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface I1 {\n"); @@ -1105,7 +1105,7 @@ public void testOverrideDefaultMethod4() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface I1 {\n"); @@ -1124,7 +1124,7 @@ public void testOverrideDefaultMethod4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface I1 {\n"); @@ -1148,7 +1148,7 @@ public void testOverrideDefaultMethod4() throws Exception { @Test public void testOverrideDefaultMethod_multiLevel() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -1171,7 +1171,7 @@ public void testOverrideDefaultMethod_multiLevel() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -1192,7 +1192,7 @@ public void testOverrideDefaultMethod_multiLevel() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -1219,7 +1219,7 @@ public void testOverrideDefaultMethod_multiLevel() throws Exception { @Test public void testOverrideDefaultMethod_noParam() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface I1 {\n"); @@ -1240,7 +1240,7 @@ public void testOverrideDefaultMethod_noParam() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface I1 {\n"); @@ -1259,7 +1259,7 @@ public void testOverrideDefaultMethod_noParam() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("interface I1 {\n"); @@ -1284,7 +1284,7 @@ public void testOverrideDefaultMethod_noParam() throws Exception { public void testCorrectVariableType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.List;\n"); @@ -1306,7 +1306,7 @@ public void testCorrectVariableType() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("import java.util.List;\n"); @@ -1333,7 +1333,7 @@ public void testBug528875() throws Exception { JavaCore.setOptions(options); NullTestUtils.prepareNullTypeAnnotations(fSourceFolder); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.*;\n"); buf.append("import annots.*;\n"); @@ -1351,7 +1351,7 @@ public void testBug528875() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 6); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.*;\n"); buf.append("import annots.*;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/MarkerResolutionTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/MarkerResolutionTest.java index ee605f8405a..bb1d0cea885 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/MarkerResolutionTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/MarkerResolutionTest.java @@ -142,7 +142,7 @@ public void testQuickFix() throws Exception { return; IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -171,7 +171,7 @@ public void testQuickFix() throws Exception { proposals[0].apply(doc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("PACKAGE test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -191,7 +191,7 @@ public void testQuickFixAfterModification() throws Exception { return; IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -218,7 +218,7 @@ public void testQuickFixAfterModification() throws Exception { proposals[0].apply(doc); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("\n"); buf.append("package TEST1;\n"); buf.append("import java.util.Vector;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest.java index 2097aec68ea..c146d2f5e8e 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest.java @@ -95,7 +95,7 @@ public void tearDown() throws Exception { public void testStaticMethodRequestedInSameType1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void xoo() {\n"); @@ -114,7 +114,7 @@ public void testStaticMethodRequestedInSameType1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void xoo() {\n"); @@ -129,7 +129,7 @@ public void testStaticMethodRequestedInSameType1() throws Exception { @Test public void testStaticMethodRequestedInSameType2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void xoo() {\n"); @@ -148,7 +148,7 @@ public void testStaticMethodRequestedInSameType2() throws Exception { String[] previews= getAllPreviewContent(proposals); String[] expected = new String[previews.length]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void xoo() {\n"); @@ -159,7 +159,7 @@ public void testStaticMethodRequestedInSameType2() throws Exception { buf.append("}\n"); expected[0] = buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void xoo() {\n"); @@ -178,7 +178,7 @@ public void testStaticMethodRequestedInSameType2() throws Exception { public void testStaticMethodRequestedInSameGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void xoo(M m) {\n"); @@ -197,7 +197,7 @@ public void testStaticMethodRequestedInSameGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void xoo(M m) {\n"); @@ -212,7 +212,7 @@ public void testStaticMethodRequestedInSameGenericType() throws Exception { @Test public void testStaticMethodRequestedInOtherType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public void xoo() {\n"); @@ -220,7 +220,7 @@ public void testStaticMethodRequestedInOtherType() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -237,7 +237,7 @@ public void testStaticMethodRequestedInOtherType() throws Exception { String[] previews= getAllPreviewContent(proposals); String[] expected = new String[previews.length]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo() {\n"); @@ -245,7 +245,7 @@ public void testStaticMethodRequestedInOtherType() throws Exception { buf.append("}\n"); expected[0] = buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -261,7 +261,7 @@ public void testStaticMethodRequestedInOtherType() throws Exception { @Test public void testInvisibleMethodRequestedInSuperType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private void xoo() {\n"); @@ -269,7 +269,7 @@ public void testInvisibleMethodRequestedInSuperType() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -286,7 +286,7 @@ public void testInvisibleMethodRequestedInSuperType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected void xoo() {\n"); @@ -298,7 +298,7 @@ public void testInvisibleMethodRequestedInSuperType() throws Exception { @Test public void testInvisibleSuperMethodRequestedInSuperType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private void xoo() {\n"); @@ -306,7 +306,7 @@ public void testInvisibleSuperMethodRequestedInSuperType() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -323,7 +323,7 @@ public void testInvisibleSuperMethodRequestedInSuperType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected void xoo() {\n"); @@ -335,7 +335,7 @@ public void testInvisibleSuperMethodRequestedInSuperType() throws Exception { @Test public void testInvisibleSuperMethodRequestedInGenericSuperType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private void xoo(T... t) {\n"); @@ -343,7 +343,7 @@ public void testInvisibleSuperMethodRequestedInGenericSuperType() throws Excepti buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -360,7 +360,7 @@ public void testInvisibleSuperMethodRequestedInGenericSuperType() throws Excepti CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected void xoo(T... t) {\n"); @@ -372,7 +372,7 @@ public void testInvisibleSuperMethodRequestedInGenericSuperType() throws Excepti @Test public void testInvisibleMethodRequestedInOtherPackage() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.util.List;\n"); buf.append("public class C {\n"); @@ -382,7 +382,7 @@ public void testInvisibleMethodRequestedInOtherPackage() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E {\n"); @@ -400,7 +400,7 @@ public void testInvisibleMethodRequestedInOtherPackage() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.util.List;\n"); buf.append("public class C {\n"); @@ -413,7 +413,7 @@ public void testInvisibleMethodRequestedInOtherPackage() throws Exception { @Test public void testInvisibleConstructorRequestedInOtherType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private C() {\n"); @@ -421,7 +421,7 @@ public void testInvisibleConstructorRequestedInOtherType() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -438,7 +438,7 @@ public void testInvisibleConstructorRequestedInOtherType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" C() {\n"); @@ -450,7 +450,7 @@ public void testInvisibleConstructorRequestedInOtherType() throws Exception { @Test public void testInvisibleDefaultConstructorRequestedInOtherType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected class Inner{\n"); @@ -459,7 +459,7 @@ public void testInvisibleDefaultConstructorRequestedInOtherType() throws Excepti pack1.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class E extends test1.C {\n"); buf.append(" Object o= new Inner();\n"); @@ -474,7 +474,7 @@ public void testInvisibleDefaultConstructorRequestedInOtherType() throws Excepti CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected class Inner{\n"); @@ -489,7 +489,7 @@ public void testInvisibleDefaultConstructorRequestedInOtherType() throws Excepti @Test public void testInvisibleConstructorRequestedInSuperType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private C() {\n"); @@ -497,7 +497,7 @@ public void testInvisibleConstructorRequestedInSuperType() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public E() {\n"); @@ -514,7 +514,7 @@ public void testInvisibleConstructorRequestedInSuperType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected C() {\n"); @@ -526,14 +526,14 @@ public void testInvisibleConstructorRequestedInSuperType() throws Exception { @Test public void testInvisibleFieldRequestedInSamePackage1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private int fXoo;\n"); buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(C c) {\n"); @@ -550,7 +550,7 @@ public void testInvisibleFieldRequestedInSamePackage1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(1); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" int fXoo;\n"); @@ -563,14 +563,14 @@ public void testInvisibleFieldRequestedInSamePackage1() throws Exception { @Test public void testInvisibleFieldRequestedInSamePackage2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private int fXoo;\n"); buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -587,7 +587,7 @@ public void testInvisibleFieldRequestedInSamePackage2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(1); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected int fXoo;\n"); @@ -597,7 +597,7 @@ public void testInvisibleFieldRequestedInSamePackage2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" private int fXoo;\n"); @@ -611,7 +611,7 @@ public void testInvisibleFieldRequestedInSamePackage2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo(int fXoo) {\n"); @@ -623,7 +623,7 @@ public void testInvisibleFieldRequestedInSamePackage2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(4); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -635,7 +635,7 @@ public void testInvisibleFieldRequestedInSamePackage2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(5); String preview5= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -651,7 +651,7 @@ public void testInvisibleFieldRequestedInSamePackage2() throws Exception { @Test public void testNonStaticMethodRequestedInConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int xoo() { return 1; };\n"); @@ -671,7 +671,7 @@ public void testNonStaticMethodRequestedInConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static int xoo() { return 1; };\n"); @@ -687,7 +687,7 @@ public void testNonStaticMethodRequestedInConstructor() throws Exception { @Test public void testNonStaticFieldRequestedInConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int fXoo= 1;\n"); @@ -707,7 +707,7 @@ public void testNonStaticFieldRequestedInConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static int fXoo= 1;\n"); @@ -723,14 +723,14 @@ public void testNonStaticFieldRequestedInConstructor() throws Exception { @Test public void testInvisibleTypeRequestedInDifferentPackage() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("class C {\n"); buf.append("}\n"); pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -747,7 +747,7 @@ public void testInvisibleTypeRequestedInDifferentPackage() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append("}\n"); @@ -757,14 +757,14 @@ public void testInvisibleTypeRequestedInDifferentPackage() throws Exception { @Test public void testInvisibleTypeRequestedInGenericType() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("class C {\n"); buf.append("}\n"); pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -781,7 +781,7 @@ public void testInvisibleTypeRequestedInGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append("}\n"); @@ -792,7 +792,7 @@ public void testInvisibleTypeRequestedInGenericType() throws Exception { @Test public void testInvisibleTypeRequestedFromSuperClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" private class CInner {\n"); @@ -800,7 +800,7 @@ public void testInvisibleTypeRequestedFromSuperClass() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" public void foo() {\n"); @@ -817,7 +817,7 @@ public void testInvisibleTypeRequestedFromSuperClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" class CInner {\n"); @@ -830,14 +830,14 @@ public void testInvisibleTypeRequestedFromSuperClass() throws Exception { @Test public void testInvisibleImport() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("class C {\n"); buf.append("}\n"); pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -854,7 +854,7 @@ public void testInvisibleImport() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append("}\n"); @@ -864,7 +864,7 @@ public void testInvisibleImport() throws Exception { @Test public void testAbstractMethodWithBody() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E {\n"); buf.append(" public abstract void foo() {\n"); @@ -880,7 +880,7 @@ public void testAbstractMethodWithBody() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E {\n"); buf.append(" public void foo() {\n"); @@ -891,7 +891,7 @@ public void testAbstractMethodWithBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E {\n"); buf.append(" public abstract void foo();\n"); @@ -905,7 +905,7 @@ public void testAbstractMethodWithBody() throws Exception { @Test public void testAbstractMethodWithBody2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("abstract class C {\n"); buf.append(" public abstract strictfp void foo() {}\n"); @@ -920,7 +920,7 @@ public void testAbstractMethodWithBody2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("abstract class C {\n"); buf.append(" public strictfp void foo() {}\n"); @@ -930,7 +930,7 @@ public void testAbstractMethodWithBody2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("abstract class C {\n"); buf.append(" public abstract void foo();\n"); @@ -944,7 +944,7 @@ public void testAbstractMethodWithBody2() throws Exception { @Test public void testAbstractMethodWithBody3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -962,7 +962,7 @@ public void testAbstractMethodWithBody3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -979,7 +979,7 @@ public void testAbstractMethodWithBody3() throws Exception { @Test public void testAbstractMethodInNonAbstractClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public abstract int foo();\n"); @@ -998,7 +998,7 @@ public void testAbstractMethodInNonAbstractClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E {\n"); buf.append(" public abstract int foo();\n"); @@ -1016,7 +1016,7 @@ public void testAbstractMethodInNonAbstractClass() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -1034,7 +1034,7 @@ public void testAbstractMethodInNonAbstractClass() throws Exception { @Test public void testNativeMethodWithBody() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public native void foo() {\n"); @@ -1050,7 +1050,7 @@ public void testNativeMethodWithBody() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1061,7 +1061,7 @@ public void testNativeMethodWithBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public native void foo();\n"); @@ -1075,7 +1075,7 @@ public void testNativeMethodWithBody() throws Exception { public void testOuterLocalMustBeFinal() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1097,7 +1097,7 @@ public void testOuterLocalMustBeFinal() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1116,7 +1116,7 @@ public void testOuterLocalMustBeFinal() throws Exception { public void testOuterLocalMustBeFinal2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -1139,7 +1139,7 @@ public void testOuterLocalMustBeFinal2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -1160,7 +1160,7 @@ public void testOuterLocalMustBeFinal2() throws Exception { @Test public void testOuterParameterMustBeFinal() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -1181,7 +1181,7 @@ public void testOuterParameterMustBeFinal() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(final int i) {\n"); @@ -1198,7 +1198,7 @@ public void testOuterParameterMustBeFinal() throws Exception { @Test public void testOuterForParamMustBeFinal() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1221,7 +1221,7 @@ public void testOuterForParamMustBeFinal() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1241,7 +1241,7 @@ public void testOuterForParamMustBeFinal() throws Exception { @Test public void testMethodRequiresBody() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo();\n"); @@ -1256,7 +1256,7 @@ public void testMethodRequiresBody() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1267,7 +1267,7 @@ public void testMethodRequiresBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public abstract void foo();\n"); @@ -1281,7 +1281,7 @@ public void testMethodRequiresBody() throws Exception { @Test public void testMethodRequiresBody2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo();\n"); @@ -1296,7 +1296,7 @@ public void testMethodRequiresBody2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int foo() {\n"); @@ -1308,7 +1308,7 @@ public void testMethodRequiresBody2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public abstract int foo();\n"); @@ -1325,7 +1325,7 @@ public void testNeedToEmulateMethodAccess() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1348,7 +1348,7 @@ public void testNeedToEmulateMethodAccess() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1371,7 +1371,7 @@ public void testNeedToEmulateConstructorAccess() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1394,7 +1394,7 @@ public void testNeedToEmulateConstructorAccess() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1417,7 +1417,7 @@ public void testNeedToEmulateFieldRead() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1440,7 +1440,7 @@ public void testNeedToEmulateFieldRead() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1463,7 +1463,7 @@ public void testNeedToEmulateFieldReadInGeneric() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1486,7 +1486,7 @@ public void testNeedToEmulateFieldReadInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1509,7 +1509,7 @@ public void testNeedToEmulateFieldWrite() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1532,7 +1532,7 @@ public void testNeedToEmulateFieldWrite() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void x() {\n"); @@ -1551,7 +1551,7 @@ public void testNeedToEmulateFieldWrite() throws Exception { @Test public void testSetFinalVariable1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final int x= 9;\n"); @@ -1569,7 +1569,7 @@ public void testSetFinalVariable1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int x= 9;\n"); @@ -1583,7 +1583,7 @@ public void testSetFinalVariable1() throws Exception { @Test public void testSetFinalVariable2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final int x;\n"); @@ -1602,7 +1602,7 @@ public void testSetFinalVariable2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int x;\n"); @@ -1617,7 +1617,7 @@ public void testSetFinalVariable2() throws Exception { @Test public void testSetFinalVariable3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1635,7 +1635,7 @@ public void testSetFinalVariable3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1649,7 +1649,7 @@ public void testSetFinalVariable3() throws Exception { @Test public void testSetFinalVariable4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1669,7 +1669,7 @@ public void testSetFinalVariable4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1687,7 +1687,7 @@ public void testSetFinalVariable4() throws Exception { @Test public void testSetFinalVariableInGeneric() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" T x;\n"); @@ -1695,7 +1695,7 @@ public void testSetFinalVariableInGeneric() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(test2.C c) {\n"); @@ -1712,7 +1712,7 @@ public void testSetFinalVariableInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(1); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public T x;\n"); @@ -1725,7 +1725,7 @@ public void testSetFinalVariableInGeneric() throws Exception { public void testOverrideFinalMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected final void foo() {\n"); @@ -1733,7 +1733,7 @@ public void testOverrideFinalMethod() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" protected void foo() {\n"); @@ -1749,7 +1749,7 @@ public void testOverrideFinalMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected void foo() {\n"); @@ -1763,7 +1763,7 @@ public void testOverrideFinalMethod() throws Exception { public void testOverridesNonVisibleMethod() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" void foo() {\n"); @@ -1772,7 +1772,7 @@ public void testOverridesNonVisibleMethod() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1789,7 +1789,7 @@ public void testOverridesNonVisibleMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public void foo() {\n"); @@ -1802,7 +1802,7 @@ public void testOverridesNonVisibleMethod() throws Exception { public void testOverridesStaticMethod() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public static void foo() {\n"); @@ -1811,7 +1811,7 @@ public void testOverridesStaticMethod() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1828,7 +1828,7 @@ public void testOverridesStaticMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public void foo() {\n"); @@ -1841,7 +1841,7 @@ public void testOverridesStaticMethod() throws Exception { public void testStaticOverridesMethod() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public void foo() {\n"); @@ -1850,7 +1850,7 @@ public void testStaticOverridesMethod() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1867,7 +1867,7 @@ public void testStaticOverridesMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1881,7 +1881,7 @@ public void testStaticOverridesMethod() throws Exception { public void testOverridesMoreVisibleMethod() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public void foo() {\n"); @@ -1890,7 +1890,7 @@ public void testOverridesMoreVisibleMethod() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1907,7 +1907,7 @@ public void testOverridesMoreVisibleMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" protected void foo() {\n"); @@ -1918,7 +1918,7 @@ public void testOverridesMoreVisibleMethod() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1935,7 +1935,7 @@ public void testOverridesMoreVisibleMethod() throws Exception { public void testOverridesMoreVisibleMethodInGeneric() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" public T foo(M m) {\n"); @@ -1944,7 +1944,7 @@ public void testOverridesMoreVisibleMethodInGeneric() throws Exception { pack2.createCompilationUnit("C.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1961,7 +1961,7 @@ public void testOverridesMoreVisibleMethodInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append(" protected T foo(M m) {\n"); @@ -1972,7 +1972,7 @@ public void testOverridesMoreVisibleMethodInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.C;\n"); buf.append("public class E extends C {\n"); @@ -1990,7 +1990,7 @@ public void testOverridesMoreVisibleMethodInGeneric() throws Exception { public void testInvalidInterfaceModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public static interface E {\n"); buf.append(" public void foo();\n"); @@ -2005,7 +2005,7 @@ public void testInvalidInterfaceModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public void foo();\n"); @@ -2017,7 +2017,7 @@ public void testInvalidInterfaceModifiers() throws Exception { public void testInvalidMemberInterfaceModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" private interface Inner {\n"); @@ -2033,7 +2033,7 @@ public void testInvalidMemberInterfaceModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" interface Inner {\n"); @@ -2046,7 +2046,7 @@ public void testInvalidMemberInterfaceModifiers() throws Exception { public void testInvalidInterfaceFieldModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public native int i;\n"); @@ -2061,7 +2061,7 @@ public void testInvalidInterfaceFieldModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public int i;\n"); @@ -2073,7 +2073,7 @@ public void testInvalidInterfaceFieldModifiers() throws Exception { public void testInvalidInterfaceMethodModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" private strictfp void foo();\n"); @@ -2088,7 +2088,7 @@ public void testInvalidInterfaceMethodModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" void foo();\n"); @@ -2100,7 +2100,7 @@ public void testInvalidInterfaceMethodModifiers() throws Exception { public void testInvalidClassModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public volatile class E {\n"); buf.append(" public void foo() {\n"); @@ -2116,7 +2116,7 @@ public void testInvalidClassModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2130,7 +2130,7 @@ public void testInvalidClassModifiers() throws Exception { public void testInvalidMemberClassModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" private class Inner {\n"); @@ -2146,7 +2146,7 @@ public void testInvalidMemberClassModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" class Inner {\n"); @@ -2159,7 +2159,7 @@ public void testInvalidMemberClassModifiers() throws Exception { public void testInvalidLocalClassModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -2177,7 +2177,7 @@ public void testInvalidLocalClassModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -2192,7 +2192,7 @@ public void testInvalidLocalClassModifiers() throws Exception { public void testInvalidClassFieldModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" strictfp public native int i;\n"); @@ -2207,7 +2207,7 @@ public void testInvalidClassFieldModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int i;\n"); @@ -2219,7 +2219,7 @@ public void testInvalidClassFieldModifiers() throws Exception { public void testInvalidClassMethodModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E {\n"); buf.append(" volatile abstract void foo();\n"); @@ -2234,7 +2234,7 @@ public void testInvalidClassMethodModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E {\n"); buf.append(" abstract void foo();\n"); @@ -2245,7 +2245,7 @@ public void testInvalidClassMethodModifiers() throws Exception { @Test public void testInvalidConstructorModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class Bug {\n"); @@ -2261,7 +2261,7 @@ public void testInvalidConstructorModifiers() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class Bug {\n"); @@ -2278,7 +2278,7 @@ public void testInvalidConstructorModifiers() throws Exception { public void testInvalidParamModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(private int x) {\n"); @@ -2294,7 +2294,7 @@ public void testInvalidParamModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo(int x) {\n"); @@ -2307,7 +2307,7 @@ public void testInvalidParamModifiers() throws Exception { public void testInvalidVariableModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -2324,7 +2324,7 @@ public void testInvalidVariableModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -2338,7 +2338,7 @@ public void testInvalidVariableModifiers() throws Exception { public void testInvalidMultiVariableModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2357,7 +2357,7 @@ public void testInvalidMultiVariableModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2375,7 +2375,7 @@ public void testInvalidMultiVariableModifiers() throws Exception { public void testInvalidMultiFieldModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final int a, b;\n"); @@ -2394,7 +2394,7 @@ public void testInvalidMultiFieldModifiers() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int a;\n"); @@ -2411,7 +2411,7 @@ public void testInvalidMultiFieldModifiers() throws Exception { public void testInvalidMultiFieldModifiers2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final int b, a;\n"); @@ -2430,7 +2430,7 @@ public void testInvalidMultiFieldModifiers2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private final int b;\n"); @@ -2447,7 +2447,7 @@ public void testInvalidMultiFieldModifiers2() throws Exception { public void testExtendsFinalClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" protected void foo() {\n"); @@ -2455,7 +2455,7 @@ public void testExtendsFinalClass() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends C {\n"); buf.append(" protected void foo() {\n"); @@ -2471,7 +2471,7 @@ public void testExtendsFinalClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected void foo() {\n"); @@ -2484,7 +2484,7 @@ public void testExtendsFinalClass() throws Exception { public void testExtendsFinalClass2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" protected void foo() {\n"); @@ -2492,7 +2492,7 @@ public void testExtendsFinalClass2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("C.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" protected void foo() {\n"); @@ -2509,7 +2509,7 @@ public void testExtendsFinalClass2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class C {\n"); buf.append(" protected void foo() {\n"); @@ -2527,7 +2527,7 @@ public void testMissingOverrideAnnotation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" public String toString() {\n"); @@ -2544,7 +2544,7 @@ public void testMissingOverrideAnnotation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" @Override\n"); @@ -2563,7 +2563,7 @@ public void testMissingTypeDeprecationAnnotation() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @deprecated\n"); @@ -2580,7 +2580,7 @@ public void testMissingTypeDeprecationAnnotation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("/**\n"); buf.append(" * @deprecated\n"); @@ -2599,7 +2599,7 @@ public void testMissingMethodDeprecationAnnotation() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" /**\n"); @@ -2620,7 +2620,7 @@ public void testMissingMethodDeprecationAnnotation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" /**\n"); @@ -2644,7 +2644,7 @@ public void testMissingFieldDeprecationAnnotation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" /**\n"); @@ -2662,7 +2662,7 @@ public void testMissingFieldDeprecationAnnotation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public final class C {\n"); buf.append(" /**\n"); @@ -2682,7 +2682,7 @@ public void testSuppressNLSWarningAnnotation1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" static {\n"); @@ -2697,7 +2697,7 @@ public void testSuppressNLSWarningAnnotation1() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" static {\n"); @@ -2706,7 +2706,7 @@ public void testSuppressNLSWarningAnnotation1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@SuppressWarnings(\"nls\")\n"); buf.append("public class E {\n"); @@ -2726,7 +2726,7 @@ public void testSuppressNLSWarningAnnotation2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" private class Q {\n"); @@ -2741,7 +2741,7 @@ public void testSuppressNLSWarningAnnotation2() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" private class Q {\n"); @@ -2760,7 +2760,7 @@ public void testSuppressNLSWarningAnnotation3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" String s = \"\";\n"); @@ -2773,7 +2773,7 @@ public void testSuppressNLSWarningAnnotation3() throws Exception { assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"nls\")\n"); @@ -2790,7 +2790,7 @@ public void testSuppressNLSWarningAnnotation4() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2805,7 +2805,7 @@ public void testSuppressNLSWarningAnnotation4() throws Exception { assertNumberOfProposals(proposals, 5); assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2814,7 +2814,7 @@ public void testSuppressNLSWarningAnnotation4() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"nls\")\n"); @@ -2835,7 +2835,7 @@ public void testSuppressNLSWarningAnnotation5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -2853,7 +2853,7 @@ public void testSuppressNLSWarningAnnotation5() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -2876,7 +2876,7 @@ public void testSuppressWarningsForLocalVariables() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -2894,7 +2894,7 @@ public void testSuppressWarningsForLocalVariables() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 5); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -2906,7 +2906,7 @@ public void testSuppressWarningsForLocalVariables() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -2929,7 +2929,7 @@ public void testSuppressWarningsForFieldVariables() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -2945,7 +2945,7 @@ public void testSuppressWarningsForFieldVariables() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -2966,7 +2966,7 @@ public void testSuppressWarningsForFieldVariables2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -2984,7 +2984,7 @@ public void testSuppressWarningsForFieldVariables2() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.ArrayList;\n"); buf.append("\n"); @@ -3007,7 +3007,7 @@ public void testSuppressWarningsForMethodParameters() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3024,7 +3024,7 @@ public void testSuppressWarningsForMethodParameters() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 5); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3035,7 +3035,7 @@ public void testSuppressWarningsForMethodParameters() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3059,7 +3059,7 @@ public void testSuppressWarningsAnonymousClass1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3085,7 +3085,7 @@ public void testSuppressWarningsAnonymousClass1() throws Exception { assertNumberOfProposals(proposals, 6); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3105,7 +3105,7 @@ public void testSuppressWarningsAnonymousClass1() throws Exception { buf.append("};\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3124,7 +3124,7 @@ public void testSuppressWarningsAnonymousClass1() throws Exception { buf.append("};\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3154,7 +3154,7 @@ public void testSuppressWarningsAnonymousClass2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3178,7 +3178,7 @@ public void testSuppressWarningsAnonymousClass2() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 3); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1; \n"); buf.append("import java.util.*;\n"); buf.append("\n"); @@ -3202,7 +3202,7 @@ public void testSuppressWarningsAnonymousClass2() throws Exception { @Test public void testMisspelledSuppressToken() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("a", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -3219,7 +3219,7 @@ public void testMisspelledSuppressToken() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -3229,7 +3229,7 @@ public void testMisspelledSuppressToken() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -3245,7 +3245,7 @@ public void testMisspelledSuppressToken() throws Exception { public void testSuppressBug169446() throws Exception { IPackageFragment other= fSourceFolder.createPackageFragment("other", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package other; \n"); buf.append("\n"); buf.append("public @interface SuppressWarnings {\n"); @@ -3255,7 +3255,7 @@ public void testSuppressBug169446() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("a.b", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a.b;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3265,7 +3265,7 @@ public void testSuppressBug169446() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a.b;\n"); buf.append("\n"); buf.append("import other.SuppressWarnings;\n"); @@ -3285,7 +3285,7 @@ public void testSuppressBug169446() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a.b;\n"); buf.append("\n"); buf.append("import other.SuppressWarnings;\n"); @@ -3305,7 +3305,7 @@ public void testSuppressBug169446() throws Exception { @Test public void testSuppressWarningInImports() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -3321,7 +3321,7 @@ public void testSuppressWarningInImports() throws Exception { String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -3342,7 +3342,7 @@ public void testUnusedSuppressWarnings1() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("@SuppressWarnings(value=\"unused\")\n"); @@ -3358,7 +3358,7 @@ public void testUnusedSuppressWarnings1() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3376,7 +3376,7 @@ public void testUnusedSuppressWarnings2() throws Exception { hashtable.put(JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN, JavaCore.WARNING); JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("@SuppressWarnings(\"unused\")\n"); @@ -3392,7 +3392,7 @@ public void testUnusedSuppressWarnings2() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3410,7 +3410,7 @@ public void testUnusedSuppressWarnings3() throws Exception { hashtable.put(JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN, JavaCore.WARNING); JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("@SuppressWarnings({ \"unused\", \"X\" })\n"); @@ -3426,7 +3426,7 @@ public void testUnusedSuppressWarnings3() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("@SuppressWarnings({ \"X\" })\n"); @@ -3442,7 +3442,7 @@ public void testUnusedSuppressWarnings3() throws Exception { @Test public void testMakeFinalBug129165() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class E {\n"); @@ -3466,7 +3466,7 @@ public void testMakeFinalBug129165() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class E {\n"); @@ -3488,7 +3488,7 @@ public void testMakeFinalBug129165() throws Exception { @Test public void testStaticFieldInInnerClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3505,7 +3505,7 @@ public void testStaticFieldInInnerClass() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3515,7 +3515,7 @@ public void testStaticFieldInInnerClass() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3531,7 +3531,7 @@ public void testStaticFieldInInnerClass() throws Exception { @Test public void testStaticMethodInInnerClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3549,7 +3549,7 @@ public void testStaticMethodInInnerClass() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3560,7 +3560,7 @@ public void testStaticMethodInInnerClass() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3577,7 +3577,7 @@ public void testStaticMethodInInnerClass() throws Exception { @Test public void testFinalVolatileField() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3594,7 +3594,7 @@ public void testFinalVolatileField() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3604,7 +3604,7 @@ public void testFinalVolatileField() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -3622,14 +3622,14 @@ public void testFinalVolatileField() throws Exception { public void testOverrideAnnotationButNotOverriding() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class OtherMachine {\n"); buf.append("}\n"); pack1.createCompilationUnit("OtherMachine.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -3649,7 +3649,7 @@ public void testOverrideAnnotationButNotOverriding() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -3661,7 +3661,7 @@ public void testOverrideAnnotationButNotOverriding() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -3681,14 +3681,14 @@ public void testOverrideAnnotationButNotOverriding() throws Exception { public void testCreateMethodWhenOverrideAnnotation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public abstract class OtherMachine {\n"); buf.append("}\n"); pack1.createCompilationUnit("OtherMachine.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public abstract class Machine extends OtherMachine {\n"); @@ -3704,7 +3704,7 @@ public void testCreateMethodWhenOverrideAnnotation() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public abstract class OtherMachine {\n"); @@ -3713,7 +3713,7 @@ public void testCreateMethodWhenOverrideAnnotation() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public abstract class Machine extends OtherMachine {\n"); @@ -3731,7 +3731,7 @@ public void testMethodOverrideDeprecated1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated\n"); @@ -3753,7 +3753,7 @@ public void testMethodOverrideDeprecated1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated\n"); @@ -3769,7 +3769,7 @@ public void testMethodOverrideDeprecated1() throws Exception { buf.append("\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated\n"); @@ -3795,7 +3795,7 @@ public void testMethodOverrideDeprecated2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated\n"); @@ -3819,7 +3819,7 @@ public void testMethodOverrideDeprecated2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated\n"); @@ -3838,7 +3838,7 @@ public void testMethodOverrideDeprecated2() throws Exception { buf.append("\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated\n"); @@ -3862,7 +3862,7 @@ public void testMethodOverrideDeprecated2() throws Exception { @Test public void testAbstractMethodInEnumWithoutEnumConstants() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -3878,7 +3878,7 @@ public void testAbstractMethodInEnumWithoutEnumConstants() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -3895,7 +3895,7 @@ public void testAbstractMethodInEnumWithoutEnumConstants() throws Exception { @Test public void testInvalidEnumModifier() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("private final strictfp enum E {\n"); @@ -3909,7 +3909,7 @@ public void testInvalidEnumModifier() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("strictfp enum E {\n"); @@ -3922,7 +3922,7 @@ public void testInvalidEnumModifier() throws Exception { @Test public void testInvalidEnumModifier2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("public abstract enum E {\n"); @@ -3936,7 +3936,7 @@ public void testInvalidEnumModifier2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("public enum E {\n"); @@ -3949,7 +3949,7 @@ public void testInvalidEnumModifier2() throws Exception { @Test public void testInvalidEnumConstantModifier() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -3964,7 +3964,7 @@ public void testInvalidEnumConstantModifier() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -3978,7 +3978,7 @@ public void testInvalidEnumConstantModifier() throws Exception { @Test public void testInvalidEnumConstructorModifier() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -3996,7 +3996,7 @@ public void testInvalidEnumConstructorModifier() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("enum E {\n"); @@ -4013,7 +4013,7 @@ public void testInvalidEnumConstructorModifier() throws Exception { @Test public void testInvalidMemberEnumModifier() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("class E {\n"); @@ -4029,7 +4029,7 @@ public void testInvalidMemberEnumModifier() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("class E {\n"); @@ -4044,7 +4044,7 @@ public void testInvalidMemberEnumModifier() throws Exception { @Test public void testMissingSynchronizedOnInheritedMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("r", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("public class A {\n"); @@ -4053,7 +4053,7 @@ public void testMissingSynchronizedOnInheritedMethod() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("class B extends A {\n"); @@ -4069,7 +4069,7 @@ public void testMissingSynchronizedOnInheritedMethod() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package r;\n"); buf.append("\n"); buf.append("class B extends A {\n"); @@ -4089,7 +4089,7 @@ public void testMethodCanBeStatic() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private void foo() {\n"); @@ -4106,7 +4106,7 @@ public void testMethodCanBeStatic() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static void foo() {\n"); @@ -4124,7 +4124,7 @@ public void testMethodCanPotentiallyBeStatic() throws Exception { JavaCore.setOptions(hashtable); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -4139,7 +4139,7 @@ public void testMethodCanPotentiallyBeStatic() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" static void foo() {\n"); @@ -4148,7 +4148,7 @@ public void testMethodCanPotentiallyBeStatic() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" @SuppressWarnings(\"static-method\")\n"); @@ -4173,7 +4173,7 @@ public void testMethodCanPotentiallyBeStatic() throws Exception { public void testOverridingMethodIsPrivate() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A1 {\n"); @@ -4181,7 +4181,7 @@ public void testOverridingMethodIsPrivate() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A1.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B1 extends A1 {\n"); @@ -4197,7 +4197,7 @@ public void testOverridingMethodIsPrivate() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B1 extends A1 {\n"); buf.append(" protected void m1() {\n"); @@ -4222,7 +4222,7 @@ public void testInvalidVisabilityOverrideMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class Abs {\n"); @@ -4230,7 +4230,7 @@ public void testInvalidVisabilityOverrideMethod() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Abs.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class AbsImpl extends test1.Abs {\n"); @@ -4432,7 +4432,7 @@ public void test216898Comment1Variation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class Abs {\n"); @@ -4440,7 +4440,7 @@ public void test216898Comment1Variation() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Abs.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class AbsImpl extends test1.Abs {\n"); @@ -4457,7 +4457,7 @@ public void test216898Comment1Variation() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class AbsImpl extends test1.Abs {\n"); buf.append(" protected String getName() {\n"); @@ -4480,7 +4480,7 @@ public void test216898Comment1Variation() throws Exception { public void testImplementExtendSameMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void xxx();\n"); @@ -4500,7 +4500,7 @@ public void testImplementExtendSameMethod() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" void xxx();\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest1d7.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest1d7.java index 69e359b316c..6e44a893a86 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest1d7.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest1d7.java @@ -86,7 +86,7 @@ public void tearDown() throws Exception { @Test public void testAddSafeVarargs1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -103,7 +103,7 @@ public void testAddSafeVarargs1() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -120,7 +120,7 @@ public void testAddSafeVarargs1() throws Exception { @Test public void testAddSafeVarargs2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -137,7 +137,7 @@ public void testAddSafeVarargs2() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -154,7 +154,7 @@ public void testAddSafeVarargs2() throws Exception { @Test public void testAddSafeVarargs3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -172,7 +172,7 @@ public void testAddSafeVarargs3() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -190,7 +190,7 @@ public void testAddSafeVarargs3() throws Exception { @Test public void testAddSafeVarargs4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class E {\n"); buf.append(" public E(T ... a) {\n"); @@ -205,7 +205,7 @@ public void testAddSafeVarargs4() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class E {\n"); buf.append(" @SafeVarargs\n"); @@ -242,7 +242,7 @@ public void testAddSafeVarargs5() throws Exception { @Test public void testAddSafeVarargsToDeclaration1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -264,7 +264,7 @@ public void testAddSafeVarargsToDeclaration1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -286,7 +286,7 @@ public void testAddSafeVarargsToDeclaration1() throws Exception { @Test public void testAddSafeVarargsToDeclaration2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -309,7 +309,7 @@ public void testAddSafeVarargsToDeclaration2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -332,7 +332,7 @@ public void testAddSafeVarargsToDeclaration2() throws Exception { @Test public void testAddSafeVarargsToDeclaration3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -341,7 +341,7 @@ public void testAddSafeVarargsToDeclaration3() throws Exception { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("class Y {\n"); @@ -358,7 +358,7 @@ public void testAddSafeVarargsToDeclaration3() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("class Y {\n"); @@ -375,7 +375,7 @@ public void testAddSafeVarargsToDeclaration3() throws Exception { @Test public void testAddSafeVarargsToDeclaration4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -400,7 +400,7 @@ public void testAddSafeVarargsToDeclaration4() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -455,7 +455,7 @@ public void testAddSafeVarargsToDeclaration5() throws Exception { @Test public void testRemoveSafeVarargs1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -473,7 +473,7 @@ public void testRemoveSafeVarargs1() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -489,7 +489,7 @@ public void testRemoveSafeVarargs1() throws Exception { @Test public void testRemoveSafeVarargs2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -507,7 +507,7 @@ public void testRemoveSafeVarargs2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -523,7 +523,7 @@ public void testRemoveSafeVarargs2() throws Exception { @Test public void testRemoveSafeVarargs3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -542,7 +542,7 @@ public void testRemoveSafeVarargs3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest9.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest9.java index 49fb01b4070..3316649c97c 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest9.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ModifierCorrectionsQuickFixTest9.java @@ -82,7 +82,7 @@ public void tearDown() throws Exception { @Test public void testAddSafeVarargs1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -99,7 +99,7 @@ public void testAddSafeVarargs1() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -116,7 +116,7 @@ public void testAddSafeVarargs1() throws Exception { @Test public void testAddSafeVarargs2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public interface E {\n"); @@ -133,7 +133,7 @@ public void testAddSafeVarargs2() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("import java.util.List;\n"); buf.append("public interface E {\n"); @@ -156,7 +156,7 @@ public void testMethodOverrideDeprecated1() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(since=\"3\")\n"); @@ -180,7 +180,7 @@ public void testMethodOverrideDeprecated1() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(since=\"3\")\n"); @@ -199,7 +199,7 @@ public void testMethodOverrideDeprecated1() throws Exception { buf.append("\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(since=\"3\")\n"); @@ -229,7 +229,7 @@ public void testMethodOverrideDeprecated2() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(forRemoval=true)\n"); @@ -253,7 +253,7 @@ public void testMethodOverrideDeprecated2() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(forRemoval=true)\n"); @@ -272,7 +272,7 @@ public void testMethodOverrideDeprecated2() throws Exception { buf.append("\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(forRemoval=true)\n"); @@ -302,7 +302,7 @@ public void testMethodOverrideDeprecated3() throws Exception { JavaCore.setOptions(options); IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(since=\"4.2\",forRemoval=true)\n"); @@ -326,7 +326,7 @@ public void testMethodOverrideDeprecated3() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(since=\"4.2\",forRemoval=true)\n"); @@ -345,7 +345,7 @@ public void testMethodOverrideDeprecated3() throws Exception { buf.append("\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Deprecated(since=\"4.2\",forRemoval=true)\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsCleanUpTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsCleanUpTest1d8.java index 9a6e8a89cc7..60396bc7306 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsCleanUpTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsCleanUpTest1d8.java @@ -101,7 +101,7 @@ protected IClasspathEntry[] getDefaultClasspath() throws CoreException { public void testMoveTypeAnnotation() throws Exception { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=468457 IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface X {}\n"); buf.append("@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Y {}\n"); @@ -113,7 +113,7 @@ public void testMoveTypeAnnotation() throws Exception { String original= buf.toString(); ICompilationUnit cu1= pack1.createCompilationUnit("Test.java", original, false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface X {}\n"); buf.append("@java.lang.annotation.Target(java.lang.annotation.ElementType.TYPE_USE) @interface Y {}\n"); @@ -133,7 +133,7 @@ public void testMoveTypeAnnotation() throws Exception { @Test public void testBug528222() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNullByDefault;\n"); @@ -154,7 +154,7 @@ public void testBug528222() throws Exception { String original= buf.toString(); ICompilationUnit cu1= pack1.createCompilationUnit("Test.java", original, false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNullByDefault;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest.java index a6cc7dc2d3d..d903162610a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest.java @@ -136,7 +136,7 @@ public void tearDown() throws Exception { @Test public void testExtractNullableField1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -155,7 +155,7 @@ public void testExtractNullableField1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -176,7 +176,7 @@ public void testExtractNullableField1() throws Exception { @Test public void testExtractNullableField2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -197,7 +197,7 @@ public void testExtractNullableField2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -221,7 +221,7 @@ public void testExtractNullableField2() throws Exception { @Test public void testExtractNullableField3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -241,7 +241,7 @@ public void testExtractNullableField3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -264,7 +264,7 @@ public void testExtractNullableField3() throws Exception { @Test public void testExtractNullableField4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -284,7 +284,7 @@ public void testExtractNullableField4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -307,7 +307,7 @@ public void testExtractNullableField4() throws Exception { @Test public void testExtractNullableField5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -329,7 +329,7 @@ public void testExtractNullableField5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -353,7 +353,7 @@ public void testExtractNullableField5() throws Exception { @Test public void testExtractNullableField6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -374,7 +374,7 @@ public void testExtractNullableField6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -397,7 +397,7 @@ public void testExtractNullableField6() throws Exception { proposal= (CUCorrectionProposal) proposals.get(0); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -420,7 +420,7 @@ public void testExtractNullableField6() throws Exception { @Test public void testExtractNullableField7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("import java.util.List;\n"); @@ -440,7 +440,7 @@ public void testExtractNullableField7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("import java.util.List;\n"); @@ -462,7 +462,7 @@ public void testExtractNullableField7() throws Exception { @Test public void testExtractNullableField8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -481,7 +481,7 @@ public void testExtractNullableField8() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -502,7 +502,7 @@ public void testExtractNullableField8() throws Exception { @Test public void testExtractNullableField9() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -523,7 +523,7 @@ public void testExtractNullableField9() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -549,7 +549,7 @@ public void testExtractNullableField9() throws Exception { @Test public void testExtractPotentiallyNullField1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -569,7 +569,7 @@ public void testExtractPotentiallyNullField1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -591,7 +591,7 @@ public void testExtractPotentiallyNullField1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -607,7 +607,7 @@ public void testExtractPotentiallyNullField1() throws Exception { @Test public void testExtractPotentiallyNullField2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -628,7 +628,7 @@ public void testExtractPotentiallyNullField2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -652,7 +652,7 @@ public void testExtractPotentiallyNullField2() throws Exception { @Test public void testChangeParameter1a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -672,7 +672,7 @@ public void testChangeParameter1a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -688,7 +688,7 @@ public void testChangeParameter1a() throws Exception { @Test public void testChangeParameter1b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -708,7 +708,7 @@ public void testChangeParameter1b() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -723,7 +723,7 @@ public void testChangeParameter1b() throws Exception { @Test public void testChangeParameter1c() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -742,7 +742,7 @@ public void testChangeParameter1c() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -756,7 +756,7 @@ public void testChangeParameter1c() throws Exception { @Test public void testChangeParameter1d() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -775,7 +775,7 @@ public void testChangeParameter1d() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -811,7 +811,7 @@ public void testChangeParameter2() throws Exception { @Test public void testChangeParameter3a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -820,7 +820,7 @@ public void testChangeParameter3a() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 extends E {\n"); @@ -839,7 +839,7 @@ public void testChangeParameter3a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 extends E {\n"); @@ -855,7 +855,7 @@ public void testChangeParameter3a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -870,7 +870,7 @@ public void testChangeParameter3a() throws Exception { @Test public void testChangeParameter3b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -879,7 +879,7 @@ public void testChangeParameter3b() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E {\n"); buf.append(" void foo(Exception e1) {\n"); @@ -897,7 +897,7 @@ public void testChangeParameter3b() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.Nullable;\n"); @@ -917,7 +917,7 @@ public void testChangeParameter3c() throws Exception { // quickfix only offered with this warning enabled, but no need to say, because default is already "warning" // this.fJProject1.setOption(JavaCore.COMPILER_PB_NONNULL_PARAMETER_ANNOTATION_DROPPED, JavaCore.WARNING); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -926,7 +926,7 @@ public void testChangeParameter3c() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E {\n"); buf.append(" void foo(Exception e1) {\n"); @@ -944,7 +944,7 @@ public void testChangeParameter3c() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -963,7 +963,7 @@ public void testChangeParameter3c() throws Exception { @Test public void testChangeParameter4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -973,7 +973,7 @@ public void testChangeParameter4() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 {\n"); @@ -992,7 +992,7 @@ public void testChangeParameter4() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 {\n"); @@ -1008,7 +1008,7 @@ public void testChangeParameter4() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1026,7 +1026,7 @@ public void testChangeParameter4() throws Exception { @Test public void testChangeParameter4a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1036,7 +1036,7 @@ public void testChangeParameter4a() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" void test(E e, Object in) {\n"); @@ -1054,7 +1054,7 @@ public void testChangeParameter4a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1072,7 +1072,7 @@ public void testChangeParameter4a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1132,7 +1132,7 @@ public void testChangeParameter6() throws Exception { @Test public void testChangeParameter7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1152,7 +1152,7 @@ public void testChangeParameter7() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1168,7 +1168,7 @@ public void testChangeParameter7() throws Exception { @Test public void testChangeParameter8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(@org.eclipse.jdt.annotation.NonNull Object o) {\n"); @@ -1187,7 +1187,7 @@ public void testChangeParameter8() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.Nullable;\n"); @@ -1207,7 +1207,7 @@ public void testChangeParameter9() throws Exception { fJProject1.setOption(JavaCore.COMPILER_INHERIT_NULL_ANNOTATIONS, JavaCore.ENABLED); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1217,7 +1217,7 @@ public void testChangeParameter9() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1238,7 +1238,7 @@ public void testChangeParameter9() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1255,7 +1255,7 @@ public void testChangeParameter9() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1273,7 +1273,7 @@ public void testChangeParameter9() throws Exception { @Test public void testChangeReturn1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1290,7 +1290,7 @@ public void testChangeReturn1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1305,7 +1305,7 @@ public void testChangeReturn1() throws Exception { @Test public void testChangeReturn2a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1315,7 +1315,7 @@ public void testChangeReturn2a() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 extends E {\n"); @@ -1334,7 +1334,7 @@ public void testChangeReturn2a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 extends E {\n"); @@ -1350,7 +1350,7 @@ public void testChangeReturn2a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1364,7 +1364,7 @@ public void testChangeReturn2a() throws Exception { @Test public void testChangeReturn2b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1374,7 +1374,7 @@ public void testChangeReturn2b() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E {\n"); buf.append(" Object foo() {\n"); @@ -1389,7 +1389,7 @@ public void testChangeReturn2b() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1410,7 +1410,7 @@ public void testChangeReturn3() throws Exception { fJProject1.setOption(JavaCore.COMPILER_INHERIT_NULL_ANNOTATIONS, JavaCore.ENABLED); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1420,7 +1420,7 @@ public void testChangeReturn3() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public interface IE {\n"); @@ -1428,7 +1428,7 @@ public void testChangeReturn3() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("IE.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 extends E implements IE {\n"); buf.append(" public Object foo() {\n"); @@ -1447,7 +1447,7 @@ public void testChangeReturn3() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.Nullable;\n"); @@ -1465,7 +1465,7 @@ public void testChangeReturn3() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1487,7 +1487,7 @@ public void testChangeReturn3() throws Exception { @Test public void testChangeReturn4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1498,7 +1498,7 @@ public void testChangeReturn4() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 {\n"); @@ -1518,7 +1518,7 @@ public void testChangeReturn4() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 {\n"); @@ -1534,7 +1534,7 @@ public void testChangeReturn4() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1557,12 +1557,12 @@ public void testChangeReturn5() throws Exception { fJProject1.setOption(JavaCore.COMPILER_PB_SUPPRESS_OPTIONAL_ERRORS, JavaCore.ENABLED); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1572,7 +1572,7 @@ public void testChangeReturn5() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" public Object foo(E e) {\n"); // non-null by default @@ -1591,7 +1591,7 @@ public void testChangeReturn5() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.Nullable;\n"); @@ -1609,7 +1609,7 @@ public void testChangeReturn5() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1631,12 +1631,12 @@ public void testChangeReturn5() throws Exception { public void testChangeReturn6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault(false)\n"); // <- HERE @@ -1647,7 +1647,7 @@ public void testChangeReturn6() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E2 {\n"); buf.append(" public Object foo(E e) {\n"); // non-null by default @@ -1666,7 +1666,7 @@ public void testChangeReturn6() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.Nullable;\n"); @@ -1684,7 +1684,7 @@ public void testChangeReturn6() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault(false)\n"); @@ -1699,7 +1699,7 @@ public void testChangeReturn6() throws Exception { @Test public void testRemoveRedundantAnnotation1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1715,7 +1715,7 @@ public void testRemoveRedundantAnnotation1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1729,7 +1729,7 @@ public void testRemoveRedundantAnnotation1() throws Exception { @Test public void testRemoveRedundantAnnotation2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1747,7 +1747,7 @@ public void testRemoveRedundantAnnotation2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1762,7 +1762,7 @@ public void testRemoveRedundantAnnotation2() throws Exception { @Test public void testRemoveRedundantAnnotation3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1780,7 +1780,7 @@ public void testRemoveRedundantAnnotation3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1795,7 +1795,7 @@ public void testRemoveRedundantAnnotation3() throws Exception { @Test public void testRemoveRedundantAnnotation4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1812,7 +1812,7 @@ public void testRemoveRedundantAnnotation4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1826,7 +1826,7 @@ public void testRemoveRedundantAnnotation4() throws Exception { @Test public void testRemoveRedundantAnnotation5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1843,7 +1843,7 @@ public void testRemoveRedundantAnnotation5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1857,7 +1857,7 @@ public void testRemoveRedundantAnnotation5() throws Exception { @Test public void testRemoveRedundantAnnotation6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1876,7 +1876,7 @@ public void testRemoveRedundantAnnotation6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1892,12 +1892,12 @@ public void testRemoveRedundantAnnotation6() throws Exception { @Test public void testRemoveRedundantAnnotation7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1911,7 +1911,7 @@ public void testRemoveRedundantAnnotation7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1922,12 +1922,12 @@ public void testRemoveRedundantAnnotation7() throws Exception { @Test public void testRemoveRedundantAnnotation8() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1943,7 +1943,7 @@ public void testRemoveRedundantAnnotation8() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1955,7 +1955,7 @@ public void testRemoveRedundantAnnotation8() throws Exception { @Test public void testAddNonNull() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public double foo(boolean b) {\n"); @@ -1976,7 +1976,7 @@ public void testAddNonNull() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -2000,7 +2000,7 @@ public void testAddNonNull() throws Exception { @Test public void testBug506108() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -2009,7 +2009,7 @@ public void testBug506108() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 extends E {\n"); @@ -2028,7 +2028,7 @@ public void testBug506108() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E2 extends E {\n"); @@ -2044,7 +2044,7 @@ public void testBug506108() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8.java index cac0722c3d3..e661b2735b8 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8.java @@ -129,12 +129,12 @@ public void tearDown() throws Exception { public void testBug499716_a() throws Exception { fJProject1.setOption(JavaCore.COMPILER_INHERIT_NULL_ANNOTATIONS, JavaCore.ENABLED); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -160,7 +160,7 @@ public void testBug499716_a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -183,7 +183,7 @@ public void testBug499716_a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -206,7 +206,7 @@ public void testBug499716_a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -237,12 +237,12 @@ public void testBug499716_a() throws Exception { public void testBug499716_b() throws Exception { fJProject1.setOption(JavaCore.COMPILER_INHERIT_NULL_ANNOTATIONS, JavaCore.ENABLED); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -266,7 +266,7 @@ public void testBug499716_b() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -287,7 +287,7 @@ public void testBug499716_b() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -316,7 +316,7 @@ public void testBug499716_c() throws Exception { fJProject1.setOption(JavaCore.COMPILER_INHERIT_NULL_ANNOTATIONS, JavaCore.ENABLED); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -342,7 +342,7 @@ public void testBug499716_c() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -365,7 +365,7 @@ public void testBug499716_c() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -395,12 +395,12 @@ public void testBug499716_c() throws Exception { @Test public void testBug499716_d() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -424,7 +424,7 @@ public void testBug499716_d() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -445,7 +445,7 @@ public void testBug499716_d() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("\n"); @@ -469,12 +469,12 @@ public void testBug499716_d() throws Exception { @Test public void test443146a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -497,7 +497,7 @@ public void test443146a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -519,7 +519,7 @@ public void test443146a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -539,7 +539,7 @@ public void test443146a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -561,12 +561,12 @@ public void test443146a() throws Exception { @Test public void test443146b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -589,7 +589,7 @@ public void test443146b() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -611,7 +611,7 @@ public void test443146b() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -631,7 +631,7 @@ public void test443146b() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -652,12 +652,12 @@ public void test443146b() throws Exception { @Test public void test443146c() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -682,7 +682,7 @@ public void test443146c() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -706,7 +706,7 @@ public void test443146c() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -728,7 +728,7 @@ public void test443146c() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -751,7 +751,7 @@ public void test443146c() throws Exception { @Test public void test443146d() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -772,7 +772,7 @@ public void test443146d() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -790,12 +790,12 @@ public void test443146d() throws Exception { @Test public void test443146e() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -818,7 +818,7 @@ public void test443146e() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -840,7 +840,7 @@ public void test443146e() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -860,7 +860,7 @@ public void test443146e() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -881,12 +881,12 @@ public void test443146e() throws Exception { @Test public void test443146f() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), true, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -909,7 +909,7 @@ public void test443146f() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -931,7 +931,7 @@ public void test443146f() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -951,7 +951,7 @@ public void test443146f() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -968,7 +968,7 @@ public void test443146f() throws Exception { @Test public void testBug513682() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -990,7 +990,7 @@ public void testBug513682() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1007,7 +1007,7 @@ public void testBug513682() throws Exception { @Test public void testBug513209a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void SomeMethod(\n"); @@ -1018,7 +1018,7 @@ public void testBug513209a() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf = new StringBuffer(); + buf = new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1041,7 +1041,7 @@ public void testBug513209a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1059,7 +1059,7 @@ public void testBug513209a() throws Exception { @Test public void testBug513209b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void SomeMethod(\n"); @@ -1070,7 +1070,7 @@ public void testBug513209b() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf = new StringBuffer(); + buf = new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1093,7 +1093,7 @@ public void testBug513209b() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1111,7 +1111,7 @@ public void testBug513209b() throws Exception { @Test public void testBug513209c() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void SomeMethod(\n"); @@ -1122,7 +1122,7 @@ public void testBug513209c() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf = new StringBuffer(); + buf = new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class B extends A {\n"); @@ -1144,7 +1144,7 @@ public void testBug513209c() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class B extends A {\n"); @@ -1161,7 +1161,7 @@ public void testBug513209c() throws Exception { @Test public void testBug513209d() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1173,7 +1173,7 @@ public void testBug513209d() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf = new StringBuffer(); + buf = new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B extends A {\n"); buf.append(" @Override\n"); @@ -1193,7 +1193,7 @@ public void testBug513209d() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1218,7 +1218,7 @@ public void testBug525424() throws Exception { JavaCore.setOptions(myOptions); IPackageFragment my= fSourceFolder.createPackageFragment("my", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1229,7 +1229,7 @@ public void testBug525424() throws Exception { buf.append("}\n"); my.createCompilationUnit("Nullable.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1240,7 +1240,7 @@ public void testBug525424() throws Exception { buf.append("}\n"); my.createCompilationUnit("NonNull.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("public enum DefaultLocation {\n"); @@ -1249,7 +1249,7 @@ public void testBug525424() throws Exception { buf.append(""); my.createCompilationUnit("DefaultLocation.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import static my.DefaultLocation.*;\n"); @@ -1261,7 +1261,7 @@ public void testBug525424() throws Exception { my.createCompilationUnit("NonNullByDefault.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void SomeMethod(\n"); @@ -1272,7 +1272,7 @@ public void testBug525424() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import my.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1295,7 +1295,7 @@ public void testBug525424() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import my.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1324,7 +1324,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA fJProject1.setOptions(myOptions); IPackageFragment my= fSourceFolder.createPackageFragment("my", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); if(useTypeAnnotations) { @@ -1336,7 +1336,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append("}\n"); my.createCompilationUnit("Nullable.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("\n"); @@ -1349,7 +1349,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append("}\n"); my.createCompilationUnit("NonNull.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("public enum DefaultLocation {\n"); @@ -1358,7 +1358,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("DefaultLocation.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("public @interface TypeQualifierDefault {\n"); @@ -1367,7 +1367,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("TypeQualifierDefault.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import static my.DefaultLocation.*;\n"); @@ -1378,7 +1378,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("NonNullByDefault.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1389,7 +1389,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("NNApi.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1400,7 +1400,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("NNParams.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1411,7 +1411,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("NNReturn.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1422,7 +1422,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("NNFields.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("public @interface NNBDBoolean {\n"); @@ -1431,7 +1431,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA buf.append(""); my.createCompilationUnit("NNBDBoolean.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package my;\n"); buf.append("\n"); buf.append("public @interface NNBDUnconfigurable {\n"); @@ -1441,7 +1441,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA IPackageFragment api= fSourceFolder.createPackageFragment("api", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package api;\n"); buf.append("import my.*;\n"); buf.append("public interface I {\n"); @@ -1450,7 +1450,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA api.createCompilationUnit("I.java", buf.toString(), false, null); IPackageFragment test= fSourceFolder.createPackageFragment("test", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@my.NonNullByDefault(my.DefaultLocation.TYPE_BOUND)\n"); // create irrelevant package default, so no tested combination will be redunant buf.append("package test;\n"); test.createCompilationUnit("package-info.java", buf.toString(), false, null); @@ -1461,7 +1461,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA assertEquals(0, markers.length); // actual test begins here - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import my.*;\n"); buf.append(defaultNullnessAnnotations+ "\n"); @@ -1473,7 +1473,7 @@ public void runBug531511Test(boolean useTypeAnnotations, String defaultNullnessA ArrayList proposals= collectCorrections(cu, astRoot); assertNumberOfProposals(proposals, 2); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import my.*;\n"); buf.append(defaultNullnessAnnotations+ "\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8Mix.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8Mix.java index b0589bff94f..7ad1db41033 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8Mix.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest1d8Mix.java @@ -119,7 +119,7 @@ public void tearDown() throws Exception { @Test public void testBug473068_elided() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("testNullAnnotations", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -149,7 +149,7 @@ public void testBug473068_elided() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -175,7 +175,7 @@ public void testBug473068_elided() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -207,7 +207,7 @@ public void testBug473068_elided() throws Exception { @Test public void testBug473068_explicit_type() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("testNullAnnotations", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -237,7 +237,7 @@ public void testBug473068_explicit_type() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -262,7 +262,7 @@ public void testBug473068_explicit_type() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -288,7 +288,7 @@ public void testBug473068_explicit_type() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package testNullAnnotations;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest9.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest9.java index be74c508db1..fdd1708429f 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest9.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/NullAnnotationsQuickFixTest9.java @@ -61,14 +61,14 @@ public void setUp() throws CoreException { IPackageFragmentRoot java9Src= JavaProjectHelper.addSourceContainer(fJProject2, "src"); IPackageFragment def= java9Src.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module annots {\n"); buf.append(" exports annots; \n"); buf.append("}\n"); def.createCompilationUnit("module-info.java", buf.toString(), false, null); IPackageFragment annots= java9Src.createPackageFragment("annots", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -79,7 +79,7 @@ public void setUp() throws CoreException { buf.append("}\n"); annots.createCompilationUnit("Nullable.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -90,7 +90,7 @@ public void setUp() throws CoreException { buf.append("}\n"); annots.createCompilationUnit("NonNull.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("public enum DefaultLocation {\n"); @@ -99,7 +99,7 @@ public void setUp() throws CoreException { buf.append(""); annots.createCompilationUnit("DefaultLocation.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package annots;\n"); buf.append("\n"); buf.append("import static annots.DefaultLocation.*;\n"); @@ -143,7 +143,7 @@ public void tearDown() throws Exception { @Test public void testBug530580a() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@annots.NonNullByDefault module test {\n"); buf.append(" requires annots;"); buf.append("}\n"); @@ -152,7 +152,7 @@ public void testBug530580a() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import annots.*;\n"); @@ -175,7 +175,7 @@ public void testBug530580a() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import annots.*;\n"); @@ -197,7 +197,7 @@ public void testBug530580a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import annots.*;\n"); @@ -217,7 +217,7 @@ public void testBug530580a() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import annots.*;\n"); @@ -233,7 +233,7 @@ public void testBug530580a() throws Exception { } @Test public void testBug530580b() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("@annots.NonNullByDefault module test {\n"); buf.append(" requires annots;"); buf.append("}\n"); @@ -242,7 +242,7 @@ public void testBug530580b() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import annots.*;\n"); buf.append("\n"); @@ -266,7 +266,7 @@ public void testBug530580b() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import annots.*;\n"); buf.append("\n"); @@ -287,7 +287,7 @@ public void testBug530580b() throws Exception { preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import annots.*;\n"); buf.append("\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java index d7e923b8679..b764a3571e2 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/PropertiesFileQuickAssistTest.java @@ -178,7 +178,7 @@ public void testCreateFieldInAccessor1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -192,7 +192,7 @@ public void testCreateFieldInAccessor1() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); @@ -208,7 +208,7 @@ public void testCreateFieldInAccessor1() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -228,7 +228,7 @@ public void testCreateFieldInAccessor2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -242,7 +242,7 @@ public void testCreateFieldInAccessor2() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); @@ -259,7 +259,7 @@ public void testCreateFieldInAccessor2() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -280,7 +280,7 @@ public void testCreateFieldInAccessor3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -297,7 +297,7 @@ public void testCreateFieldInAccessor3() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append("Test_3=Hello3\n"); @@ -316,7 +316,7 @@ public void testCreateFieldInAccessor3() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -339,7 +339,7 @@ public void testCreateFieldInAccessor4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -357,7 +357,7 @@ public void testCreateFieldInAccessor4() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append("Test_3=Hello3\n"); @@ -378,7 +378,7 @@ public void testCreateFieldInAccessor4() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -403,7 +403,7 @@ public void testCreateFieldInAccessor5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -421,7 +421,7 @@ public void testCreateFieldInAccessor5() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_3=Hello3\n"); buf.append("Test_4=Hello4\n"); @@ -442,7 +442,7 @@ public void testCreateFieldInAccessor5() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -468,7 +468,7 @@ public void testCreateFieldInAccessor6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class RandomName extends NLS {\n"); @@ -482,7 +482,7 @@ public void testCreateFieldInAccessor6() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("RandomName.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); @@ -498,7 +498,7 @@ public void testCreateFieldInAccessor6() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class RandomName extends NLS {\n"); @@ -518,7 +518,7 @@ public void testRemoveProperty1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -532,7 +532,7 @@ public void testRemoveProperty1() throws Exception { pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); @@ -548,7 +548,7 @@ public void testRemoveProperty1() throws Exception { proposal.apply(context.getDocument()); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); } @@ -558,7 +558,7 @@ public void testRemoveProperty2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -572,7 +572,7 @@ public void testRemoveProperty2() throws Exception { pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); @@ -589,7 +589,7 @@ public void testRemoveProperty2() throws Exception { proposal.apply(context.getDocument()); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); checkContentOfFile("property file", file, buf.toString()); } @@ -598,7 +598,7 @@ public void testRemoveProperty3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -614,7 +614,7 @@ public void testRemoveProperty3() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); IFile file= createPropertyFile(pack1, "Accessor.properties", buf.toString()); @@ -630,7 +630,7 @@ public void testRemoveProperty3() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -645,7 +645,7 @@ public void testRemoveProperty3() throws Exception { checkContentOfCu("nls file", cu, buf.toString()); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_2=Hello2\n"); checkContentOfFile("property file", file, buf.toString()); } @@ -655,7 +655,7 @@ public void testRemoveProperty4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -675,7 +675,7 @@ public void testRemoveProperty4() throws Exception { ICompilationUnit cu= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append("Test_3=Hello3\n"); @@ -696,7 +696,7 @@ public void testRemoveProperty4() throws Exception { proposal.apply(context.getDocument()); // Accessor class - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -714,7 +714,7 @@ public void testRemoveProperty4() throws Exception { checkContentOfCu("nls file", cu, buf.toString()); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append("Test_5=Hello5\n"); @@ -727,7 +727,7 @@ public void testNoProposals1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -743,7 +743,7 @@ public void testNoProposals1() throws Exception { pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append(" \n"); @@ -765,7 +765,7 @@ public void testNoProposals2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -781,7 +781,7 @@ public void testNoProposals2() throws Exception { pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append(" \n"); @@ -803,7 +803,7 @@ public void testNoProposals3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); // Accessor class - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -819,7 +819,7 @@ public void testNoProposals3() throws Exception { pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); // property file - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Test_1=Hello1\n"); buf.append("Test_2=Hello2\n"); buf.append(" \n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixEnablementTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixEnablementTest.java index f0e640c9684..a2bbbf743c2 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixEnablementTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixEnablementTest.java @@ -68,7 +68,7 @@ public void testContributedQuickFix1() throws Exception { // quick fix is contributed only for files with name 'A.java' in a 1.5 project IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -84,7 +84,7 @@ public void testContributedQuickFix1() throws Exception { String[] previewContents= getPreviewContents(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -100,7 +100,7 @@ public void testContributedQuickFix1() throws Exception { public void testContributedQuickFix2() throws Exception { // quick fix is contributed only for files with name 'A.java' in a 1.5 project IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void foo() {\n"); @@ -121,7 +121,7 @@ public void testContributedQuickFix2() throws Exception { assertNumberOfProposals(collectCorrections(cu, getASTRoot(cu)), 0); // wrong version - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B {\n"); buf.append(" public void foo() {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest14.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest14.java index 3f9b7f9bfb5..6ee4157f1a2 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest14.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest14.java @@ -552,7 +552,7 @@ public void testReplaceIncorrectReturnInSwitchExpressionWithYieldStatement2() th JavaProjectHelper.set14CompilerOptions(fJProject1, false); fSourceFolder= JavaProjectHelper.addSourceContainer(fJProject1, "src"); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("module test {\n"); buf.append("}\n"); IPackageFragment def= fSourceFolder.createPackageFragment("", false, null); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest1d8.java index 1897488e030..17e8a99557b 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/QuickFixTest1d8.java @@ -93,7 +93,7 @@ public void tearDown() throws Exception { @Test public void testUnimplementedMethods1() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -105,7 +105,7 @@ public void testUnimplementedMethods1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public class E implements Inter{\n"); @@ -120,7 +120,7 @@ public void testUnimplementedMethods1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(1); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public abstract class E implements Inter{\n"); @@ -130,7 +130,7 @@ public void testUnimplementedMethods1() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("\n"); @@ -150,9 +150,9 @@ public void testUnimplementedMethods1() throws Exception { @Test public void testUnimplementedMethods2() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class MyString implements CharSequence{\n"); buf.append("}\n"); @@ -166,7 +166,7 @@ public void testUnimplementedMethods2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(1); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class MyString implements CharSequence{\n"); buf.append("}\n"); @@ -175,7 +175,7 @@ public void testUnimplementedMethods2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class MyString implements CharSequence{\n"); buf.append("\n"); @@ -207,7 +207,7 @@ public void testUnimplementedMethods3() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public interface List {\n"); buf.append("}\n"); @@ -229,7 +229,7 @@ public void testUnimplementedMethods3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public class E implements Inter{\n"); @@ -244,7 +244,7 @@ public void testUnimplementedMethods3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(1); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public abstract class E implements Inter{\n"); @@ -254,7 +254,7 @@ public void testUnimplementedMethods3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.util.List;\n\n"); @@ -294,7 +294,7 @@ public void testUnimplementedMethods4() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -317,7 +317,7 @@ public void testUnimplementedMethods4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(1); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -334,7 +334,7 @@ public void testUnimplementedMethods4() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); @@ -366,7 +366,7 @@ public void testUnimplementedMethods5() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public interface List {\n"); buf.append("}\n"); @@ -388,7 +388,7 @@ public void testUnimplementedMethods5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public class E implements Inter{\n"); @@ -403,7 +403,7 @@ public void testUnimplementedMethods5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(1); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("public abstract class E implements Inter{\n"); @@ -413,7 +413,7 @@ public void testUnimplementedMethods5() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.Inter;\n"); buf.append("import test2.N1;\n"); @@ -436,7 +436,7 @@ public void testUnimplementedMethods5() throws Exception { @Test public void testUnimplementedMethods6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("interface IHasInt {\n"); @@ -459,7 +459,7 @@ public void testUnimplementedMethods6() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("interface IHasInt {\n"); @@ -480,7 +480,7 @@ public void testUnimplementedMethods6() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("interface IHasInt {\n"); @@ -502,7 +502,7 @@ public void testUnimplementedMethods6() throws Exception { @Test public void testUnimplementedMethodReference1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" void foo(Runnable r) {\n"); @@ -520,7 +520,7 @@ public void testUnimplementedMethodReference1() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" void foo(Runnable r) {\n"); @@ -539,7 +539,7 @@ public void testUnimplementedMethodReference1() throws Exception { @Test public void testUnimplementedMethodReference2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Comparator;\n"); buf.append("class E {\n"); @@ -558,7 +558,7 @@ public void testUnimplementedMethodReference2() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Comparator;\n"); buf.append("class E {\n"); @@ -579,7 +579,7 @@ public void testUnimplementedMethodReference2() throws Exception { @Test public void testUnimplementedMethodReference3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("class E {\n"); @@ -598,7 +598,7 @@ public void testUnimplementedMethodReference3() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.Function;\n"); buf.append("class E {\n"); @@ -619,7 +619,7 @@ public void testUnimplementedMethodReference3() throws Exception { @Test public void testUnimplementedMethodReference4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface F\n"); buf.append(" T baz();\n"); @@ -640,7 +640,7 @@ public void testUnimplementedMethodReference4() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface F\n"); buf.append(" T baz();\n"); @@ -663,7 +663,7 @@ public void testUnimplementedMethodReference4() throws Exception { @Test public void testUnimplementedMethodReference5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.BiFunction;\n"); buf.append("class E {\n"); @@ -682,7 +682,7 @@ public void testUnimplementedMethodReference5() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.function.BiFunction;\n"); buf.append("class E {\n"); @@ -703,7 +703,7 @@ public void testUnimplementedMethodReference5() throws Exception { @Test public void testLambdaReturnType1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -728,7 +728,7 @@ public void testLambdaReturnType1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -751,7 +751,7 @@ public void testLambdaReturnType1() throws Exception { @Test public void testLambdaReturnType2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -775,7 +775,7 @@ public void testLambdaReturnType2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -797,7 +797,7 @@ public void testLambdaReturnType2() throws Exception { @Test public void testLambdaReturnType3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -823,7 +823,7 @@ public void testLambdaReturnType3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -846,7 +846,7 @@ public void testLambdaReturnType3() throws Exception { @Test public void testLambdaReturnType4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -869,7 +869,7 @@ public void testLambdaReturnType4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@FunctionalInterface\n"); buf.append("interface I {\n"); @@ -890,9 +890,9 @@ public void testLambdaReturnType4() throws Exception { // bug 424172 @Test public void testImportTypeInMethodReference() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test.one", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test.one;\n"); buf.append("\n"); buf.append("public class X {\n"); @@ -901,7 +901,7 @@ public void testImportTypeInMethodReference() throws Exception { buf.append(" }\n"); buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test.one;\n"); buf.append("\n"); buf.append("@FunctionalInterface\n"); @@ -911,7 +911,7 @@ public void testImportTypeInMethodReference() throws Exception { pack1.createCompilationUnit("F2.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test.two", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test.two;\n"); buf.append("\n"); buf.append("import test.one.F2;\n"); @@ -930,7 +930,7 @@ public void testImportTypeInMethodReference() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test.two;\n"); buf.append("\n"); buf.append("import test.one.F2;\n"); @@ -947,7 +947,7 @@ public void testImportTypeInMethodReference() throws Exception { @Test public void testLambdaReturnType5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -972,7 +972,7 @@ public void testLambdaReturnType5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.math.BigInteger;\n"); buf.append("\n"); @@ -995,7 +995,7 @@ public void testLambdaReturnType5() throws Exception { @Test public void testChangeModifierToStatic1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface A {\n"); buf.append(" int i = foo();\n"); @@ -1020,7 +1020,7 @@ public void testChangeModifierToStatic1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface A {\n"); buf.append(" int i = foo();\n"); @@ -1043,7 +1043,7 @@ public void testChangeModifierToStatic1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface A {\n"); buf.append(" int i = foo();\n"); @@ -1068,7 +1068,7 @@ public void testChangeModifierToStatic1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface A {\n"); buf.append(" int i = foo();\n"); @@ -1092,7 +1092,7 @@ public void testChangeModifierToStatic1() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface A {\n"); buf.append(" int i = foo();\n"); @@ -1117,7 +1117,7 @@ public void testChangeModifierToStatic1() throws Exception { @Test public void testChangeModifierToStatic2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Test {\n"); buf.append(" int i= foo();\n"); @@ -1133,7 +1133,7 @@ public void testChangeModifierToStatic2() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Test {\n"); buf.append(" int i= foo();\n"); @@ -1148,7 +1148,7 @@ public void testChangeModifierToStatic2() throws Exception { @Test public void testInvalidInterfaceMethodModifier1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -1164,7 +1164,7 @@ public void testInvalidInterfaceMethodModifier1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -1179,7 +1179,7 @@ public void testInvalidInterfaceMethodModifier1() throws Exception { @Test public void testInvalidInterfaceMethodModifier2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -1195,7 +1195,7 @@ public void testInvalidInterfaceMethodModifier2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public interface Inter {\n"); @@ -1209,9 +1209,9 @@ public void testInvalidInterfaceMethodModifier2() throws Exception { // bug 414084 @Test public void testAbstractInterfaceMethodWithBody1() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1228,7 +1228,7 @@ public void testAbstractInterfaceMethodWithBody1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1239,7 +1239,7 @@ public void testAbstractInterfaceMethodWithBody1() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1251,7 +1251,7 @@ public void testAbstractInterfaceMethodWithBody1() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1267,9 +1267,9 @@ public void testAbstractInterfaceMethodWithBody1() throws Exception { // bug 414084 @Test public void testAbstractInterfaceMethodWithBody2() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1286,7 +1286,7 @@ public void testAbstractInterfaceMethodWithBody2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1297,7 +1297,7 @@ public void testAbstractInterfaceMethodWithBody2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1309,7 +1309,7 @@ public void testAbstractInterfaceMethodWithBody2() throws Exception { proposal= (CUCorrectionProposal)proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Snippet{\n"); buf.append("\n"); @@ -1324,9 +1324,9 @@ public void testAbstractInterfaceMethodWithBody2() throws Exception { // bug 434173 @Test public void testAbstractInterfaceMethodWithBody3() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" public strictfp native void foo() {}\n"); @@ -1340,7 +1340,7 @@ public void testAbstractInterfaceMethodWithBody3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(3); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" public void foo() {}\n"); @@ -1349,7 +1349,7 @@ public void testAbstractInterfaceMethodWithBody3() throws Exception { proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" public void foo();\n"); @@ -1360,9 +1360,9 @@ public void testAbstractInterfaceMethodWithBody3() throws Exception { // bug 424616 @Test public void testInferredExceptionType() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class AddThrows {\n"); buf.append(" interface Getter2 { T get() throws E; }\n"); @@ -1382,7 +1382,7 @@ public void testInferredExceptionType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class AddThrows {\n"); buf.append(" interface Getter2 { T get() throws E; }\n"); @@ -1402,7 +1402,7 @@ public void testInferredExceptionType() throws Exception { proposal= (CUCorrectionProposal)proposals.get(1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class AddThrows {\n"); buf.append(" interface Getter2 { T get() throws E; }\n"); @@ -1431,7 +1431,7 @@ public void testAddNonNull1() throws Exception { JavaProjectHelper.addLibrary(fJProject1, new Path(Java1d8ProjectTestSetup.getJdtAnnotations20Path())); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public double foo(T t) {\n"); @@ -1449,7 +1449,7 @@ public void testAddNonNull1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1480,7 +1480,7 @@ public void testAddNonNull2() throws Exception { JavaProjectHelper.addLibrary(fJProject1, new Path(Java1d8ProjectTestSetup.getJdtAnnotations20Path())); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public double foo(T t) {\n"); @@ -1498,7 +1498,7 @@ public void testAddNonNull2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1530,7 +1530,7 @@ public void testRemoveRedundantNonNullByDefault1() throws Exception { JavaProjectHelper.addLibrary(fJProject1, new Path(Java1d8ProjectTestSetup.getJdtAnnotations20Path())); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1550,7 +1550,7 @@ public void testRemoveRedundantNonNullByDefault1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1581,7 +1581,7 @@ public void testRemoveRedundantNonNullByDefault2() throws Exception { JavaProjectHelper.addLibrary(fJProject1, new Path(Java1d8ProjectTestSetup.getJdtAnnotations20Path())); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1603,7 +1603,7 @@ public void testRemoveRedundantNonNullByDefault2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("public class E {\n"); @@ -1636,7 +1636,7 @@ public void testRemoveRedundantNonNullByDefault3() throws Exception { JavaProjectHelper.addLibrary(fJProject1, new Path(Java1d8ProjectTestSetup.getJdtAnnotations20Path())); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1652,7 +1652,7 @@ public void testRemoveRedundantNonNullByDefault3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1727,7 +1727,7 @@ public void testRemoveRedundantNonNull() throws Exception { JavaProjectHelper.addLibrary(fJProject1, new Path(Java1d8ProjectTestSetup.getJdtAnnotations20Path())); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1744,7 +1744,7 @@ public void testRemoveRedundantNonNull() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import org.eclipse.jdt.annotation.*;\n"); buf.append("@NonNullByDefault\n"); @@ -1763,14 +1763,14 @@ public void testBug514580_avoidRedundantNonNullInChangeMethodSignatureFix() thro IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1801,7 +1801,7 @@ public void testBug514580_avoidRedundantNonNullInChangeMethodSignatureFix() thro List proposals1= collectCorrections(cu, problems[0], null); List proposals2= collectCorrections(cu, problems[1], null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1826,7 +1826,7 @@ public void testBug514580_avoidRedundantNonNullInChangeMethodSignatureFix() thro buf.append("}"); assertProposalPreviewEquals(buf.toString(), "Change method 'g(Number, Number)' to 'g(Boolean, Boolean)'", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import org.eclipse.jdt.annotation.NonNull;\n"); @@ -1860,14 +1860,14 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_field() throws Excep IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1911,7 +1911,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_field() throws Excep List proposals1= collectCorrections(cu, problems[0], null); List proposals2= collectCorrections(cu, problems[1], null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1949,7 +1949,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_field() throws Excep buf.append("}"); assertProposalPreviewEquals(buf.toString(), "Change type of 'f1' to 'String'", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -1987,7 +1987,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_field() throws Excep buf.append("}"); assertProposalPreviewEquals(buf.toString(), "Change type of 'f2' to 'String'", proposals2); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2024,7 +2024,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_field() throws Excep buf.append("}"); assertProposalPreviewEquals(buf.toString(), "Change return type of 'g(..)' to 'Map[]'", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2070,14 +2070,14 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_local() throws Excep IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2120,7 +2120,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_local() throws Excep List proposals1= collectCorrections(cu, problems[0], null); List proposals2= collectCorrections(cu, problems[1], null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2157,7 +2157,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_local() throws Excep buf.append(""); assertProposalPreviewEquals(buf.toString(), "Change type of 'l1' to 'String'", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2194,7 +2194,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_local() throws Excep buf.append(""); assertProposalPreviewEquals(buf.toString(), "Change type of 'l2' to 'String'", proposals2); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2230,7 +2230,7 @@ public void testBug514580_avoidRedundantNonNullInTypeChange_local() throws Excep buf.append(""); assertProposalPreviewEquals(buf.toString(), "Change return type of 'h(..)' to 'Map[]'", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.lang.annotation.ElementType;\n"); @@ -2275,7 +2275,7 @@ public void testBug496103_createParam() throws Exception { IPackageFragment pack2= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" protected final String param1;\n"); @@ -2297,7 +2297,7 @@ public void testBug496103_createParam() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" protected final static String param1;\n"); @@ -2315,7 +2315,7 @@ public void testBug496103_createParam() throws Exception { assertExpectedExistInProposals(proposals, new String[] {expected}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" protected final String param1;\n"); @@ -2335,7 +2335,7 @@ public void testBug496103_createParam() throws Exception { assertExpectedExistInProposals(proposals, new String[] {expected}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" protected final String param1;\n"); @@ -2353,7 +2353,7 @@ public void testBug496103_createParam() throws Exception { assertExpectedExistInProposals(proposals, new String[] {expected}); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class E {\n"); buf.append(" protected final String param1;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReorgQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReorgQuickFixTest.java index 3c52883e822..3d963676ac1 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReorgQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReorgQuickFixTest.java @@ -100,7 +100,7 @@ public void tearDown() throws Exception { @Test public void testUnusedImports() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -120,7 +120,7 @@ public void testUnusedImports() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) p1; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append("}\n"); @@ -130,7 +130,7 @@ public void testUnusedImports() throws Exception { @Test public void testUnusedImportsInDefaultPackage() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); buf.append("}\n"); @@ -149,7 +149,7 @@ public void testUnusedImportsInDefaultPackage() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) p1; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("\n"); buf.append("public class E {\n"); buf.append("}\n"); @@ -159,7 +159,7 @@ public void testUnusedImportsInDefaultPackage() throws Exception { @Test public void testUnusedImportOnDemand() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -183,7 +183,7 @@ public void testUnusedImportOnDemand() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) p1; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -197,7 +197,7 @@ public void testUnusedImportOnDemand() throws Exception { @Test public void testCollidingImports() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Date;\n"); @@ -223,7 +223,7 @@ public void testCollidingImports() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) p1; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Date;\n"); @@ -239,7 +239,7 @@ public void testCollidingImports() throws Exception { @Test public void testWrongPackageStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -261,7 +261,7 @@ public void testWrongPackageStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) curr; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -275,7 +275,7 @@ public void testWrongPackageStatement() throws Exception { IPackageFragment pack2= fSourceFolder.getPackageFragment("test2"); ICompilationUnit cu2= pack2.getCompilationUnit("E.java"); assertTrue("CU does not exist", cu2.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -288,7 +288,7 @@ public void testWrongPackageStatement() throws Exception { @Test public void testWrongPackageStatementInEnum() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public enum E {\n"); @@ -310,7 +310,7 @@ public void testWrongPackageStatementInEnum() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) curr; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum E {\n"); @@ -324,7 +324,7 @@ public void testWrongPackageStatementInEnum() throws Exception { IPackageFragment pack2= fSourceFolder.getPackageFragment("test2"); ICompilationUnit cu2= pack2.getCompilationUnit("E.java"); assertTrue("CU does not exist", cu2.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public enum E {\n"); @@ -337,7 +337,7 @@ public void testWrongPackageStatementInEnum() throws Exception { @Test public void testWrongPackageStatementFromDefault() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -359,7 +359,7 @@ public void testWrongPackageStatementFromDefault() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) curr; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -373,7 +373,7 @@ public void testWrongPackageStatementFromDefault() throws Exception { IPackageFragment pack2= fSourceFolder.getPackageFragment("test2"); ICompilationUnit cu2= pack2.getCompilationUnit("E.java"); assertTrue("CU does not exist", cu2.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -386,7 +386,7 @@ public void testWrongPackageStatementFromDefault() throws Exception { @Test public void testWrongDefaultPackageStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("public class E {\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); @@ -406,7 +406,7 @@ public void testWrongDefaultPackageStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) curr; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -420,7 +420,7 @@ public void testWrongDefaultPackageStatement() throws Exception { IPackageFragment pack2= fSourceFolder.getPackageFragment(""); ICompilationUnit cu2= pack2.getCompilationUnit("E.java"); assertTrue("CU does not exist", cu2.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("public class E {\n"); buf.append("}\n"); assertEqualStringIgnoreDelim(cu2.getSource(), buf.toString()); @@ -431,7 +431,7 @@ public void testWrongDefaultPackageStatement() throws Exception { @Test public void testWrongPackageStatementButColliding() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -452,7 +452,7 @@ public void testWrongPackageStatementButColliding() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -463,7 +463,7 @@ public void testWrongPackageStatementButColliding() throws Exception { @Test public void testWrongTypeName() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -485,7 +485,7 @@ public void testWrongTypeName() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) curr; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class X {\n"); @@ -498,7 +498,7 @@ public void testWrongTypeName() throws Exception { ICompilationUnit cu2= pack1.getCompilationUnit("E.java"); assertTrue("CU does not exist", cu2.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -511,7 +511,7 @@ public void testWrongTypeName() throws Exception { @Test public void testWrongTypeName_bug180330() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class \\u0042 {\n"); buf.append("}\n"); @@ -533,7 +533,7 @@ public void testWrongTypeName_bug180330() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) curr; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class C {\n"); buf.append("}\n"); @@ -545,7 +545,7 @@ public void testWrongTypeName_bug180330() throws Exception { ICompilationUnit cu2= pack1.getCompilationUnit("B.java"); assertTrue("CU does not exist", cu2.exists()); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("public class \\u0042 {\n"); buf.append("}\n"); @@ -557,7 +557,7 @@ public void testWrongTypeName_bug180330() throws Exception { @Test public void testWrongTypeNameButColliding() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class X {\n"); @@ -578,7 +578,7 @@ public void testWrongTypeNameButColliding() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -589,7 +589,7 @@ public void testWrongTypeNameButColliding() throws Exception { @Test public void testWrongTypeNameWithConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class X {\n"); @@ -613,7 +613,7 @@ public void testWrongTypeNameWithConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -627,7 +627,7 @@ public void testWrongTypeNameWithConstructor() throws Exception { @Test public void testWrongTypeNameInEnum() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum X {\n"); @@ -651,7 +651,7 @@ public void testWrongTypeNameInEnum() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum E {\n"); @@ -665,7 +665,7 @@ public void testWrongTypeNameInEnum() throws Exception { @Test public void testWrongTypeNameInAnnot() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public @interface X {\n"); @@ -686,7 +686,7 @@ public void testWrongTypeNameInAnnot() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public @interface E {\n"); @@ -697,7 +697,7 @@ public void testWrongTypeNameInAnnot() throws Exception { @Test public void testTodoTasks1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -719,7 +719,7 @@ public void testTodoTasks1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -731,7 +731,7 @@ public void testTodoTasks1() throws Exception { @Test public void testTodoTasks2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -751,7 +751,7 @@ public void testTodoTasks2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -764,7 +764,7 @@ public void testTodoTasks2() throws Exception { @Test public void testTodoTasks3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -784,7 +784,7 @@ public void testTodoTasks3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -796,7 +796,7 @@ public void testTodoTasks3() throws Exception { @Test public void testTodoTasks4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -818,7 +818,7 @@ public void testTodoTasks4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -830,7 +830,7 @@ public void testTodoTasks4() throws Exception { @Test public void testTodoTasks5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -852,7 +852,7 @@ public void testTodoTasks5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -867,7 +867,7 @@ public void testTodoTasks5() throws Exception { @Test public void testTodoTasks6() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -887,7 +887,7 @@ public void testTodoTasks6() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -900,7 +900,7 @@ public void testTodoTasks6() throws Exception { @Test public void testTodoTasks7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -920,7 +920,7 @@ public void testTodoTasks7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -934,7 +934,7 @@ public void testTodoTasks7() throws Exception { @Test public void testAddToClasspathSourceFolder() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import mylib.Foo;\n"); buf.append("public class E {\n"); @@ -946,7 +946,7 @@ public void testAddToClasspathSourceFolder() throws Exception { try { IPackageFragmentRoot otherRoot= JavaProjectHelper.addSourceContainer(otherProject, "src"); IPackageFragment otherPack= otherRoot.createPackageFragment("mylib", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package mylib;\n"); buf.append("public class Foo {\n"); buf.append("}\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReturnTypeQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReturnTypeQuickFixTest.java index b09ab1af91e..17a0add07d8 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReturnTypeQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ReturnTypeQuickFixTest.java @@ -76,7 +76,7 @@ public void tearDown() throws Exception { @Test public void testReturnTypeMissingWithSimpleType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -101,7 +101,7 @@ public void testReturnTypeMissingWithSimpleType() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Enumeration;\n"); buf.append("import java.util.Vector;\n"); @@ -117,7 +117,7 @@ public void testReturnTypeMissingWithSimpleType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) elem; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -134,7 +134,7 @@ public void testReturnTypeMissingWithSimpleType() throws Exception { @Test public void testReturnTypeMissingWithVoid() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public foo() {\n"); @@ -158,7 +158,7 @@ public void testReturnTypeMissingWithVoid() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -172,7 +172,7 @@ public void testReturnTypeMissingWithVoid() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) elem; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -189,7 +189,7 @@ public void testReturnTypeMissingWithVoid() throws Exception { @Test public void testReturnTypeMissing() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public foo();\n"); @@ -204,7 +204,7 @@ public void testReturnTypeMissing() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E {\n"); buf.append(" public void foo();\n"); @@ -219,7 +219,7 @@ public void testReturnTypeMissing() throws Exception { @Test public void testReturnTypeMissingWithVoid2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public foo() {\n"); @@ -246,7 +246,7 @@ public void testReturnTypeMissingWithVoid2() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -263,7 +263,7 @@ public void testReturnTypeMissingWithVoid2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) elem; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -281,7 +281,7 @@ public void testReturnTypeMissingWithVoid2() throws Exception { @Test public void testVoidMissingInAnonymousType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -304,7 +304,7 @@ public void testVoidMissingInAnonymousType() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -323,7 +323,7 @@ public void testVoidMissingInAnonymousType() throws Exception { @Test public void testReturnTypeMissingWithNull() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public foo() {\n"); @@ -347,7 +347,7 @@ public void testReturnTypeMissingWithNull() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Object foo() {\n"); @@ -361,7 +361,7 @@ public void testReturnTypeMissingWithNull() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) elem; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -376,7 +376,7 @@ public void testReturnTypeMissingWithNull() throws Exception { @Test public void testReturnTypeMissingWithArrayType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public foo() {\n"); @@ -400,7 +400,7 @@ public void testReturnTypeMissingWithArrayType() throws Exception { String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int[][] foo() {\n"); @@ -414,7 +414,7 @@ public void testReturnTypeMissingWithArrayType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) elem; String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -429,7 +429,7 @@ public void testReturnTypeMissingWithArrayType() throws Exception { @Test public void testVoidMethodReturnsStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -449,7 +449,7 @@ public void testVoidMethodReturnsStatement() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -464,7 +464,7 @@ public void testVoidMethodReturnsStatement() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -480,7 +480,7 @@ public void testVoidMethodReturnsStatement() throws Exception { @Test public void testVoidMethodReturnsAnonymClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void getOperation() {\n"); @@ -499,7 +499,7 @@ public void testVoidMethodReturnsAnonymClass() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Runnable getOperation() {\n"); @@ -513,7 +513,7 @@ public void testVoidMethodReturnsAnonymClass() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void getOperation() {\n"); @@ -528,7 +528,7 @@ public void testVoidMethodReturnsAnonymClass() throws Exception { @Test public void testReturnTypeMissingWithWildcardSuper() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -546,7 +546,7 @@ public void testReturnTypeMissingWithWildcardSuper() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -559,7 +559,7 @@ public void testReturnTypeMissingWithWildcardSuper() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -575,7 +575,7 @@ public void testReturnTypeMissingWithWildcardSuper() throws Exception { @Test public void testReturnTypeMissingWithWildcardExtends() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -594,7 +594,7 @@ public void testReturnTypeMissingWithWildcardExtends() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -608,7 +608,7 @@ public void testReturnTypeMissingWithWildcardExtends() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -625,7 +625,7 @@ public void testReturnTypeMissingWithWildcardExtends() throws Exception { @Test public void testConstructorReturnsValue() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -643,7 +643,7 @@ public void testConstructorReturnsValue() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Properties;\n"); @@ -659,7 +659,7 @@ public void testConstructorReturnsValue() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -673,7 +673,7 @@ public void testConstructorReturnsValue() throws Exception { @Test public void testVoidMethodReturnsWildcardSuper() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -691,7 +691,7 @@ public void testVoidMethodReturnsWildcardSuper() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -704,7 +704,7 @@ public void testVoidMethodReturnsWildcardSuper() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -720,7 +720,7 @@ public void testVoidMethodReturnsWildcardSuper() throws Exception { @Test public void testVoidMethodReturnsWildcardExtends() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -738,7 +738,7 @@ public void testVoidMethodReturnsWildcardExtends() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -751,7 +751,7 @@ public void testVoidMethodReturnsWildcardExtends() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -768,7 +768,7 @@ public void testVoidMethodReturnsWildcardExtends() throws Exception { @Test public void testCorrectReturnStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Runnable getOperation() {\n"); @@ -785,7 +785,7 @@ public void testCorrectReturnStatement() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Runnable getOperation() {\n"); @@ -797,7 +797,7 @@ public void testCorrectReturnStatement() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void getOperation() {\n"); @@ -925,7 +925,7 @@ public void testCorrectReturnStatementInChainedConditional() throws Exception { @Test public void testReturnVoid() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -947,7 +947,7 @@ public void testReturnVoid() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -968,7 +968,7 @@ public void testReturnVoid() throws Exception { @Test public void testCorrectReturnStatementForArray() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int[][] getArray() {\n"); @@ -985,7 +985,7 @@ public void testCorrectReturnStatementForArray() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int[][] getArray() {\n"); @@ -997,7 +997,7 @@ public void testCorrectReturnStatementForArray() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void getArray() {\n"); @@ -1012,7 +1012,7 @@ public void testCorrectReturnStatementForArray() throws Exception { @Test public void testMethodWithConstructorName() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int[][] E() {\n"); @@ -1029,7 +1029,7 @@ public void testMethodWithConstructorName() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -1042,7 +1042,7 @@ public void testMethodWithConstructorName() throws Exception { @Test public void testMissingReturnStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int[][] getArray() {\n"); @@ -1058,7 +1058,7 @@ public void testMissingReturnStatement() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public int[][] getArray() {\n"); @@ -1070,7 +1070,7 @@ public void testMissingReturnStatement() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void getArray() {\n"); @@ -1084,7 +1084,7 @@ public void testMissingReturnStatement() throws Exception { @Test public void testMissingReturnStatementWithCode() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fArray;\n"); @@ -1103,7 +1103,7 @@ public void testMissingReturnStatementWithCode() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fArray;\n"); @@ -1118,7 +1118,7 @@ public void testMissingReturnStatementWithCode() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] fArray;\n"); @@ -1135,7 +1135,7 @@ public void testMissingReturnStatementWithCode() throws Exception { @Test public void testMissingReturnStatementWithCode2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean isVisible() {\n"); @@ -1155,7 +1155,7 @@ public void testMissingReturnStatementWithCode2() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public boolean isVisible() {\n"); @@ -1171,7 +1171,7 @@ public void testMissingReturnStatementWithCode2() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void isVisible() {\n"); @@ -1189,7 +1189,7 @@ public void testMissingReturnStatementWithCode2() throws Exception { @Test public void testMissingReturnStatementWithCode3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String getDebugInfo() {\n"); @@ -1206,7 +1206,7 @@ public void testMissingReturnStatementWithCode3() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String getDebugInfo() {\n"); @@ -1222,7 +1222,7 @@ public void testMissingReturnStatementWithCode3() throws Exception { @Test public void testMissingReturnStatementWithCode4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String getDebugInfo() {\n"); @@ -1239,7 +1239,7 @@ public void testMissingReturnStatementWithCode4() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public String getDebugInfo() {\n"); @@ -1256,7 +1256,7 @@ public void testMissingReturnStatementWithCode4() throws Exception { @Test public void testMethodInEnum_bug239887() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("enum Bug {X;\n"); buf.append(" wrap(){}\n"); @@ -1270,14 +1270,14 @@ public void testMethodInEnum_bug239887() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("enum Bug {X;\n"); buf.append(" void wrap(){}\n"); buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("enum Bug {X;\n"); buf.append(" Bug(){}\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SerialVersionQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SerialVersionQuickFixTest.java index 80ae65114ef..576c007e79a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SerialVersionQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SerialVersionQuickFixTest.java @@ -110,7 +110,7 @@ public void tearDown() throws Exception { @Test public void testLocalClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test3", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test5 {\n"); @@ -134,7 +134,7 @@ public void testLocalClass() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test5 {\n"); @@ -154,7 +154,7 @@ public void testLocalClass() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test5 {\n"); @@ -181,7 +181,7 @@ public void testLocalClass() throws Exception { @Test public void testAnonymousClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test3", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test3 {\n"); @@ -201,7 +201,7 @@ public void testAnonymousClass() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test3 {\n"); @@ -217,7 +217,7 @@ public void testAnonymousClass() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test3 {\n"); @@ -239,7 +239,7 @@ public void testAnonymousClass() throws Exception { @Test public void testInnerClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -259,7 +259,7 @@ public void testInnerClass() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -275,7 +275,7 @@ public void testInnerClass() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -298,7 +298,7 @@ public void testInnerClass() throws Exception { @Test public void testOuterClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test1 implements Serializable {\n"); @@ -313,7 +313,7 @@ public void testOuterClass() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test1 implements Serializable {\n"); @@ -324,7 +324,7 @@ public void testOuterClass() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test1 implements Serializable {\n"); @@ -341,7 +341,7 @@ public void testOuterClass() throws Exception { @Test public void testOuterClass2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test3", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.util.EventObject;\n"); buf.append("public class Test4 extends EventObject {\n"); @@ -367,7 +367,7 @@ public void testOuterClass2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.util.EventObject;\n"); buf.append("public class Test4 extends EventObject {\n"); @@ -389,7 +389,7 @@ public void testOuterClass2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("import java.util.EventObject;\n"); buf.append("public class Test4 extends EventObject {\n"); @@ -419,7 +419,7 @@ public void testOuterClass3() throws Exception { // longer package IPackageFragment pack1= fSourceFolder.createPackageFragment("a.b.c", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package a.b.c;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test1 implements Serializable {\n"); @@ -434,7 +434,7 @@ public void testOuterClass3() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a.b.c;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test1 implements Serializable {\n"); @@ -445,7 +445,7 @@ public void testOuterClass3() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package a.b.c;\n"); buf.append("import java.io.Serializable;\n"); buf.append("public class Test1 implements Serializable {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SurroundWithTemplateTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SurroundWithTemplateTest.java index 8c7ba739553..6189c195ccc 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SurroundWithTemplateTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/SurroundWithTemplateTest.java @@ -1468,7 +1468,7 @@ public void testSurroundWithRunnable30() throws Exception { public void testSurroundWithRunnableBug133560() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1488,7 +1488,7 @@ public void testSurroundWithRunnableBug133560() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1508,7 +1508,7 @@ public void testSurroundWithRunnableBug133560() throws Exception { public void testSurroundWithRunnableBug233278() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" {\n"); @@ -1535,7 +1535,7 @@ public void testSurroundWithRunnableBug233278() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" {\n"); @@ -1560,7 +1560,7 @@ public void testSurroundWithRunnableBug233278() throws Exception { public void testSurroundWithRunnableBug138323() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1578,7 +1578,7 @@ public void testSurroundWithRunnableBug138323() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1596,7 +1596,7 @@ public void testSurroundWithRunnableBug138323() throws Exception { public void testSurroundWithBug162549() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void m() {\n"); @@ -1622,7 +1622,7 @@ public void testSurroundWithBug162549() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void m() {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeMismatchQuickFixTests.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeMismatchQuickFixTests.java index b00b38afb81..cb021c00feb 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeMismatchQuickFixTests.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeMismatchQuickFixTests.java @@ -101,7 +101,7 @@ public void tearDown() throws Exception { @Test public void testTypeMismatchInVarDecl() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -118,7 +118,7 @@ public void testTypeMismatchInVarDecl() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -130,7 +130,7 @@ public void testTypeMismatchInVarDecl() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -142,7 +142,7 @@ public void testTypeMismatchInVarDecl() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Thread o) {\n"); @@ -157,7 +157,7 @@ public void testTypeMismatchInVarDecl() throws Exception { @Test public void testTypeMismatchInVarDecl2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class Container {\n"); @@ -167,7 +167,7 @@ public void testTypeMismatchInVarDecl2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -185,7 +185,7 @@ public void testTypeMismatchInVarDecl2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -198,7 +198,7 @@ public void testTypeMismatchInVarDecl2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -212,7 +212,7 @@ public void testTypeMismatchInVarDecl2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -230,7 +230,7 @@ public void testTypeMismatchInVarDecl2() throws Exception { @Test public void testTypeMismatchInVarDecl3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -246,7 +246,7 @@ public void testTypeMismatchInVarDecl3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Thread foo() {\n"); @@ -261,7 +261,7 @@ public void testTypeMismatchInVarDecl3() throws Exception { @Test public void testTypeMismatchInVarDecl4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class Container {\n"); @@ -271,7 +271,7 @@ public void testTypeMismatchInVarDecl4() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E extends Container {\n"); @@ -289,7 +289,7 @@ public void testTypeMismatchInVarDecl4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E extends Container {\n"); @@ -302,7 +302,7 @@ public void testTypeMismatchInVarDecl4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -316,7 +316,7 @@ public void testTypeMismatchInVarDecl4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -336,14 +336,14 @@ public void testTypeMismatchInVarDecl4() throws Exception { public void testTypeMismatchForInterface1() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("test0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("public interface PrimaryContainer {\n"); buf.append("}\n"); pack0.createCompilationUnit("PrimaryContainer.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Container {\n"); buf.append(" public static Container getContainer() {\n"); @@ -352,7 +352,7 @@ public void testTypeMismatchForInterface1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -370,7 +370,7 @@ public void testTypeMismatchForInterface1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -383,7 +383,7 @@ public void testTypeMismatchForInterface1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -396,7 +396,7 @@ public void testTypeMismatchForInterface1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -411,7 +411,7 @@ public void testTypeMismatchForInterface1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -430,7 +430,7 @@ public void testTypeMismatchForInterface1() throws Exception { @Test public void testTypeMismatchForInterface2() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("test0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("public interface PrimaryContainer {\n"); buf.append(" PrimaryContainer duplicate(PrimaryContainer container);\n"); @@ -439,7 +439,7 @@ public void testTypeMismatchForInterface2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Container {\n"); buf.append(" public static Container getContainer() {\n"); @@ -448,7 +448,7 @@ public void testTypeMismatchForInterface2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -466,7 +466,7 @@ public void testTypeMismatchForInterface2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -479,7 +479,7 @@ public void testTypeMismatchForInterface2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -494,7 +494,7 @@ public void testTypeMismatchForInterface2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -509,7 +509,7 @@ public void testTypeMismatchForInterface2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("\n"); buf.append("import test1.Container;\n"); @@ -522,7 +522,7 @@ public void testTypeMismatchForInterface2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(4); String preview5= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("\n"); buf.append("import test1.Container;\n"); @@ -541,14 +541,14 @@ public void testTypeMismatchForInterface2() throws Exception { public void testTypeMismatchForInterfaceInGeneric() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("test0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("public interface PrimaryContainer {\n"); buf.append("}\n"); pack0.createCompilationUnit("PrimaryContainer.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Container {\n"); buf.append(" public Container getContainer() {\n"); @@ -557,7 +557,7 @@ public void testTypeMismatchForInterfaceInGeneric() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -575,7 +575,7 @@ public void testTypeMismatchForInterfaceInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -588,7 +588,7 @@ public void testTypeMismatchForInterfaceInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.PrimaryContainer;\n"); buf.append("public class E {\n"); @@ -601,7 +601,7 @@ public void testTypeMismatchForInterfaceInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -616,7 +616,7 @@ public void testTypeMismatchForInterfaceInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -636,14 +636,14 @@ public void testTypeMismatchForInterfaceInGeneric() throws Exception { public void testTypeMismatchForInterfaceInGeneric2() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("test0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("public interface PrimaryContainer {\n"); buf.append("}\n"); pack0.createCompilationUnit("PrimaryContainer.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Container {\n"); buf.append(" public Container getContainer() {\n"); @@ -652,7 +652,7 @@ public void testTypeMismatchForInterfaceInGeneric2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Container.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -671,7 +671,7 @@ public void testTypeMismatchForInterfaceInGeneric2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -685,7 +685,7 @@ public void testTypeMismatchForInterfaceInGeneric2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -699,7 +699,7 @@ public void testTypeMismatchForInterfaceInGeneric2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test0.PrimaryContainer;\n"); @@ -725,7 +725,7 @@ public void testTypeMismatchForParameterizedType() throws Exception { fJProject1.setOptions(tempOptions); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -742,7 +742,7 @@ public void testTypeMismatchForParameterizedType() throws Exception { String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -752,7 +752,7 @@ public void testTypeMismatchForParameterizedType() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -774,7 +774,7 @@ public void testTypeMismatchForParameterizedType() throws Exception { @Test public void testTypeMismatchForParameterizedType2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -791,7 +791,7 @@ public void testTypeMismatchForParameterizedType2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.*;\n"); buf.append("public class E {\n"); @@ -827,7 +827,7 @@ public void testTypeMismatchForParameterizedType2() throws Exception { @Test public void testTypeMismatchInFieldDecl() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int time= System.currentTimeMillis();\n"); @@ -842,7 +842,7 @@ public void testTypeMismatchInFieldDecl() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int time= (int) System.currentTimeMillis();\n"); @@ -852,7 +852,7 @@ public void testTypeMismatchInFieldDecl() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" long time= System.currentTimeMillis();\n"); @@ -865,7 +865,7 @@ public void testTypeMismatchInFieldDecl() throws Exception { @Test public void testTypeMismatchInFieldDeclNoImport() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private class StringBuffer { }\n"); @@ -884,7 +884,7 @@ public void testTypeMismatchInFieldDeclNoImport() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private class StringBuffer { }\n"); @@ -901,7 +901,7 @@ public void testTypeMismatchInFieldDeclNoImport() throws Exception { @Test public void testTypeMismatchInAssignment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -920,7 +920,7 @@ public void testTypeMismatchInAssignment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -934,7 +934,7 @@ public void testTypeMismatchInAssignment() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -952,7 +952,7 @@ public void testTypeMismatchInAssignment() throws Exception { @Test public void testTypeMismatchInAssignment2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -971,7 +971,7 @@ public void testTypeMismatchInAssignment2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -985,7 +985,7 @@ public void testTypeMismatchInAssignment2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public class E {\n"); @@ -1004,7 +1004,7 @@ public void testTypeMismatchInAssignment2() throws Exception { @Test public void testTypeMismatchInAssignment3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public enum E {\n"); @@ -1024,7 +1024,7 @@ public void testTypeMismatchInAssignment3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public enum E {\n"); @@ -1039,7 +1039,7 @@ public void testTypeMismatchInAssignment3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("public enum E {\n"); @@ -1059,7 +1059,7 @@ public void testTypeMismatchInAssignment3() throws Exception { public void testTypeMismatchInAssignment4() throws Exception { // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=540927 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import java.util.Map.Entry;\n"); @@ -1081,7 +1081,7 @@ public void testTypeMismatchInAssignment4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("import java.util.Map.Entry;\n"); @@ -1101,7 +1101,7 @@ public void testTypeMismatchInAssignment4() throws Exception { public void testTypeMismatchInExpression() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("test0", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("public class Other {\n"); buf.append(" public Object[] toArray() {\n"); @@ -1112,7 +1112,7 @@ public void testTypeMismatchInExpression() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.Other;\n"); buf.append("public class E {\n"); @@ -1130,7 +1130,7 @@ public void testTypeMismatchInExpression() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.Other;\n"); buf.append("public class E {\n"); @@ -1143,7 +1143,7 @@ public void testTypeMismatchInExpression() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test0.Other;\n"); buf.append("public class E {\n"); @@ -1156,7 +1156,7 @@ public void testTypeMismatchInExpression() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test0;\n"); buf.append("public class Other {\n"); buf.append(" public String[] toArray() {\n"); @@ -1171,7 +1171,7 @@ public void testTypeMismatchInExpression() throws Exception { @Test public void testCastOnCastExpression() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1190,7 +1190,7 @@ public void testCastOnCastExpression() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1204,7 +1204,7 @@ public void testCastOnCastExpression() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("import java.util.List;\n"); @@ -1222,7 +1222,7 @@ public void testCastOnCastExpression() throws Exception { @Test public void testMismatchingReturnType1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public String getName() {\n"); @@ -1231,7 +1231,7 @@ public void testMismatchingReturnType1() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public char[] getName() {\n"); @@ -1248,7 +1248,7 @@ public void testMismatchingReturnType1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public String getName() {\n"); @@ -1260,7 +1260,7 @@ public void testMismatchingReturnType1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public char[] getName() {\n"); @@ -1275,7 +1275,7 @@ public void testMismatchingReturnType1() throws Exception { @Test public void testMismatchingReturnType2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public interface IBase {\n"); @@ -1283,7 +1283,7 @@ public void testMismatchingReturnType2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("IBase.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements IBase {\n"); buf.append(" public String[] getCollection() {\n"); @@ -1300,7 +1300,7 @@ public void testMismatchingReturnType2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -1315,7 +1315,7 @@ public void testMismatchingReturnType2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public interface IBase {\n"); @@ -1329,7 +1329,7 @@ public void testMismatchingReturnType2() throws Exception { @Test public void testMismatchingReturnTypeOnGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public String getName(T... t) {\n"); @@ -1338,7 +1338,7 @@ public void testMismatchingReturnTypeOnGeneric() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public char[] getName(Integer... i) {\n"); @@ -1355,7 +1355,7 @@ public void testMismatchingReturnTypeOnGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public String getName(Integer... i) {\n"); @@ -1367,7 +1367,7 @@ public void testMismatchingReturnTypeOnGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public char[] getName(T... t) {\n"); @@ -1382,7 +1382,7 @@ public void testMismatchingReturnTypeOnGeneric() throws Exception { @Test public void testMismatchingReturnTypeOnGeneric2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public Number getVal() {\n"); @@ -1391,7 +1391,7 @@ public void testMismatchingReturnTypeOnGeneric2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public T getVal() {\n"); @@ -1408,7 +1408,7 @@ public void testMismatchingReturnTypeOnGeneric2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public Number getVal() {\n"); @@ -1424,7 +1424,7 @@ public void testMismatchingReturnTypeOnGeneric2() throws Exception { public void testMismatchingReturnTypeOnGenericMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.Annotation;\n"); buf.append("import java.lang.reflect.AccessibleObject;\n"); @@ -1446,7 +1446,7 @@ public void testMismatchingReturnTypeOnGenericMethod() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.Annotation;\n"); buf.append("import java.lang.reflect.AccessibleObject;\n"); @@ -1472,7 +1472,7 @@ public void testMismatchingReturnTypeOnGenericMethod14() throws Exception { fJProject1.setOptions(options14); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.reflect.AccessibleObject;\n"); buf.append("public class E {\n"); @@ -1493,7 +1493,7 @@ public void testMismatchingReturnTypeOnGenericMethod14() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.lang.annotation.Annotation;\n"); buf.append("import java.lang.reflect.AccessibleObject;\n"); @@ -1517,7 +1517,7 @@ public void testMismatchingReturnTypeOnGenericMethod14() throws Exception { public void testMismatchingReturnTypeParameterized() throws Exception { // test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=165913 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public Number getVal() {\n"); @@ -1526,7 +1526,7 @@ public void testMismatchingReturnTypeParameterized() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public E getVal() {\n"); @@ -1543,7 +1543,7 @@ public void testMismatchingReturnTypeParameterized() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends Base {\n"); buf.append(" public Number getVal() {\n"); @@ -1558,7 +1558,7 @@ public void testMismatchingReturnTypeParameterized() throws Exception { @Test public void testMismatchingReturnTypeOnWildcardExtends() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -1576,7 +1576,7 @@ public void testMismatchingReturnTypeOnWildcardExtends() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -1589,7 +1589,7 @@ public void testMismatchingReturnTypeOnWildcardExtends() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -1605,7 +1605,7 @@ public void testMismatchingReturnTypeOnWildcardExtends() throws Exception { @Test public void testMismatchingReturnTypeOnWildcardSuper() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -1623,7 +1623,7 @@ public void testMismatchingReturnTypeOnWildcardSuper() throws Exception { ASTRewriteCorrectionProposal proposal= (ASTRewriteCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -1636,7 +1636,7 @@ public void testMismatchingReturnTypeOnWildcardSuper() throws Exception { proposal= (ASTRewriteCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -1652,14 +1652,14 @@ public void testMismatchingReturnTypeOnWildcardSuper() throws Exception { @Test public void testMismatchingExceptions1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface IBase {\n"); buf.append(" String[] getValues();\n"); buf.append("}\n"); pack1.createCompilationUnit("IBase.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E implements IBase {\n"); @@ -1677,7 +1677,7 @@ public void testMismatchingExceptions1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -1690,7 +1690,7 @@ public void testMismatchingExceptions1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E implements IBase {\n"); @@ -1706,7 +1706,7 @@ public void testMismatchingExceptions1() throws Exception { @Test public void testMismatchingExceptions2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class Base {\n"); @@ -1716,7 +1716,7 @@ public void testMismatchingExceptions2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.EOFException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1735,7 +1735,7 @@ public void testMismatchingExceptions2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1749,7 +1749,7 @@ public void testMismatchingExceptions2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.EOFException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1766,7 +1766,7 @@ public void testMismatchingExceptions2() throws Exception { @Test public void testMismatchingExceptions3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class Base {\n"); @@ -1783,7 +1783,7 @@ public void testMismatchingExceptions3() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.EOFException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1809,7 +1809,7 @@ public void testMismatchingExceptions3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1831,7 +1831,7 @@ public void testMismatchingExceptions3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.EOFException;\n"); buf.append("import java.text.ParseException;\n"); @@ -1854,14 +1854,14 @@ public void testMismatchingExceptions3() throws Exception { @Test public void testMismatchingExceptionsOnGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface IBase {\n"); buf.append(" T[] getValues();\n"); buf.append("}\n"); pack1.createCompilationUnit("IBase.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E implements IBase {\n"); @@ -1879,7 +1879,7 @@ public void testMismatchingExceptionsOnGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -1892,7 +1892,7 @@ public void testMismatchingExceptionsOnGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.IOException;\n"); buf.append("public class E implements IBase {\n"); @@ -1908,7 +1908,7 @@ public void testMismatchingExceptionsOnGeneric() throws Exception { @Test public void testMismatchingExceptionsOnBinaryParent() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements Runnable {\n"); buf.append(" public void run() throws ClassNotFoundException {\n"); @@ -1924,7 +1924,7 @@ public void testMismatchingExceptionsOnBinaryParent() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E implements Runnable {\n"); buf.append(" public void run() {\n"); @@ -1938,7 +1938,7 @@ public void testMismatchingExceptionsOnBinaryParent() throws Exception { @Test public void testTypeMismatchInAnnotationValues1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1957,7 +1957,7 @@ public void testTypeMismatchInAnnotationValues1() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1975,7 +1975,7 @@ public void testTypeMismatchInAnnotationValues1() throws Exception { @Test public void testTypeMismatchInAnnotationValues2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class Other {\n"); buf.append(" public @interface Annot {\n"); @@ -1984,7 +1984,7 @@ public void testTypeMismatchInAnnotationValues2() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Other.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" @Other.Annot(newAttrib= 1)\n"); @@ -2000,7 +2000,7 @@ public void testTypeMismatchInAnnotationValues2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class Other {\n"); buf.append(" public @interface Annot {\n"); @@ -2015,7 +2015,7 @@ public void testTypeMismatchInAnnotationValues2() throws Exception { @Test public void testTypeMismatchInSingleMemberAnnotation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -2034,7 +2034,7 @@ public void testTypeMismatchInSingleMemberAnnotation() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -2052,7 +2052,7 @@ public void testTypeMismatchInSingleMemberAnnotation() throws Exception { @Test public void testTypeMismatchWithEnumConstant() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public enum E {\n"); buf.append(" ONE;\n"); @@ -2069,7 +2069,7 @@ public void testTypeMismatchWithEnumConstant() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public enum E {\n"); buf.append(" ONE;\n"); @@ -2087,7 +2087,7 @@ public void testTypeMismatchWithEnumConstant() throws Exception { public void testTypeMismatchWithArrayLength() throws Exception { // test for bug 126488 IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class TestShort {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -2103,7 +2103,7 @@ public void testTypeMismatchWithArrayLength() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class TestShort {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -2112,7 +2112,7 @@ public void testTypeMismatchWithArrayLength() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class TestShort {\n"); buf.append(" public static void main(String[] args) {\n"); @@ -2128,18 +2128,18 @@ public void testTypeMismatchWithArrayLength() throws Exception { public void testTypeMismatchWithTypeInSamePackage() throws Exception { // test for bug 198586 IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {}\n"); pack2.createCompilationUnit("E.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {}\n"); pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Test {\n"); buf.append(" test2.E e2= new Object();\n"); @@ -2154,7 +2154,7 @@ public void testTypeMismatchWithTypeInSamePackage() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Test {\n"); buf.append(" test2.E e2= (test2.E) new Object();\n"); @@ -2162,7 +2162,7 @@ public void testTypeMismatchWithTypeInSamePackage() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Test {\n"); buf.append(" Object e2= new Object();\n"); @@ -2176,7 +2176,7 @@ public void testTypeMismatchWithTypeInSamePackage() throws Exception { @Test public void testTypeMismatchInForEachProposalsList() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2197,7 +2197,7 @@ public void testTypeMismatchInForEachProposalsList() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2217,7 +2217,7 @@ public void testTypeMismatchInForEachProposalsList() throws Exception { @Test public void testTypeMismatchInForEachProposalsListExtends() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2238,7 +2238,7 @@ public void testTypeMismatchInForEachProposalsListExtends() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2258,7 +2258,7 @@ public void testTypeMismatchInForEachProposalsListExtends() throws Exception { @Test public void testTypeMismatchInForEachProposalsListSuper() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2279,7 +2279,7 @@ public void testTypeMismatchInForEachProposalsListSuper() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2299,7 +2299,7 @@ public void testTypeMismatchInForEachProposalsListSuper() throws Exception { @Test public void testTypeMismatchInForEachProposalsArrays() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2320,7 +2320,7 @@ public void testTypeMismatchInForEachProposalsArrays() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.List;\n"); @@ -2340,7 +2340,7 @@ public void testTypeMismatchInForEachProposalsArrays() throws Exception { @Test public void testTypeMismatchInForEachMissingType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2358,7 +2358,7 @@ public void testTypeMismatchInForEachMissingType() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2375,7 +2375,7 @@ public void testTypeMismatchInForEachMissingType() throws Exception { @Test public void testNullCheck() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2394,7 +2394,7 @@ public void testNullCheck() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2406,7 +2406,7 @@ public void testNullCheck() throws Exception { buf.append("\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2425,7 +2425,7 @@ public void testNullCheck() throws Exception { @Test public void testTypeMismatchObjectAndPrimitiveType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2447,7 +2447,7 @@ public void testTypeMismatchObjectAndPrimitiveType() throws Exception { assertNotEquals(-1, proposal.getDisplayString().indexOf("Integer")); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2459,7 +2459,7 @@ public void testTypeMismatchObjectAndPrimitiveType() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2471,7 +2471,7 @@ public void testTypeMismatchObjectAndPrimitiveType() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2489,7 +2489,7 @@ public void testTypeMismatchObjectAndPrimitiveType() throws Exception { @Test public void testTypeMismatchPrimitiveTypes() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2516,7 +2516,7 @@ public void testTypeMismatchPrimitiveTypes() throws Exception { assertEquals(-1, proposal3.getDisplayString().indexOf("Integer")); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2527,7 +2527,7 @@ public void testTypeMismatchPrimitiveTypes() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); @@ -2538,7 +2538,7 @@ public void testTypeMismatchPrimitiveTypes() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeParameterMismatchTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeParameterMismatchTest.java index 0d83022dbdb..5a21b127652 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeParameterMismatchTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/TypeParameterMismatchTest.java @@ -83,7 +83,7 @@ public void tearDown() throws Exception { @Test public void testRemoveTypeParameter() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("import java.util.*;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -98,7 +98,7 @@ public void testRemoveTypeParameter() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("import java.util.*;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -112,7 +112,7 @@ public void testRemoveTypeParameter() throws Exception { @Test public void testRemoveTypeParameter2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("import java.util.*;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -127,7 +127,7 @@ public void testRemoveTypeParameter2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("import java.util.*;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -141,7 +141,7 @@ public void testRemoveTypeParameter2() throws Exception { @Test public void testInferDiamondArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("import java.util.*;\n"); buf.append("public class A {\n"); buf.append(" void foo() {\n"); @@ -157,7 +157,7 @@ public void testInferDiamondArguments() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("import java.util.*;\n"); buf.append("public class A {\n"); buf.append(" void foo() {\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java index 0d70066545a..3ba63029061 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest.java @@ -85,7 +85,7 @@ public void tearDown() throws Exception { @Test public void testMethodInSameType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -103,7 +103,7 @@ public void testMethodInSameType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -121,7 +121,7 @@ public void testMethodInSameType() throws Exception { @Test public void testMethodInForInit() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -139,7 +139,7 @@ public void testMethodInForInit() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -157,7 +157,7 @@ public void testMethodInForInit() throws Exception { @Test public void testMethodInInfixExpression1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private boolean foo() {\n"); @@ -174,7 +174,7 @@ public void testMethodInInfixExpression1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private boolean foo() {\n"); @@ -191,7 +191,7 @@ public void testMethodInInfixExpression1() throws Exception { @Test public void testMethodInInfixExpression2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private boolean foo() {\n"); @@ -208,7 +208,7 @@ public void testMethodInInfixExpression2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private boolean foo() {\n"); @@ -225,7 +225,7 @@ public void testMethodInInfixExpression2() throws Exception { @Test public void testMethodSpacing0EmptyLines() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -246,7 +246,7 @@ public void testMethodSpacing0EmptyLines() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -266,7 +266,7 @@ public void testMethodSpacing0EmptyLines() throws Exception { @Test public void testMethodSpacing1EmptyLine() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -288,7 +288,7 @@ public void testMethodSpacing1EmptyLine() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -310,7 +310,7 @@ public void testMethodSpacing1EmptyLine() throws Exception { @Test public void testMethodSpacing2EmptyLines() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -333,7 +333,7 @@ public void testMethodSpacing2EmptyLines() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -357,7 +357,7 @@ public void testMethodSpacing2EmptyLines() throws Exception { @Test public void testMethodSpacingComment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -381,7 +381,7 @@ public void testMethodSpacingComment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -405,7 +405,7 @@ public void testMethodSpacingComment() throws Exception { @Test public void testMethodSpacingJavadoc() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -430,7 +430,7 @@ public void testMethodSpacingJavadoc() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -455,7 +455,7 @@ public void testMethodSpacingJavadoc() throws Exception { @Test public void testMethodSpacingNonJavadoc() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -480,7 +480,7 @@ public void testMethodSpacingNonJavadoc() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -505,7 +505,7 @@ public void testMethodSpacingNonJavadoc() throws Exception { @Test public void testMethodInSameTypeUsingThis() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -523,7 +523,7 @@ public void testMethodInSameTypeUsingThis() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -541,7 +541,7 @@ public void testMethodInSameTypeUsingThis() throws Exception { @Test public void testMethodInDifferentClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(X x) {\n"); @@ -552,13 +552,13 @@ public void testMethodInDifferentClass() throws Exception { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Y {\n"); buf.append(" public boolean goo(int i, double d);\n"); @@ -573,7 +573,7 @@ public void testMethodInDifferentClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append("\n"); @@ -586,7 +586,7 @@ public void testMethodInDifferentClass() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(X x) {\n"); @@ -604,7 +604,7 @@ public void testMethodInDifferentClass() throws Exception { @Test public void testParameterWithTypeVariable() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Bork {\n"); buf.append(" private Help help = new Help();\n"); @@ -625,7 +625,7 @@ public void testParameterWithTypeVariable() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal)proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Bork {\n"); buf.append(" private Help help = new Help();\n"); @@ -646,7 +646,7 @@ public void testParameterWithTypeVariable() throws Exception { @Test public void testParameterAnonymous() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -665,7 +665,7 @@ public void testParameterAnonymous() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -686,20 +686,20 @@ public void testParameterAnonymous() throws Exception { public void testMethodInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Y {\n"); buf.append(" public boolean goo(X a);\n"); buf.append("}\n"); pack1.createCompilationUnit("Y.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Y y;\n"); @@ -717,7 +717,7 @@ public void testMethodInGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append("\n"); @@ -730,7 +730,7 @@ public void testMethodInGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Y y;\n"); @@ -746,7 +746,7 @@ public void testMethodInGenericType() throws Exception { @Test public void testMethodAssignedToWildcard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -760,7 +760,7 @@ public void testMethodAssignedToWildcard() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -780,7 +780,7 @@ public void testMethodAssignedToWildcard() throws Exception { @Test public void testMethodAssignedToWildcard2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -794,7 +794,7 @@ public void testMethodAssignedToWildcard2() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -814,7 +814,7 @@ public void testMethodAssignedToWildcard2() throws Exception { @Test public void testMethodAssignedFromWildcard1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -828,7 +828,7 @@ public void testMethodAssignedFromWildcard1() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -848,7 +848,7 @@ public void testMethodAssignedFromWildcard1() throws Exception { @Test public void testMethodAssignedFromWildcard2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -865,7 +865,7 @@ public void testMethodAssignedFromWildcard2() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -881,7 +881,7 @@ public void testMethodAssignedFromWildcard2() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -900,7 +900,7 @@ public void testMethodAssignedFromWildcard2() throws Exception { @Test public void testMethodInvokedOnWildcard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public abstract class E> {\n"); @@ -915,7 +915,7 @@ public void testMethodInvokedOnWildcard() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public abstract class E> {\n"); @@ -928,7 +928,7 @@ public void testMethodInvokedOnWildcard() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public abstract class E> {\n"); @@ -944,7 +944,7 @@ public void testMethodInvokedOnWildcard() throws Exception { @Test public void testMethodInvokedOnBoundedTypeVariable() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public abstract class E> {\n"); @@ -958,7 +958,7 @@ public void testMethodInvokedOnBoundedTypeVariable() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public abstract class E> {\n"); @@ -971,7 +971,7 @@ public void testMethodInvokedOnBoundedTypeVariable() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public abstract class E> {\n"); @@ -987,7 +987,7 @@ public void testMethodInvokedOnBoundedTypeVariable() throws Exception { public void testMethodInGenericTypeSameCU() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class X {\n"); @@ -1006,7 +1006,7 @@ public void testMethodInGenericTypeSameCU() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class X {\n"); @@ -1024,7 +1024,7 @@ public void testMethodInGenericTypeSameCU() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public class X {\n"); @@ -1044,20 +1044,20 @@ public void testMethodInGenericTypeSameCU() throws Exception { public void testMethodInRawType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface Y {\n"); buf.append(" public boolean goo(X a);\n"); buf.append("}\n"); pack1.createCompilationUnit("Y.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Y y;\n"); @@ -1075,7 +1075,7 @@ public void testMethodInRawType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append("\n"); @@ -1088,7 +1088,7 @@ public void testMethodInRawType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public Y y;\n"); @@ -1106,9 +1106,9 @@ public void testMethodInRawType() throws Exception { @Test public void testMethodInAnonymous1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1129,7 +1129,7 @@ public void testMethodInAnonymous1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1148,7 +1148,7 @@ public void testMethodInAnonymous1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1167,7 +1167,7 @@ public void testMethodInAnonymous1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1188,8 +1188,8 @@ public void testMethodInAnonymous1() throws Exception { public void testMethodInAnonymous2() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("other", false, null); - StringBuffer buf= new StringBuffer(); - buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); + buf= new StringBuilder(); buf.append("package other;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -1197,7 +1197,7 @@ public void testMethodInAnonymous2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import other.A;\n"); buf.append("public class E {\n"); @@ -1219,7 +1219,7 @@ public void testMethodInAnonymous2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package other;\n"); buf.append("public class A {\n"); buf.append("\n"); @@ -1234,9 +1234,9 @@ public void testMethodInAnonymous2() throws Exception { @Test public void testMethodInAnonymous3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo() {\n"); @@ -1257,7 +1257,7 @@ public void testMethodInAnonymous3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo() {\n"); @@ -1276,7 +1276,7 @@ public void testMethodInAnonymous3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo() {\n"); @@ -1295,7 +1295,7 @@ public void testMethodInAnonymous3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo() {\n"); @@ -1316,9 +1316,9 @@ public void testMethodInAnonymous3() throws Exception { public void testMethodInAnonymous4() throws Exception { // bug 266032 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo(final E e) {\n"); @@ -1339,7 +1339,7 @@ public void testMethodInAnonymous4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo(final E e) {\n"); @@ -1358,7 +1358,7 @@ public void testMethodInAnonymous4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void foo(final E e) {\n"); @@ -1377,9 +1377,9 @@ public void testMethodInAnonymous4() throws Exception { @Test public void testMethodInAnonymousGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1400,7 +1400,7 @@ public void testMethodInAnonymousGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1419,7 +1419,7 @@ public void testMethodInAnonymousGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1438,7 +1438,7 @@ public void testMethodInAnonymousGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -1460,7 +1460,7 @@ public void testMethodInAnonymousGenericType() throws Exception { public void testMethodInAnonymousCovering1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1483,7 +1483,7 @@ public void testMethodInAnonymousCovering1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1501,7 +1501,7 @@ public void testMethodInAnonymousCovering1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1519,7 +1519,7 @@ public void testMethodInAnonymousCovering1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1537,7 +1537,7 @@ public void testMethodInAnonymousCovering1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1562,7 +1562,7 @@ public void testMethodInAnonymousCovering1() throws Exception { public void testMethodInAnonymousCovering2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void run(int i) {\n"); @@ -1585,7 +1585,7 @@ public void testMethodInAnonymousCovering2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void run(int i) {\n"); @@ -1603,7 +1603,7 @@ public void testMethodInAnonymousCovering2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void run(int i) {\n"); @@ -1621,7 +1621,7 @@ public void testMethodInAnonymousCovering2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void run(int i) {\n"); @@ -1639,7 +1639,7 @@ public void testMethodInAnonymousCovering2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public static void run(int i) {\n"); @@ -1664,7 +1664,7 @@ public void testMethodInAnonymousCovering2() throws Exception { public void testMethodInAnonymousCovering3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1685,7 +1685,7 @@ public void testMethodInAnonymousCovering3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1701,7 +1701,7 @@ public void testMethodInAnonymousCovering3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1717,7 +1717,7 @@ public void testMethodInAnonymousCovering3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1733,7 +1733,7 @@ public void testMethodInAnonymousCovering3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1756,7 +1756,7 @@ public void testMethodInAnonymousCovering3() throws Exception { public void testMethodInAnonymousCovering4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1777,7 +1777,7 @@ public void testMethodInAnonymousCovering4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1796,7 +1796,7 @@ public void testMethodInAnonymousCovering4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1812,7 +1812,7 @@ public void testMethodInAnonymousCovering4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void run(int i) {\n"); @@ -1834,7 +1834,7 @@ public void testMethodInAnonymousCovering4() throws Exception { @Test public void testMethodInDifferentInterface() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(X x) {\n"); @@ -1843,7 +1843,7 @@ public void testMethodInDifferentInterface() throws Exception { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface X {\n"); buf.append("}\n"); @@ -1857,7 +1857,7 @@ public void testMethodInDifferentInterface() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface X {\n"); buf.append("\n"); @@ -1868,7 +1868,7 @@ public void testMethodInDifferentInterface() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(X x) {\n"); @@ -1884,7 +1884,7 @@ public void testMethodInDifferentInterface() throws Exception { public void testMethodInArrayAccess() throws Exception { // bug 148011 IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -1901,7 +1901,7 @@ public void testMethodInArrayAccess() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -1923,9 +1923,9 @@ public void testMethodInArrayAccess() throws Exception { @Test public void testParameterMismatchCast() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -1943,7 +1943,7 @@ public void testParameterMismatchCast() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -1956,7 +1956,7 @@ public void testParameterMismatchCast() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -1972,7 +1972,7 @@ public void testParameterMismatchCast() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(long l) {\n"); @@ -1989,9 +1989,9 @@ public void testParameterMismatchCast() throws Exception { @Test public void testParameterMismatchCast2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -2001,7 +2001,7 @@ public void testParameterMismatchCast2() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo(int i, Object o) {\n"); @@ -2017,7 +2017,7 @@ public void testParameterMismatchCast2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -2030,7 +2030,7 @@ public void testParameterMismatchCast2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo(int i, Object o) {\n"); @@ -2044,7 +2044,7 @@ public void testParameterMismatchCast2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo(float x, Object o) {\n"); @@ -2059,9 +2059,9 @@ public void testParameterMismatchCast2() throws Exception { @Test public void testParameterMismatchCastBoxing() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer i) {\n"); @@ -2078,7 +2078,7 @@ public void testParameterMismatchCastBoxing() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer i) {\n"); @@ -2090,7 +2090,7 @@ public void testParameterMismatchCastBoxing() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Integer i) {\n"); @@ -2105,7 +2105,7 @@ public void testParameterMismatchCastBoxing() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(double d) {\n"); @@ -2121,9 +2121,9 @@ public void testParameterMismatchCastBoxing() throws Exception { @Test public void testParameterMismatchChangeVarType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2144,7 +2144,7 @@ public void testParameterMismatchChangeVarType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2160,7 +2160,7 @@ public void testParameterMismatchChangeVarType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2178,7 +2178,7 @@ public void testParameterMismatchChangeVarType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2199,7 +2199,7 @@ public void testParameterMismatchChangeVarType() throws Exception { public void testParameterMismatchChangeVarTypeInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class A {\n"); @@ -2208,7 +2208,7 @@ public void testParameterMismatchChangeVarTypeInGeneric() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(A a, long x) {\n"); @@ -2225,7 +2225,7 @@ public void testParameterMismatchChangeVarTypeInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class A {\n"); @@ -2237,7 +2237,7 @@ public void testParameterMismatchChangeVarTypeInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -2252,7 +2252,7 @@ public void testParameterMismatchChangeVarTypeInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class A {\n"); @@ -2271,7 +2271,7 @@ public void testParameterMismatchChangeVarTypeInGeneric() throws Exception { @Test public void testParameterMismatchKeepModifiers() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -2289,7 +2289,7 @@ public void testParameterMismatchKeepModifiers() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -2301,7 +2301,7 @@ public void testParameterMismatchKeepModifiers() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Collections;\n"); @@ -2323,9 +2323,9 @@ public void testParameterMismatchKeepModifiers() throws Exception { @Test public void testParameterMismatchChangeFieldType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2346,7 +2346,7 @@ public void testParameterMismatchChangeFieldType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2362,7 +2362,7 @@ public void testParameterMismatchChangeFieldType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2380,7 +2380,7 @@ public void testParameterMismatchChangeFieldType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2401,14 +2401,14 @@ public void testParameterMismatchChangeFieldType() throws Exception { public void testParameterMismatchChangeFieldTypeInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" String count= 0;\n"); buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2428,7 +2428,7 @@ public void testParameterMismatchChangeFieldTypeInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -2441,7 +2441,7 @@ public void testParameterMismatchChangeFieldTypeInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2456,7 +2456,7 @@ public void testParameterMismatchChangeFieldTypeInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2477,9 +2477,9 @@ public void testParameterMismatchChangeFieldTypeInGeneric() throws Exception { @Test public void testParameterMismatchChangeMethodType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2500,7 +2500,7 @@ public void testParameterMismatchChangeMethodType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2516,7 +2516,7 @@ public void testParameterMismatchChangeMethodType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2534,7 +2534,7 @@ public void testParameterMismatchChangeMethodType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2554,9 +2554,9 @@ public void testParameterMismatchChangeMethodType() throws Exception { @Test public void testParameterMismatchChangeMethodTypeBug102142() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Foo {\n"); buf.append(" Foo(String string) {\n"); @@ -2576,7 +2576,7 @@ public void testParameterMismatchChangeMethodTypeBug102142() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Foo {\n"); buf.append(" Foo(int i) {\n"); @@ -2591,7 +2591,7 @@ public void testParameterMismatchChangeMethodTypeBug102142() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Foo {\n"); buf.append(" Foo(String string) {\n"); @@ -2611,9 +2611,9 @@ public void testParameterMismatchChangeMethodTypeBug102142() throws Exception { @Test public void testParameterMismatchChangeMethodTypeInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2634,7 +2634,7 @@ public void testParameterMismatchChangeMethodTypeInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2650,7 +2650,7 @@ public void testParameterMismatchChangeMethodTypeInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2668,7 +2668,7 @@ public void testParameterMismatchChangeMethodTypeInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -2690,9 +2690,9 @@ public void testParameterMismatchChangeMethodTypeInGeneric() throws Exception { @Test public void testParameterMismatchLessArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s, int i, Object o) {\n"); @@ -2710,7 +2710,7 @@ public void testParameterMismatchLessArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s, int i, Object o) {\n"); @@ -2723,7 +2723,7 @@ public void testParameterMismatchLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s, int i, Object o) {\n"); @@ -2739,7 +2739,7 @@ public void testParameterMismatchLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -2756,9 +2756,9 @@ public void testParameterMismatchLessArguments() throws Exception { @Test public void testParameterMismatchLessArguments2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2767,7 +2767,7 @@ public void testParameterMismatchLessArguments2() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo(int i, Object o) {\n"); @@ -2784,7 +2784,7 @@ public void testParameterMismatchLessArguments2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2796,7 +2796,7 @@ public void testParameterMismatchLessArguments2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo(int i, Object o) {\n"); @@ -2810,7 +2810,7 @@ public void testParameterMismatchLessArguments2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public static void xoo(Object o) {\n"); @@ -2825,9 +2825,9 @@ public void testParameterMismatchLessArguments2() throws Exception { @Test public void testParameterMismatchLessArguments3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2836,7 +2836,7 @@ public void testParameterMismatchLessArguments3() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" /**\n"); @@ -2858,7 +2858,7 @@ public void testParameterMismatchLessArguments3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -2870,7 +2870,7 @@ public void testParameterMismatchLessArguments3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" /**\n"); @@ -2889,7 +2889,7 @@ public void testParameterMismatchLessArguments3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" /**\n"); @@ -2908,14 +2908,14 @@ public void testParameterMismatchLessArguments3() throws Exception { @Test public void testParameterMismatchLessArgumentsInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface X {\n"); buf.append(" public void foo(S s, int i, T t);\n"); buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements X {\n"); buf.append(" public void meth(E e, String s) {\n"); @@ -2933,7 +2933,7 @@ public void testParameterMismatchLessArgumentsInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements X {\n"); buf.append(" public void meth(E e, String s) {\n"); @@ -2946,7 +2946,7 @@ public void testParameterMismatchLessArgumentsInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements X {\n"); buf.append(" public void meth(E e, String s) {\n"); @@ -2962,7 +2962,7 @@ public void testParameterMismatchLessArgumentsInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface X {\n"); buf.append(" public void foo(int i);\n"); @@ -2972,7 +2972,7 @@ public void testParameterMismatchLessArgumentsInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class E implements X {\n"); buf.append(" public void meth(E e, String s) {\n"); @@ -2991,7 +2991,7 @@ public void testParameterMismatchLessArgumentsInGeneric() throws Exception { public void testCreateAbstractMethodInAbstractParent() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private class B {\n"); @@ -3008,7 +3008,7 @@ public void testCreateAbstractMethodInAbstractParent() throws Exception { assertNumberOfProposals(proposals, 3); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private class B {\n"); @@ -3022,7 +3022,7 @@ public void testCreateAbstractMethodInAbstractParent() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private class B {\n"); @@ -3036,7 +3036,7 @@ public void testCreateAbstractMethodInAbstractParent() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private class B {\n"); @@ -3064,7 +3064,7 @@ public void testCreateAbstractMethodInAbstractParent() throws Exception { public void testCreateAbstractMethodInAbstractParentWithAbstractClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private abstract class B {\n"); @@ -3081,7 +3081,7 @@ public void testCreateAbstractMethodInAbstractParentWithAbstractClass() throws E assertNumberOfProposals(proposals, 4); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private abstract class B {\n"); @@ -3095,7 +3095,7 @@ public void testCreateAbstractMethodInAbstractParentWithAbstractClass() throws E buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private abstract class B {\n"); @@ -3109,7 +3109,7 @@ public void testCreateAbstractMethodInAbstractParentWithAbstractClass() throws E buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private abstract class B {\n"); @@ -3122,7 +3122,7 @@ public void testCreateAbstractMethodInAbstractParentWithAbstractClass() throws E buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public abstract class A {\n"); buf.append(" private abstract class B {\n"); @@ -3150,9 +3150,9 @@ public void testCreateAbstractMethodInAbstractParentWithAbstractClass() throws E @Test public void testSuperConstructorLessArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public X(Object o, int i) {\n"); @@ -3160,7 +3160,7 @@ public void testSuperConstructorLessArguments() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -3179,7 +3179,7 @@ public void testSuperConstructorLessArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -3192,7 +3192,7 @@ public void testSuperConstructorLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -3209,7 +3209,7 @@ public void testSuperConstructorLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public X(Object o) {\n"); @@ -3224,9 +3224,9 @@ public void testSuperConstructorLessArguments() throws Exception { @Test public void testConstructorInvocationLessArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3247,7 +3247,7 @@ public void testConstructorInvocationLessArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3262,7 +3262,7 @@ public void testConstructorInvocationLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3277,7 +3277,7 @@ public void testConstructorInvocationLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3298,9 +3298,9 @@ public void testConstructorInvocationLessArguments() throws Exception { @Test public void testConstructorInvocationLessArgumentsInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3321,7 +3321,7 @@ public void testConstructorInvocationLessArgumentsInGenericType() throws Excepti CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3336,7 +3336,7 @@ public void testConstructorInvocationLessArgumentsInGenericType() throws Excepti proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3351,7 +3351,7 @@ public void testConstructorInvocationLessArgumentsInGenericType() throws Excepti proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3372,7 +3372,7 @@ public void testConstructorInvocationLessArgumentsInGenericType() throws Excepti @Test public void testMethodMismatchVarargsAddedArguments() throws Exception { // fix for Bug 546819 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b, String ... strings) {\n"); @@ -3391,7 +3391,7 @@ public void testMethodMismatchVarargsAddedArguments() throws Exception { // fix CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b, String ... strings) {\n"); @@ -3405,7 +3405,7 @@ public void testMethodMismatchVarargsAddedArguments() throws Exception { // fix proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b, int i, String ... strings) {\n"); @@ -3420,7 +3420,7 @@ public void testMethodMismatchVarargsAddedArguments() throws Exception { // fix proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(boolean b, String ... strings) {\n"); @@ -3440,9 +3440,9 @@ public void testMethodMismatchVarargsAddedArguments() throws Exception { // fix @Test public void testParameterMismatchMoreArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(X x) {\n"); @@ -3451,7 +3451,7 @@ public void testParameterMismatchMoreArguments() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public void xoo(int i, String o) {\n"); @@ -3467,7 +3467,7 @@ public void testParameterMismatchMoreArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(X x) {\n"); @@ -3479,7 +3479,7 @@ public void testParameterMismatchMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public void xoo(int i, int j, String o) {\n"); @@ -3490,7 +3490,7 @@ public void testParameterMismatchMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public void xoo(int i, String o) {\n"); @@ -3508,9 +3508,9 @@ public void testParameterMismatchMoreArguments() throws Exception { @Test public void testParameterMismatchMoreArguments2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -3528,7 +3528,7 @@ public void testParameterMismatchMoreArguments2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -3541,7 +3541,7 @@ public void testParameterMismatchMoreArguments2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s) {\n"); @@ -3557,7 +3557,7 @@ public void testParameterMismatchMoreArguments2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String s, int x2) {\n"); @@ -3574,9 +3574,9 @@ public void testParameterMismatchMoreArguments2() throws Exception { @Test public void testParameterMismatchMoreArguments3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("public class E {\n"); @@ -3586,7 +3586,7 @@ public void testParameterMismatchMoreArguments3() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" /**\n"); @@ -3606,7 +3606,7 @@ public void testParameterMismatchMoreArguments3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Collections;\n"); buf.append("public class E {\n"); @@ -3619,7 +3619,7 @@ public void testParameterMismatchMoreArguments3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -3639,7 +3639,7 @@ public void testParameterMismatchMoreArguments3() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Set;\n"); @@ -3665,9 +3665,9 @@ public void testParameterMismatchMoreArguments3() throws Exception { @Test public void testParameterMismatchMoreArguments4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3685,7 +3685,7 @@ public void testParameterMismatchMoreArguments4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3698,7 +3698,7 @@ public void testParameterMismatchMoreArguments4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo() {\n"); @@ -3714,7 +3714,7 @@ public void testParameterMismatchMoreArguments4() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int length) {\n"); @@ -3731,9 +3731,9 @@ public void testParameterMismatchMoreArguments4() throws Exception { @Test public void testParameterMismatchMoreArgumentsInGeneric() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(X x) {\n"); @@ -3742,7 +3742,7 @@ public void testParameterMismatchMoreArgumentsInGeneric() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" /**\n"); @@ -3760,7 +3760,7 @@ public void testParameterMismatchMoreArgumentsInGeneric() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(X x) {\n"); @@ -3772,7 +3772,7 @@ public void testParameterMismatchMoreArgumentsInGeneric() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" /**\n"); @@ -3792,9 +3792,9 @@ public void testParameterMismatchMoreArgumentsInGeneric() throws Exception { @Test public void testSuperConstructorMoreArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public X() {\n"); @@ -3802,7 +3802,7 @@ public void testSuperConstructorMoreArguments() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -3821,7 +3821,7 @@ public void testSuperConstructorMoreArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -3834,7 +3834,7 @@ public void testSuperConstructorMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -3851,7 +3851,7 @@ public void testSuperConstructorMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -3869,7 +3869,7 @@ public void testSuperConstructorMoreArguments() throws Exception { @Test public void testConstructorInvocationMoreArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3890,7 +3890,7 @@ public void testConstructorInvocationMoreArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3905,7 +3905,7 @@ public void testConstructorInvocationMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3920,7 +3920,7 @@ public void testConstructorInvocationMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3941,7 +3941,7 @@ public void testConstructorInvocationMoreArguments() throws Exception { @Test public void testConstructorInvocationMoreArguments2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3965,7 +3965,7 @@ public void testConstructorInvocationMoreArguments2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -3983,7 +3983,7 @@ public void testConstructorInvocationMoreArguments2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -4002,7 +4002,7 @@ public void testConstructorInvocationMoreArguments2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -4028,9 +4028,9 @@ public void testConstructorInvocationMoreArguments2() throws Exception { @Test public void testParameterMismatchSwap() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, String[] o) {\n"); @@ -4047,7 +4047,7 @@ public void testParameterMismatchSwap() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, String[] o) {\n"); @@ -4059,7 +4059,7 @@ public void testParameterMismatchSwap() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i, String[] o) {\n"); @@ -4074,7 +4074,7 @@ public void testParameterMismatchSwap() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(String[] o, int i) {\n"); @@ -4089,9 +4089,9 @@ public void testParameterMismatchSwap() throws Exception { @Test public void testParameterMismatchSwapInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void b(int i, T[] t) {\n"); @@ -4099,7 +4099,7 @@ public void testParameterMismatchSwapInGenericType() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public enum E {\n"); buf.append(" CONST1, CONST2;\n"); @@ -4117,7 +4117,7 @@ public void testParameterMismatchSwapInGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void b(T[] t, int i) {\n"); @@ -4128,7 +4128,7 @@ public void testParameterMismatchSwapInGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void b(int i, T[] t) {\n"); @@ -4142,7 +4142,7 @@ public void testParameterMismatchSwapInGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public enum E {\n"); buf.append(" CONST1, CONST2;\n"); @@ -4158,7 +4158,7 @@ public void testParameterMismatchSwapInGenericType() throws Exception { @Test public void testParameterMismatchWithExtraDimensions() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String[] a){\n"); @@ -4176,7 +4176,7 @@ public void testParameterMismatchWithExtraDimensions() throws Exception { assertNumberOfProposals(proposals, 3); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String[] a){\n"); @@ -4187,7 +4187,7 @@ public void testParameterMismatchWithExtraDimensions() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String[] a){\n"); @@ -4200,7 +4200,7 @@ public void testParameterMismatchWithExtraDimensions() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(int[] a){\n"); @@ -4217,7 +4217,7 @@ public void testParameterMismatchWithExtraDimensions() throws Exception { @Test public void testParameterMismatchWithVarArgs() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String[] a){\n"); @@ -4235,7 +4235,7 @@ public void testParameterMismatchWithVarArgs() throws Exception { assertNumberOfProposals(proposals, 2); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String[] a){\n"); @@ -4246,7 +4246,7 @@ public void testParameterMismatchWithVarArgs() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String[] a){\n"); @@ -4265,7 +4265,7 @@ public void testParameterMismatchWithVarArgs() throws Exception { @Test public void testMissingParameterWithVarArgs() throws Exception { // test for Bug 521070 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String...b){\n"); @@ -4280,7 +4280,7 @@ public void testMissingParameterWithVarArgs() throws Exception { // test for Bug assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String c, String...b){\n"); @@ -4295,7 +4295,7 @@ public void testMissingParameterWithVarArgs() throws Exception { // test for Bug @Test public void testMissingParameterWithoutVarArgs() throws Exception { // test for Bug 521070 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String b){\n"); @@ -4310,7 +4310,7 @@ public void testMissingParameterWithoutVarArgs() throws Exception { // test for assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String b, String c){\n"); @@ -4327,9 +4327,9 @@ public void testMissingParameterWithoutVarArgs() throws Exception { // test for @Test public void testParameterMismatchSwap2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -4352,7 +4352,7 @@ public void testParameterMismatchSwap2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -4370,7 +4370,7 @@ public void testParameterMismatchSwap2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -4391,7 +4391,7 @@ public void testParameterMismatchSwap2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -4412,7 +4412,7 @@ public void testParameterMismatchSwap2() throws Exception { @Test public void testSuperConstructor() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public E(int i) {\n"); @@ -4421,7 +4421,7 @@ public void testSuperConstructor() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -4435,7 +4435,7 @@ public void testSuperConstructor() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("\n"); @@ -4447,7 +4447,7 @@ public void testSuperConstructor() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public E(int i) {\n"); @@ -4464,7 +4464,7 @@ public void testSuperConstructor() throws Exception { @Test public void testClassInstanceCreation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4473,7 +4473,7 @@ public void testClassInstanceCreation() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -4487,7 +4487,7 @@ public void testClassInstanceCreation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("\n"); @@ -4499,7 +4499,7 @@ public void testClassInstanceCreation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4514,7 +4514,7 @@ public void testClassInstanceCreation() throws Exception { @Test public void testClassInstanceCreation2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4533,7 +4533,7 @@ public void testClassInstanceCreation2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4550,7 +4550,7 @@ public void testClassInstanceCreation2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4568,7 +4568,7 @@ public void testClassInstanceCreation2() throws Exception { @Test public void testClassInstanceCreationInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4577,7 +4577,7 @@ public void testClassInstanceCreationInGenericType() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -4591,7 +4591,7 @@ public void testClassInstanceCreationInGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("\n"); @@ -4603,7 +4603,7 @@ public void testClassInstanceCreationInGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4619,7 +4619,7 @@ public void testClassInstanceCreationInGenericType() throws Exception { @Test public void testClassInstanceCreationMoreArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4628,7 +4628,7 @@ public void testClassInstanceCreationMoreArguments() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i) {\n"); @@ -4644,7 +4644,7 @@ public void testClassInstanceCreationMoreArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, String string, boolean b) {\n"); @@ -4655,7 +4655,7 @@ public void testClassInstanceCreationMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4667,7 +4667,7 @@ public void testClassInstanceCreationMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i) {\n"); @@ -4684,7 +4684,7 @@ public void testClassInstanceCreationMoreArguments() throws Exception { @Test public void testClassInstanceCreationVarargsAddedArguments() throws Exception { // fix for Bug 546819 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4693,7 +4693,7 @@ public void testClassInstanceCreationVarargsAddedArguments() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(boolean b, String ... strings) {\n"); @@ -4709,7 +4709,7 @@ public void testClassInstanceCreationVarargsAddedArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4721,7 +4721,7 @@ public void testClassInstanceCreationVarargsAddedArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, boolean b, String ... strings) {\n"); @@ -4733,7 +4733,7 @@ public void testClassInstanceCreationVarargsAddedArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(boolean b, String ... strings) {\n"); @@ -4750,7 +4750,7 @@ public void testClassInstanceCreationVarargsAddedArguments() throws Exception { @Test public void testClassInstanceCreationMoreArgumentsInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -4760,7 +4760,7 @@ public void testClassInstanceCreationMoreArgumentsInGenericType() throws Excepti buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i) {\n"); @@ -4776,7 +4776,7 @@ public void testClassInstanceCreationMoreArgumentsInGenericType() throws Excepti CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, String string, boolean b) {\n"); @@ -4787,7 +4787,7 @@ public void testClassInstanceCreationMoreArgumentsInGenericType() throws Excepti proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -4800,7 +4800,7 @@ public void testClassInstanceCreationMoreArgumentsInGenericType() throws Excepti proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i) {\n"); @@ -4817,7 +4817,7 @@ public void testClassInstanceCreationMoreArgumentsInGenericType() throws Excepti @Test public void testClassInstanceCreationLessArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4826,7 +4826,7 @@ public void testClassInstanceCreationLessArguments() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, String s) {\n"); @@ -4842,7 +4842,7 @@ public void testClassInstanceCreationLessArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A() {\n"); @@ -4853,7 +4853,7 @@ public void testClassInstanceCreationLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int i) {\n"); @@ -4865,7 +4865,7 @@ public void testClassInstanceCreationLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, String s) {\n"); @@ -4882,7 +4882,7 @@ public void testClassInstanceCreationLessArguments() throws Exception { @Test public void testClassInstanceCreationLessArgumentsInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -4892,7 +4892,7 @@ public void testClassInstanceCreationLessArgumentsInGenericType() throws Excepti buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, String s) {\n"); @@ -4908,7 +4908,7 @@ public void testClassInstanceCreationLessArgumentsInGenericType() throws Excepti CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A() {\n"); @@ -4919,7 +4919,7 @@ public void testClassInstanceCreationLessArgumentsInGenericType() throws Excepti proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.List;\n"); buf.append("public class E {\n"); @@ -4932,7 +4932,7 @@ public void testClassInstanceCreationLessArgumentsInGenericType() throws Excepti proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, String s) {\n"); @@ -4950,7 +4950,7 @@ public void testClassInstanceCreationLessArgumentsInGenericType() throws Excepti @Test public void testConstructorInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(int i) {\n"); @@ -4967,7 +4967,7 @@ public void testConstructorInvocation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(int i) {\n"); @@ -4986,7 +4986,7 @@ public void testConstructorInvocation() throws Exception { @Test public void testConstructorInvocationInGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(int i) {\n"); @@ -5003,7 +5003,7 @@ public void testConstructorInvocationInGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(int i) {\n"); @@ -5021,7 +5021,7 @@ public void testConstructorInvocationInGenericType() throws Exception { @Test public void testSuperMethodInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public void foo(int i) {\n"); @@ -5030,7 +5030,7 @@ public void testSuperMethodInvocation() throws Exception { buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("}\n"); @@ -5044,7 +5044,7 @@ public void testSuperMethodInvocation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append("\n"); @@ -5058,7 +5058,7 @@ public void testSuperMethodInvocation() throws Exception { @Test public void testSuperMethodVarargsAddedArguments() throws Exception { // fix for Bug 546819 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public E(int i) {\n"); @@ -5067,7 +5067,7 @@ public void testSuperMethodVarargsAddedArguments() throws Exception { // fix for buf.append("}\n"); ICompilationUnit cu1=pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(boolean b, String ... strings) {\n"); @@ -5083,7 +5083,7 @@ public void testSuperMethodVarargsAddedArguments() throws Exception { // fix for CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends A {\n"); buf.append(" public E(int i) {\n"); @@ -5095,7 +5095,7 @@ public void testSuperMethodVarargsAddedArguments() throws Exception { // fix for proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(int i, boolean b, String ... strings) {\n"); @@ -5107,7 +5107,7 @@ public void testSuperMethodVarargsAddedArguments() throws Exception { // fix for proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public A(boolean b, String ... strings) {\n"); @@ -5124,9 +5124,9 @@ public void testSuperMethodVarargsAddedArguments() throws Exception { // fix for @Test public void testSuperMethodMoreArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public int foo() {\n"); @@ -5135,7 +5135,7 @@ public void testSuperMethodMoreArguments() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -5154,7 +5154,7 @@ public void testSuperMethodMoreArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -5167,7 +5167,7 @@ public void testSuperMethodMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -5182,7 +5182,7 @@ public void testSuperMethodMoreArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -5204,9 +5204,9 @@ public void testSuperMethodMoreArguments() throws Exception { @Test public void testSuperMethodLessArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public int foo(Object o, boolean b) {\n"); @@ -5215,7 +5215,7 @@ public void testSuperMethodLessArguments() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("X.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -5234,7 +5234,7 @@ public void testSuperMethodLessArguments() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E extends X {\n"); @@ -5247,7 +5247,7 @@ public void testSuperMethodLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" public int foo(Object o) {\n"); @@ -5259,7 +5259,7 @@ public void testSuperMethodLessArguments() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -5283,7 +5283,7 @@ public void testSuperMethodLessArguments() throws Exception { public void testMissingCastParents1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -5300,7 +5300,7 @@ public void testMissingCastParents1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -5316,7 +5316,7 @@ public void testMissingCastParents1() throws Exception { public void testMissingCastParents2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -5333,7 +5333,7 @@ public void testMissingCastParents2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object o) {\n"); @@ -5349,7 +5349,7 @@ public void testMissingCastParents2() throws Exception { public void testMissingCastParents3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static Object obj;\n"); @@ -5367,7 +5367,7 @@ public void testMissingCastParents3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static Object obj;\n"); @@ -5384,7 +5384,7 @@ public void testMissingCastParents3() throws Exception { public void testArrayAccess() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static Object obj;\n"); @@ -5402,7 +5402,7 @@ public void testArrayAccess() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static Object obj;\n"); @@ -5415,7 +5415,7 @@ public void testArrayAccess() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static Object obj;\n"); @@ -5433,7 +5433,7 @@ public void testArrayAccess() throws Exception { public void testIncompleteThrowsStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object[] array) {\n"); @@ -5450,7 +5450,7 @@ public void testIncompleteThrowsStatement() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object[] array) {\n"); @@ -5462,7 +5462,7 @@ public void testIncompleteThrowsStatement() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(Object[] array) {\n"); @@ -5482,7 +5482,7 @@ public void testIncompleteThrowsStatement() throws Exception { @Test public void testMissingAnnotationAttribute1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -5501,7 +5501,7 @@ public void testMissingAnnotationAttribute1() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -5521,7 +5521,7 @@ public void testMissingAnnotationAttribute1() throws Exception { @Test public void testMissingAnnotationAttribute2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -5540,7 +5540,7 @@ public void testMissingAnnotationAttribute2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -5563,7 +5563,7 @@ public void testStaticImportFavorite1() throws Exception { preferenceStore.setValue(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, "java.lang.Math.*"); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5579,7 +5579,7 @@ public void testStaticImportFavorite1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import static java.lang.Math.max;\n"); @@ -5603,7 +5603,7 @@ public void testStaticImportFavorite2() throws Exception { preferenceStore.setValue(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, "java.lang.Math.max"); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5619,7 +5619,7 @@ public void testStaticImportFavorite2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -5648,7 +5648,7 @@ public void testIndirectProtectedMethod() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" protected void method() {\n"); @@ -5656,7 +5656,7 @@ public void testIndirectProtectedMethod() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.A;\n"); buf.append("public class B extends A {\n"); @@ -5673,7 +5673,7 @@ public void testIndirectProtectedMethod() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" public void method() {\n"); @@ -5725,7 +5725,7 @@ public void testStaticMethodInInterface2() throws Exception { @Test public void testStaticMethodInInterface3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class XX {\n"); buf.append(" interface I {\n"); @@ -5741,7 +5741,7 @@ public void testStaticMethodInInterface3() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class XX {\n"); buf.append(" interface I {\n"); @@ -5757,9 +5757,9 @@ public void testStaticMethodInInterface3() throws Exception { @Test public void testStaticMethodInInterface4() throws Exception { - StringBuffer buf; + StringBuilder buf; IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface I {\n"); buf.append(" int i= n();\n"); @@ -5773,9 +5773,9 @@ public void testStaticMethodInInterface4() throws Exception { @Test public void testAbstractMehodInInterface() throws Exception { - StringBuffer buf; + StringBuilder buf; IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Snippet {\n"); buf.append(" abstract String name();\n"); @@ -5794,7 +5794,7 @@ public void testAbstractMehodInInterface() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Snippet {\n"); buf.append(" abstract String name();\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest1d8.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest1d8.java index 92880b7dc5a..193227aad23 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest1d8.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedMethodsQuickFixTest1d8.java @@ -120,7 +120,7 @@ public void testStaticInterfaceMethodNotInherited() throws Exception { @Test public void testCreateMethodQuickFix1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Snippet {\n"); buf.append(" public abstract String name();\n"); @@ -139,7 +139,7 @@ public void testCreateMethodQuickFix1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Snippet {\n"); buf.append(" public abstract String name();\n"); @@ -156,9 +156,9 @@ public void testCreateMethodQuickFix1() throws Exception { @Test public void testCreateMethodQuickFix2() throws Exception { - StringBuffer buf; + StringBuilder buf; IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Snippet {\n"); buf.append(" public abstract String name();\n"); @@ -177,7 +177,7 @@ public void testCreateMethodQuickFix2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("interface Snippet {\n"); buf.append(" public abstract String name();\n"); @@ -196,7 +196,7 @@ public void testCreateMethodQuickFix2() throws Exception { @Test public void testCreateMethodQuickFix3() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); buf.append("package test1;\n"); buf.append("public interface NestedInterfaceInInterface {\n"); @@ -227,7 +227,7 @@ public void testCreateMethodQuickFix3() throws Exception { buf1.append(" }\n"); buf1.append("}\n"); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface NestedInterfaceInInterface {\n"); buf.append(" interface Interface {\n"); @@ -246,7 +246,7 @@ public void testCreateMethodQuickFix3() throws Exception { @Test public void testCreateMethodQuickFix4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public interface NestedInterfaceInInterface {\n"); @@ -265,7 +265,7 @@ public void testCreateMethodQuickFix4() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public interface NestedInterfaceInInterface {\n"); @@ -282,7 +282,7 @@ public void testCreateMethodQuickFix4() throws Exception { @Test public void testCreateMethodQuickFix5() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface NestedInterfaceInInterface {\n"); buf.append(" interface Interface {\n"); @@ -300,7 +300,7 @@ public void testCreateMethodQuickFix5() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface NestedInterfaceInInterface {\n"); buf.append(" interface Interface {\n"); @@ -317,7 +317,7 @@ public void testCreateMethodQuickFix5() throws Exception { @Test public void testCreateMethodQuickFix6() throws Exception { - StringBuffer buf1= new StringBuffer(); + StringBuilder buf1= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); buf1.append("package test1;\n"); buf1.append("public class NestedInterfaceInClass {\n"); @@ -338,7 +338,7 @@ public void testCreateMethodQuickFix6() throws Exception { CUCorrectionProposal proposal1= (CUCorrectionProposal) proposals.get(0); CUCorrectionProposal proposal2= (CUCorrectionProposal) proposals.get(1); - buf1= new StringBuffer(); + buf1= new StringBuilder(); buf1.append("package test1;\n"); buf1.append("public class NestedInterfaceInClass {\n"); buf1.append(" public static final int total= 10;\n"); @@ -371,7 +371,7 @@ public void testCreateMethodQuickFix6() throws Exception { @Test public void testCreateMethodQuickFix7() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class NestedInterfaceInClass {\n"); buf.append(" int total= 10;\n"); @@ -388,7 +388,7 @@ public void testCreateMethodQuickFix7() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class NestedInterfaceInClass {\n"); buf.append(" int total= 10;\n"); @@ -410,14 +410,14 @@ public void testBug514213_avoidRedundantNonNullWhenCreatingMissingMethodForOverr IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -445,7 +445,7 @@ public void testBug514213_avoidRedundantNonNullWhenCreatingMissingMethodForOverr AssistContext context= getCorrectionContext(cu, buf.toString().indexOf("f("), 0); List proposals= collectAssists(context, false); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -474,7 +474,7 @@ public void testBug514213_avoidRedundantNonNullWhenCreatingMissingMethodForOverr buf.append("}"); assertProposalPreviewEquals(buf.toString(), "Create 'f()' in super type 'I1'", proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -512,14 +512,14 @@ public void testBug514213_avoidRedundantNonNullWhenCreatingMissingMethodForInvoc IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf; + StringBuilder buf; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("@org.eclipse.jdt.annotation.NonNullByDefault\n"); buf.append("package test1;\n"); pack1.createCompilationUnit("package-info.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -550,7 +550,7 @@ public void testBug514213_avoidRedundantNonNullWhenCreatingMissingMethodForInvoc assertNumberOfProblems(2, problems); List proposals1= collectCorrections(cu, problems[0], null); List proposals2= collectCorrections(cu, problems[1], null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -580,7 +580,7 @@ public void testBug514213_avoidRedundantNonNullWhenCreatingMissingMethodForInvoc buf.append("}"); assertProposalPreviewEquals(buf.toString(), "Create method 'g(Number, Number)' in type 'I1'", proposals1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Comparator;\n"); @@ -614,7 +614,7 @@ public void testBug528876() throws Exception { NullTestUtils.prepareNullTypeAnnotations(fSourceFolder); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import annots.*;\n"); buf.append("@NonNullByDefault\n"); @@ -636,7 +636,7 @@ public void testBug528876() throws Exception { assertCorrectLabels(proposals); assertNumberOfProposals(proposals, 1); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import annots.*;\n"); buf.append("@NonNullByDefault\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedTypesQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedTypesQuickFixTest.java index 662e0e2f838..2b784dd5bf2 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedTypesQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedTypesQuickFixTest.java @@ -88,7 +88,7 @@ public void tearDown() throws Exception { @Test public void testTypeInFieldDecl() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" Vector1 vec;\n"); @@ -99,7 +99,7 @@ public void testTypeInFieldDecl() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -109,7 +109,7 @@ public void testTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Vector1 {\n"); @@ -117,7 +117,7 @@ public void testTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface Vector1 {\n"); @@ -125,7 +125,7 @@ public void testTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum Vector1 {\n"); @@ -133,7 +133,7 @@ public void testTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" Vector1 vec;\n"); @@ -147,7 +147,7 @@ public void testTypeInFieldDecl() throws Exception { @Test public void testTypeInMethodArguments() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Vect1or[] vec) {\n"); @@ -159,7 +159,7 @@ public void testTypeInMethodArguments() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -170,7 +170,7 @@ public void testTypeInMethodArguments() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Vect1or {\n"); @@ -178,7 +178,7 @@ public void testTypeInMethodArguments() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface Vect1or {\n"); @@ -186,7 +186,7 @@ public void testTypeInMethodArguments() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum Vect1or {\n"); @@ -194,7 +194,7 @@ public void testTypeInMethodArguments() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Vect1or[] vec) {\n"); @@ -202,7 +202,7 @@ public void testTypeInMethodArguments() throws Exception { buf.append("}\n"); String expected5= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Vect1or[] vec) {\n"); @@ -216,7 +216,7 @@ public void testTypeInMethodArguments() throws Exception { @Test public void testTypeInMethodReturnType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" Vect1or[] foo() {\n"); @@ -229,7 +229,7 @@ public void testTypeInMethodReturnType() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Vector;\n"); @@ -241,7 +241,7 @@ public void testTypeInMethodReturnType() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Vect1or {\n"); @@ -249,7 +249,7 @@ public void testTypeInMethodReturnType() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface Vect1or {\n"); @@ -257,7 +257,7 @@ public void testTypeInMethodReturnType() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum Vect1or {\n"); @@ -265,7 +265,7 @@ public void testTypeInMethodReturnType() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" Vect1or[] foo() {\n"); @@ -274,7 +274,7 @@ public void testTypeInMethodReturnType() throws Exception { buf.append("}\n"); String expected5= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" Vect1or[] foo() {\n"); @@ -289,7 +289,7 @@ public void testTypeInMethodReturnType() throws Exception { @Test public void testTypeInExceptionType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() throws IOExcpetion {\n"); @@ -301,7 +301,7 @@ public void testTypeInExceptionType() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.IOException;\n"); @@ -312,7 +312,7 @@ public void testTypeInExceptionType() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class IOExcpetion extends Exception {\n"); @@ -327,7 +327,7 @@ public void testTypeInExceptionType() throws Exception { @Test public void testTypeInVarDeclWithWildcard() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -342,7 +342,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -352,7 +352,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class XY {\n"); @@ -360,7 +360,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface XY {\n"); @@ -368,7 +368,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum XY {\n"); @@ -376,7 +376,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -386,7 +386,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { buf.append("}\n"); String expected5= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -402,7 +402,7 @@ public void testTypeInVarDeclWithWildcard() throws Exception { @Test public void testTypeInStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -416,7 +416,7 @@ public void testTypeInStatement() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class E {\n"); @@ -426,7 +426,7 @@ public void testTypeInStatement() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -443,7 +443,7 @@ public void testTypeInStatement() throws Exception { @Test public void testArrayTypeInStatement() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.*;\n"); buf.append("public class E {\n"); @@ -457,7 +457,7 @@ public void testArrayTypeInStatement() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.*;\n"); buf.append("public class E {\n"); @@ -467,7 +467,7 @@ public void testArrayTypeInStatement() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.*;\n"); buf.append("import java.util.ArrayList;\n"); @@ -478,7 +478,7 @@ public void testArrayTypeInStatement() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -488,7 +488,7 @@ public void testArrayTypeInStatement() throws Exception { buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -498,7 +498,7 @@ public void testArrayTypeInStatement() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.io.Serializable;\n"); @@ -508,7 +508,7 @@ public void testArrayTypeInStatement() throws Exception { buf.append("}\n"); String expected5= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.*;\n"); buf.append("public class E {\n"); @@ -518,7 +518,7 @@ public void testArrayTypeInStatement() throws Exception { buf.append("}\n"); String expected6= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.*;\n"); buf.append("public class E {\n"); @@ -534,7 +534,7 @@ public void testArrayTypeInStatement() throws Exception { @Test public void testQualifiedType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -547,7 +547,7 @@ public void testQualifiedType() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public class Test {\n"); @@ -555,7 +555,7 @@ public void testQualifiedType() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public interface Test {\n"); @@ -563,7 +563,7 @@ public void testQualifiedType() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("\n"); buf.append("public enum Test {\n"); @@ -577,7 +577,7 @@ public void testQualifiedType() throws Exception { @Test public void testInnerType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -587,7 +587,7 @@ public void testInnerType() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("E.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append("}\n"); @@ -597,7 +597,7 @@ public void testInnerType() throws Exception { ArrayList proposals= collectCorrections(cu1, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -607,7 +607,7 @@ public void testInnerType() throws Exception { buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append("\n"); @@ -617,7 +617,7 @@ public void testInnerType() throws Exception { buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append("\n"); @@ -633,7 +633,7 @@ public void testInnerType() throws Exception { @Test public void testTypeInCatchBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -648,7 +648,7 @@ public void testTypeInCatchBlock() throws Exception { ArrayList proposals= collectCorrections(cu1, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class XXX extends Exception {\n"); @@ -662,7 +662,7 @@ public void testTypeInCatchBlock() throws Exception { @Test public void testTypeInSuperType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends XXX {\n"); buf.append("}\n"); @@ -672,7 +672,7 @@ public void testTypeInSuperType() throws Exception { ArrayList proposals= collectCorrections(cu1, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class XXX {\n"); @@ -686,7 +686,7 @@ public void testTypeInSuperType() throws Exception { @Test public void testTypeInSuperInterface() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public interface E extends XXX {\n"); buf.append("}\n"); @@ -696,7 +696,7 @@ public void testTypeInSuperInterface() throws Exception { ArrayList proposals= collectCorrections(cu1, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface XXX {\n"); @@ -710,7 +710,7 @@ public void testTypeInSuperInterface() throws Exception { @Test public void testTypeInAnnotation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("@Xyz\n"); buf.append("public interface E {\n"); @@ -721,7 +721,7 @@ public void testTypeInAnnotation() throws Exception { ArrayList proposals= collectCorrections(cu1, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public @interface Xyz {\n"); @@ -735,7 +735,7 @@ public void testTypeInAnnotation() throws Exception { @Test public void testTypeInAnnotation_bug153881() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("a", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package a;\n"); buf.append("public class SomeClass {\n"); buf.append(" @scratch.Unimportant void foo() {}\n"); @@ -748,7 +748,7 @@ public void testTypeInAnnotation_bug153881() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package scratch;\n"); buf.append("\n"); buf.append("public @interface Unimportant {\n"); @@ -763,7 +763,7 @@ public void testTypeInAnnotation_bug153881() throws Exception { @Test public void testPrimitiveTypeInFieldDecl() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" floot vec= 1.0;\n"); @@ -774,28 +774,28 @@ public void testPrimitiveTypeInFieldDecl() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" double vec= 1.0;\n"); buf.append("}\n"); String expected1= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" Float vec= 1.0;\n"); buf.append("}\n"); String expected2= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" float vec= 1.0;\n"); buf.append("}\n"); String expected3= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class floot {\n"); @@ -803,7 +803,7 @@ public void testPrimitiveTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected4= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface floot {\n"); @@ -811,7 +811,7 @@ public void testPrimitiveTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected5= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum floot {\n"); @@ -819,7 +819,7 @@ public void testPrimitiveTypeInFieldDecl() throws Exception { buf.append("}\n"); String expected6= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" floot vec= 1.0;\n"); @@ -832,7 +832,7 @@ public void testPrimitiveTypeInFieldDecl() throws Exception { @Test public void testTypeInTypeArguments1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" class SomeType { }\n"); @@ -847,7 +847,7 @@ public void testTypeInTypeArguments1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[6]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" class SomeType { }\n"); @@ -857,7 +857,7 @@ public void testTypeInTypeArguments1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class XYX {\n"); @@ -865,7 +865,7 @@ public void testTypeInTypeArguments1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface XYX {\n"); @@ -873,7 +873,7 @@ public void testTypeInTypeArguments1() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum XYX {\n"); @@ -881,7 +881,7 @@ public void testTypeInTypeArguments1() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" class SomeType { }\n"); @@ -891,7 +891,7 @@ public void testTypeInTypeArguments1() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" class SomeType { }\n"); @@ -907,7 +907,7 @@ public void testTypeInTypeArguments1() throws Exception { @Test public void testTypeInTypeArguments2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -924,7 +924,7 @@ public void testTypeInTypeArguments2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[6]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -936,7 +936,7 @@ public void testTypeInTypeArguments2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test1.E.SomeType;\n"); @@ -946,7 +946,7 @@ public void testTypeInTypeArguments2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface XYX {\n"); @@ -954,7 +954,7 @@ public void testTypeInTypeArguments2() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum XYX {\n"); @@ -962,7 +962,7 @@ public void testTypeInTypeArguments2() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -974,7 +974,7 @@ public void testTypeInTypeArguments2() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -993,7 +993,7 @@ public void testTypeInTypeArguments2() throws Exception { @Test public void testParameterizedType1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -1009,7 +1009,7 @@ public void testParameterizedType1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class XXY {\n"); @@ -1017,7 +1017,7 @@ public void testParameterizedType1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface XXY {\n"); @@ -1031,7 +1031,7 @@ public void testParameterizedType1() throws Exception { @Test public void testParameterizedType2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -1052,7 +1052,7 @@ public void testParameterizedType2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[3]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Map;\n"); buf.append("public class E {\n"); @@ -1063,7 +1063,7 @@ public void testParameterizedType2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import test1.E.SomeType;\n"); @@ -1073,7 +1073,7 @@ public void testParameterizedType2() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface XXY {\n"); @@ -1087,28 +1087,28 @@ public void testParameterizedType2() throws Exception { private void createSomeAmbiguity(boolean ifc, boolean isException) throws Exception { IPackageFragment pack3= fSourceFolder.createPackageFragment("test3", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public "); buf.append(ifc ? "interface" : "class"); buf.append(" A "); buf.append(isException ? "extends Exception " : ""); buf.append("{\n"); buf.append("}\n"); pack3.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class B {\n"); buf.append("}\n"); pack3.createCompilationUnit("B.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public "); buf.append(ifc ? "interface" : "class"); buf.append(" A "); buf.append(isException ? "extends Exception " : ""); buf.append("{\n"); buf.append("}\n"); pack2.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class C {\n"); buf.append("}\n"); @@ -1122,7 +1122,7 @@ public void testAmbiguousTypeInSuperClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1140,7 +1140,7 @@ public void testAmbiguousTypeInSuperClass() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1154,7 +1154,7 @@ public void testAmbiguousTypeInSuperClass() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1174,7 +1174,7 @@ public void testAmbiguousTypeInInterface() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1192,7 +1192,7 @@ public void testAmbiguousTypeInInterface() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1206,7 +1206,7 @@ public void testAmbiguousTypeInInterface() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1226,7 +1226,7 @@ public void testAmbiguousTypeInField() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1245,7 +1245,7 @@ public void testAmbiguousTypeInField() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1260,7 +1260,7 @@ public void testAmbiguousTypeInField() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1281,7 +1281,7 @@ public void testAmbiguousTypeInArgument() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1301,7 +1301,7 @@ public void testAmbiguousTypeInArgument() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1317,7 +1317,7 @@ public void testAmbiguousTypeInArgument() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1339,7 +1339,7 @@ public void testAmbiguousTypeInReturnType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1360,7 +1360,7 @@ public void testAmbiguousTypeInReturnType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1377,7 +1377,7 @@ public void testAmbiguousTypeInReturnType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1400,7 +1400,7 @@ public void testAmbiguousTypeInExceptionType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1420,7 +1420,7 @@ public void testAmbiguousTypeInExceptionType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1436,7 +1436,7 @@ public void testAmbiguousTypeInExceptionType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1458,7 +1458,7 @@ public void testAmbiguousTypeInCatchBlock() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1481,7 +1481,7 @@ public void testAmbiguousTypeInCatchBlock() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test2.A;\n"); @@ -1500,7 +1500,7 @@ public void testAmbiguousTypeInCatchBlock() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test2.*;\n"); buf.append("import test3.*;\n"); @@ -1532,9 +1532,9 @@ public void testIndirectRefDefaultClass() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("class B {\n"); buf.append(" public Object get(Object c) {\n"); @@ -1543,7 +1543,7 @@ public void testIndirectRefDefaultClass() throws Exception { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("B.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class A {\n"); buf.append(" B b = new B();\n"); @@ -1553,7 +1553,7 @@ public void testIndirectRefDefaultClass() throws Exception { buf.append("}\n"); cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.A;\n"); buf.append("public class C {\n"); @@ -1568,7 +1568,7 @@ public void testIndirectRefDefaultClass() throws Exception { assertNumberOfProposals(proposals, 1); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class B {\n"); buf.append(" public Object get(Object c) {\n"); @@ -1583,7 +1583,7 @@ public void testIndirectRefDefaultClass() throws Exception { @Test public void testForEachMissingType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); @@ -1603,7 +1603,7 @@ public void testForEachMissingType() throws Exception { assertNumberOfProposals(proposals, 6); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.*;\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedVariablesQuickFixTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedVariablesQuickFixTest.java index e3d567ca919..0e1dcb1a13a 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedVariablesQuickFixTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/UnresolvedVariablesQuickFixTest.java @@ -88,7 +88,7 @@ public void tearDown() throws Exception { @Test public void testVarInAssignment() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -106,7 +106,7 @@ public void testVarInAssignment() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -122,7 +122,7 @@ public void testVarInAssignment() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -136,7 +136,7 @@ public void testVarInAssignment() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -150,7 +150,7 @@ public void testVarInAssignment() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -165,7 +165,7 @@ public void testVarInAssignment() throws Exception { @Test public void testVarAssingmentInIfBody() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -184,7 +184,7 @@ public void testVarAssingmentInIfBody() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -201,7 +201,7 @@ public void testVarAssingmentInIfBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -217,7 +217,7 @@ public void testVarAssingmentInIfBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -232,7 +232,7 @@ public void testVarAssingmentInIfBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -249,7 +249,7 @@ public void testVarAssingmentInIfBody() throws Exception { @Test public void testVarAssingmentInThenBody() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -269,7 +269,7 @@ public void testVarAssingmentInThenBody() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -287,7 +287,7 @@ public void testVarAssingmentInThenBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -304,7 +304,7 @@ public void testVarAssingmentInThenBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -320,7 +320,7 @@ public void testVarAssingmentInThenBody() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -338,7 +338,7 @@ public void testVarAssingmentInThenBody() throws Exception { @Test public void testVarInAssignmentWithGenerics() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -356,7 +356,7 @@ public void testVarInAssignmentWithGenerics() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -372,7 +372,7 @@ public void testVarInAssignmentWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -386,7 +386,7 @@ public void testVarInAssignmentWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -400,7 +400,7 @@ public void testVarInAssignmentWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -415,7 +415,7 @@ public void testVarInAssignmentWithGenerics() throws Exception { @Test public void testVarAssignedByWildcard1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -429,7 +429,7 @@ public void testVarAssignedByWildcard1() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -445,7 +445,7 @@ public void testVarAssignedByWildcard1() throws Exception { @Test public void testVarAssignedByWildcard2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -459,7 +459,7 @@ public void testVarAssignedByWildcard2() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -475,7 +475,7 @@ public void testVarAssignedByWildcard2() throws Exception { @Test public void testVarAssignedByWildcard3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -489,7 +489,7 @@ public void testVarAssignedByWildcard3() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -505,7 +505,7 @@ public void testVarAssignedByWildcard3() throws Exception { @Test public void testVarAssignedToWildcard1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -519,7 +519,7 @@ public void testVarAssignedToWildcard1() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -535,7 +535,7 @@ public void testVarAssignedToWildcard1() throws Exception { @Test public void testVarAssignedToWildcard2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -549,7 +549,7 @@ public void testVarAssignedToWildcard2() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -565,7 +565,7 @@ public void testVarAssignedToWildcard2() throws Exception { @Test public void testVarAssignedToWildcard3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -579,7 +579,7 @@ public void testVarAssignedToWildcard3() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -595,7 +595,7 @@ public void testVarAssignedToWildcard3() throws Exception { @Test public void testVarAssingmentInIfBodyWithGenerics() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -614,7 +614,7 @@ public void testVarAssingmentInIfBodyWithGenerics() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -631,7 +631,7 @@ public void testVarAssingmentInIfBodyWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -647,7 +647,7 @@ public void testVarAssingmentInIfBodyWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -662,7 +662,7 @@ public void testVarAssingmentInIfBodyWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -679,7 +679,7 @@ public void testVarAssingmentInIfBodyWithGenerics() throws Exception { @Test public void testVarAssingmentInThenBodyWithGenerics() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -699,7 +699,7 @@ public void testVarAssingmentInThenBodyWithGenerics() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -717,7 +717,7 @@ public void testVarAssingmentInThenBodyWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -734,7 +734,7 @@ public void testVarAssingmentInThenBodyWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Iterator;\n"); buf.append("import java.util.Vector;\n"); @@ -750,7 +750,7 @@ public void testVarAssingmentInThenBodyWithGenerics() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.Vector;\n"); buf.append("public class E {\n"); @@ -769,7 +769,7 @@ public void testVarAssingmentInThenBodyWithGenerics() throws Exception { @Test public void testVarInVarArgs1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public class E {\n"); @@ -786,7 +786,7 @@ public void testVarInVarArgs1() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public class E {\n"); @@ -798,7 +798,7 @@ public void testVarInVarArgs1() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public class E {\n"); @@ -810,7 +810,7 @@ public void testVarInVarArgs1() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public class E {\n"); @@ -820,7 +820,7 @@ public void testVarInVarArgs1() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.util.Arrays;\n"); buf.append("public class E {\n"); @@ -837,7 +837,7 @@ public void testVarInVarArgs1() throws Exception { @Test public void testVarInVarArgs2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.io.File;\n"); buf.append("import java.util.Arrays;\n"); @@ -854,7 +854,7 @@ public void testVarInVarArgs2() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[2]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("import java.io.File;\n"); buf.append("import java.util.Arrays;\n"); @@ -865,7 +865,7 @@ public void testVarInVarArgs2() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.io.File;\n"); @@ -881,7 +881,7 @@ public void testVarInVarArgs2() throws Exception { @Test public void testVarInForInitializer() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -899,7 +899,7 @@ public void testVarInForInitializer() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int i;\n"); @@ -914,7 +914,7 @@ public void testVarInForInitializer() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -927,7 +927,7 @@ public void testVarInForInitializer() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(int i) {\n"); @@ -943,7 +943,7 @@ public void testVarInForInitializer() throws Exception { @Test public void testVarInForInitializer2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -965,7 +965,7 @@ public void testVarInForInitializer2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int[] i;\n"); @@ -984,7 +984,7 @@ public void testVarInForInitializer2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -1001,7 +1001,7 @@ public void testVarInForInitializer2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" /**\n"); @@ -1023,7 +1023,7 @@ public void testVarInForInitializer2() throws Exception { @Test public void testVarInInitializer() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private int i= k;\n"); @@ -1038,7 +1038,7 @@ public void testVarInInitializer() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); @@ -1050,7 +1050,7 @@ public void testVarInInitializer() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static final int k = 0;\n"); @@ -1064,9 +1064,9 @@ public void testVarInInitializer() throws Exception { @Test public void testVarInOtherType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" void foo(E e) {\n"); @@ -1075,7 +1075,7 @@ public void testVarInOtherType() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" protected int var1;\n"); @@ -1090,7 +1090,7 @@ public void testVarInOtherType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); @@ -1102,7 +1102,7 @@ public void testVarInOtherType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" void foo(E e) {\n"); @@ -1118,9 +1118,9 @@ public void testVarInOtherType() throws Exception { @Test public void testVarInSuperFieldAccess() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F extends E {\n"); buf.append(" void foo() {\n"); @@ -1129,7 +1129,7 @@ public void testVarInSuperFieldAccess() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" protected int var1;\n"); @@ -1144,7 +1144,7 @@ public void testVarInSuperFieldAccess() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F extends E {\n"); buf.append(" void foo() {\n"); @@ -1156,7 +1156,7 @@ public void testVarInSuperFieldAccess() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" protected int var1;\n"); @@ -1169,10 +1169,10 @@ public void testVarInSuperFieldAccess() throws Exception { @Test public void testVarInSuper() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test3.E;\n"); buf.append("public class F extends E {\n"); @@ -1183,14 +1183,14 @@ public void testVarInSuper() throws Exception { ICompilationUnit cu1= pack1.createCompilationUnit("F.java", buf.toString(), false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("public class E {\n"); buf.append("}\n"); pack2.createCompilationUnit("E.java", buf.toString(), false, null); IPackageFragment pack3= fSourceFolder.createPackageFragment("test3", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" protected Object olor;\n"); @@ -1208,7 +1208,7 @@ public void testVarInSuper() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test3.E;\n"); buf.append("public class F extends E {\n"); @@ -1221,7 +1221,7 @@ public void testVarInSuper() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import test3.E;\n"); buf.append("public class F extends E {\n"); @@ -1240,9 +1240,9 @@ public void testVarInSuper() throws Exception { @Test public void testVarInAnonymous() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int fcount) {\n"); @@ -1263,7 +1263,7 @@ public void testVarInAnonymous() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int fcount) {\n"); @@ -1281,7 +1281,7 @@ public void testVarInAnonymous() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" protected int fCount;\n"); @@ -1299,7 +1299,7 @@ public void testVarInAnonymous() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int fcount) {\n"); @@ -1315,7 +1315,7 @@ public void testVarInAnonymous() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int fcount) {\n"); @@ -1331,7 +1331,7 @@ public void testVarInAnonymous() throws Exception { proposal= (CUCorrectionProposal) proposals.get(4); String preview5= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int fcount) {\n"); @@ -1347,7 +1347,7 @@ public void testVarInAnonymous() throws Exception { proposal= (CUCorrectionProposal) proposals.get(5); String preview6= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public void foo(int fcount) {\n"); @@ -1365,7 +1365,7 @@ public void testVarInAnonymous() throws Exception { @Test public void testVarInAnnotation1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1385,7 +1385,7 @@ public void testVarInAnnotation1() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1406,7 +1406,7 @@ public void testVarInAnnotation1() throws Exception { @Test public void testVarInAnnotation2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1426,7 +1426,7 @@ public void testVarInAnnotation2() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1447,7 +1447,7 @@ public void testVarInAnnotation2() throws Exception { @Test public void testVarInAnnotation3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1467,7 +1467,7 @@ public void testVarInAnnotation3() throws Exception { assertNumberOfProposals(proposals, 1); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class E {\n"); buf.append(" public @interface Annot {\n"); @@ -1491,7 +1491,7 @@ public void testStaticImportFavorite1() throws Exception { preferenceStore.setValue(PreferenceConstants.CODEASSIST_FAVORITE_STATIC_MEMBERS, "java.lang.Math.*"); try { IPackageFragment pack1= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -1507,7 +1507,7 @@ public void testStaticImportFavorite1() throws Exception { assertCorrectLabels(proposals); String[] expected= new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import static java.lang.Math.PI;\n"); @@ -1528,9 +1528,9 @@ public void testStaticImportFavorite1() throws Exception { @Test public void testLongVarRef() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public int mash;\n"); @@ -1540,7 +1540,7 @@ public void testLongVarRef() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public F var;\n"); @@ -1555,7 +1555,7 @@ public void testLongVarRef() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public int mash;\n"); @@ -1569,7 +1569,7 @@ public void testLongVarRef() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public int mash;\n"); @@ -1585,9 +1585,9 @@ public void testLongVarRef() throws Exception { @Test public void testVarAndTypeRef() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class F {\n"); @@ -1604,7 +1604,7 @@ public void testVarAndTypeRef() throws Exception { int i= 0; String[] expected= new String[proposals.size()]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class F {\n"); @@ -1617,7 +1617,7 @@ public void testVarAndTypeRef() throws Exception { expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class F {\n"); @@ -1628,7 +1628,7 @@ public void testVarAndTypeRef() throws Exception { buf.append("}\n"); expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class F {\n"); @@ -1638,7 +1638,7 @@ public void testVarAndTypeRef() throws Exception { buf.append("}\n"); expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class F {\n"); @@ -1650,7 +1650,7 @@ public void testVarAndTypeRef() throws Exception { buf.append("}\n"); expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class Fixe {\n"); @@ -1658,7 +1658,7 @@ public void testVarAndTypeRef() throws Exception { buf.append("}\n"); expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public interface Fixe {\n"); @@ -1666,7 +1666,7 @@ public void testVarAndTypeRef() throws Exception { buf.append("}\n"); expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public enum Fixe {\n"); @@ -1674,7 +1674,7 @@ public void testVarAndTypeRef() throws Exception { buf.append("}\n"); expected[i++]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.io.File;\n"); buf.append("public class F {\n"); @@ -1690,9 +1690,9 @@ public void testVarAndTypeRef() throws Exception { @Test public void testVarWithGenericType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class F {\n"); @@ -1702,7 +1702,7 @@ public void testVarWithGenericType() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" protected int var1;\n"); @@ -1717,7 +1717,7 @@ public void testVarWithGenericType() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); @@ -1732,7 +1732,7 @@ public void testVarWithGenericType() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class F {\n"); @@ -1750,10 +1750,10 @@ public void testVarWithGenericType() throws Exception { @Test public void testSimilarVariableNames1() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test3", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private static final short CON1= 1;\n"); @@ -1781,7 +1781,7 @@ public void testSimilarVariableNames1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private static final short CON1= 1;\n"); @@ -1797,7 +1797,7 @@ public void testSimilarVariableNames1() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private static final short CON1= 1;\n"); @@ -1815,10 +1815,10 @@ public void testSimilarVariableNames1() throws Exception { @Test public void testSimilarVariableNames2() throws Exception { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); IPackageFragment pack1= fSourceFolder.createPackageFragment("test3", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private static final short CON1= 1;\n"); @@ -1848,7 +1848,7 @@ public void testSimilarVariableNames2() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private static final short CON1= 1;\n"); @@ -1866,7 +1866,7 @@ public void testSimilarVariableNames2() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private static final short CON1= 1;\n"); @@ -1887,7 +1887,7 @@ public void testSimilarVariableNames2() throws Exception { @Test public void testSimilarVariableNamesMultipleOcc() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test3", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private int cout;\n"); @@ -1916,7 +1916,7 @@ public void testSimilarVariableNamesMultipleOcc() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test3;\n"); buf.append("public class E {\n"); buf.append(" private int cout;\n"); @@ -2024,7 +2024,7 @@ public void testUndeclaredObjectVariable() throws Exception { @Test public void testVarMultipleOccurences1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2048,7 +2048,7 @@ public void testVarMultipleOccurences1() throws Exception { assertNotNull(localProposal); String preview= getPreviewContent(localProposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2064,7 +2064,7 @@ public void testVarMultipleOccurences1() throws Exception { @Test public void testVarMultipleOccurences2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2089,7 +2089,7 @@ public void testVarMultipleOccurences2() throws Exception { assertNotNull(localProposal); String preview= getPreviewContent(localProposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2106,7 +2106,7 @@ public void testVarMultipleOccurences2() throws Exception { @Test public void testVarMultipleOccurences3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2131,7 +2131,7 @@ public void testVarMultipleOccurences3() throws Exception { assertNotNull(localProposal); String preview= getPreviewContent(localProposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo() {\n"); @@ -2149,7 +2149,7 @@ public void testVarMultipleOccurences3() throws Exception { @Test public void testVarInArray() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Object[] arr) {\n"); @@ -2167,7 +2167,7 @@ public void testVarInArray() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Object[] arr) {\n"); @@ -2183,14 +2183,14 @@ public void testVarInArray() throws Exception { @Test public void testVarInEnumSwitch() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public enum Colors {\n"); buf.append(" RED\n"); buf.append("}\n"); pack1.createCompilationUnit("Colors.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Colors c) {\n"); @@ -2209,7 +2209,7 @@ public void testVarInEnumSwitch() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public enum Colors {\n"); buf.append(" RED, BLUE\n"); @@ -2219,7 +2219,7 @@ public void testVarInEnumSwitch() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void foo(Colors c) {\n"); @@ -2236,7 +2236,7 @@ public void testVarInEnumSwitch() throws Exception { @Test public void testVarInMethodInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void goo(String s) {\n"); @@ -2255,7 +2255,7 @@ public void testVarInMethodInvocation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String x;\n"); @@ -2270,7 +2270,7 @@ public void testVarInMethodInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void goo(String s) {\n"); @@ -2284,7 +2284,7 @@ public void testVarInMethodInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" void goo(String s) {\n"); @@ -2299,7 +2299,7 @@ public void testVarInMethodInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static final String x = null;\n"); @@ -2317,7 +2317,7 @@ public void testVarInMethodInvocation() throws Exception { @Test public void testVarInConstructurInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(String s) {\n"); @@ -2336,7 +2336,7 @@ public void testVarInConstructurInvocation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static String x;\n"); @@ -2351,7 +2351,7 @@ public void testVarInConstructurInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(String s) {\n"); @@ -2365,7 +2365,7 @@ public void testVarInConstructurInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static final String x = null;\n"); @@ -2383,7 +2383,7 @@ public void testVarInConstructurInvocation() throws Exception { @Test public void testVarInSuperConstructurInvocation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(String s) {\n"); @@ -2391,7 +2391,7 @@ public void testVarInSuperConstructurInvocation() throws Exception { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E() {\n"); @@ -2408,7 +2408,7 @@ public void testVarInSuperConstructurInvocation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" private static String x;\n"); @@ -2422,7 +2422,7 @@ public void testVarInSuperConstructurInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" public E(String x) {\n"); @@ -2434,7 +2434,7 @@ public void testVarInSuperConstructurInvocation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E extends F {\n"); buf.append(" private static final String x = null;\n"); @@ -2451,7 +2451,7 @@ public void testVarInSuperConstructurInvocation() throws Exception { @Test public void testVarInClassInstanceCreation() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class F {\n"); buf.append(" public F(String s) {\n"); @@ -2459,7 +2459,7 @@ public void testVarInClassInstanceCreation() throws Exception { buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("F.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2476,7 +2476,7 @@ public void testVarInClassInstanceCreation() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private String x;\n"); @@ -2490,7 +2490,7 @@ public void testVarInClassInstanceCreation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(1); String preview2= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E(String x) {\n"); @@ -2502,7 +2502,7 @@ public void testVarInClassInstanceCreation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(2); String preview3= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" private static final String x = null;\n"); @@ -2516,7 +2516,7 @@ public void testVarInClassInstanceCreation() throws Exception { proposal= (CUCorrectionProposal) proposals.get(3); String preview4= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" public E() {\n"); @@ -2533,7 +2533,7 @@ public void testVarInClassInstanceCreation() throws Exception { public void testVarInArrayAccess() throws Exception { // bug 194913 IPackageFragment pack1= fSourceFolder.createPackageFragment("p", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2550,7 +2550,7 @@ public void testVarInArrayAccess() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2562,7 +2562,7 @@ public void testVarInArrayAccess() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2574,7 +2574,7 @@ public void testVarInArrayAccess() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2584,7 +2584,7 @@ public void testVarInArrayAccess() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package p;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2601,7 +2601,7 @@ public void testVarInArrayAccess() throws Exception { @Test public void testVarWithMethodName1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int foo(String str) {\n"); @@ -2619,7 +2619,7 @@ public void testVarWithMethodName1() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview1= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int foo(String str) {\n"); @@ -2635,7 +2635,7 @@ public void testVarWithMethodName1() throws Exception { @Test public void testVarWithMethodName2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int foo(String str) {\n"); @@ -2651,7 +2651,7 @@ public void testVarWithMethodName2() throws Exception { ArrayList proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class E {\n"); buf.append(" int foo(String str) {\n"); @@ -2669,7 +2669,7 @@ public void testVarWithMethodName2() throws Exception { @Test public void testSimilarVarsAndVisibility() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2689,7 +2689,7 @@ public void testSimilarVarsAndVisibility() throws Exception { assertNumberOfProposals(proposals, 6); String[] expected= new String[6]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2702,7 +2702,7 @@ public void testSimilarVarsAndVisibility() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2715,7 +2715,7 @@ public void testSimilarVarsAndVisibility() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2729,7 +2729,7 @@ public void testSimilarVarsAndVisibility() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2743,7 +2743,7 @@ public void testSimilarVarsAndVisibility() throws Exception { buf.append("}\n"); expected[3]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2756,7 +2756,7 @@ public void testSimilarVarsAndVisibility() throws Exception { buf.append("}\n"); expected[4]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2776,7 +2776,7 @@ public void testSimilarVarsAndVisibility() throws Exception { @Test public void testVarOfShadowedType() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2794,7 +2794,7 @@ public void testVarOfShadowedType() throws Exception { assertNumberOfProposals(proposals, 4); String[] expected= new String[4]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2806,7 +2806,7 @@ public void testVarOfShadowedType() throws Exception { buf.append("}\n"); expected[0]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2818,7 +2818,7 @@ public void testVarOfShadowedType() throws Exception { buf.append("}\n"); expected[1]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2829,7 +2829,7 @@ public void testVarOfShadowedType() throws Exception { buf.append("}\n"); expected[2]= buf.toString(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("public class E {\n"); @@ -2857,14 +2857,14 @@ public void testVarParameterAccess() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); IPackageFragment pack2= fSourceFolder.createPackageFragment("test2", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" protected int myField;\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("Base.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n"); buf.append("import test1.Base;\n"); buf.append("public class Child extends Base {\n"); @@ -2880,7 +2880,7 @@ public void testVarParameterAccess() throws Exception { assertNumberOfProposals(proposals, 2); String [] expected = new String[1]; - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class Base {\n"); buf.append(" public int myField;\n"); @@ -2893,9 +2893,9 @@ public void testVarParameterAccess() throws Exception { @Test public void testBug547404() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("import java.util.ArrayList;\n"); buf.append("public class Y {\n"); @@ -2905,7 +2905,7 @@ public void testBug547404() throws Exception { buf.append("}\n"); ICompilationUnit cu1= pack1.createCompilationUnit("Y.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" class ArrayList{}\n"); @@ -2920,7 +2920,7 @@ public void testBug547404() throws Exception { CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0); String preview= getPreviewContent(proposal); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("public class X {\n"); buf.append(" class ArrayList{}\n"); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTest.java index 06d7b04456e..195ed6421b9 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/search/NLSSearchTest.java @@ -110,7 +110,7 @@ public void test01() throws Exception { @Test public void test02() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -123,14 +123,14 @@ public void test02() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public String s1= Accessor.Client_s1;\n"); buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client_s1=s1\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -140,7 +140,7 @@ public void test02() throws Exception { @Test public void test03() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -153,14 +153,14 @@ public void test03() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public String s1= Accessor.Client_s1;\n"); buf.append("}\n"); ICompilationUnit client= pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); NLSSearchTestHelper.assertNumberOfProblems(accessor, propertiesFile, 2); @@ -172,7 +172,7 @@ public void test03() throws Exception { @Test public void test04() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -185,13 +185,13 @@ public void test04() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client_s1=foo\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -204,7 +204,7 @@ public void test04() throws Exception { @Test public void test05() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -217,13 +217,13 @@ public void test05() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); NLSSearchTestHelper.assertNumberOfProblems(accessor, propertiesFile, 2); @@ -235,7 +235,7 @@ public void test05() throws Exception { @Test public void test06() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -248,14 +248,14 @@ public void test06() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public String s1= Accessor.Client_s1;\n"); buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client_s1=s1\n"); buf.append("Client_s1=s1\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -268,7 +268,7 @@ public void test06() throws Exception { @Test public void testBug152604() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -281,14 +281,14 @@ public void testBug152604() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public int length= Accessor.Client_s1.length();\n"); buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client_s1=s1\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -298,7 +298,7 @@ public void testBug152604() throws Exception { @Test public void testBug133810() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import org.eclipse.osgi.util.NLS;\n"); buf.append("public class Accessor extends NLS {\n"); @@ -311,14 +311,14 @@ public void testBug133810() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public String s1= Accessor.Client_s1;\n"); buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client_s2=s1\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -337,7 +337,7 @@ public void testBug133810() throws Exception { @Test public void testBug185178() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -355,7 +355,7 @@ public void testBug185178() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public String s1= Accessor\n"); @@ -363,7 +363,7 @@ public void testBug185178() throws Exception { buf.append("}\n"); pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client.0=s1\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -373,7 +373,7 @@ public void testBug185178() throws Exception { @Test public void testBug247012_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -391,7 +391,7 @@ public void testBug247012_1() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" private static final String X =\"Main.indirect\";//$NON-NLS-1$ \n"); @@ -403,7 +403,7 @@ public void testBug247012_1() throws Exception { pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Main.direct=Main.direct\n"); buf.append("Main.indirect=Main.indirect\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -414,7 +414,7 @@ public void testBug247012_1() throws Exception { @Test public void testBug247012_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -432,7 +432,7 @@ public void testBug247012_2() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" private static final String X = Accessor.getString(\"Main.indirect\");//$NON-NLS-1$ \n"); @@ -444,7 +444,7 @@ public void testBug247012_2() throws Exception { pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Main.direct=Main.direct\n"); buf.append("Main.indirect=Main.indirect\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -455,7 +455,7 @@ public void testBug247012_2() throws Exception { @Test public void testBug247012_3() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -469,7 +469,7 @@ public void testBug247012_3() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" private static final int i = 10; \n"); @@ -480,7 +480,7 @@ public void testBug247012_3() throws Exception { pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); NLSSearchTestHelper.assertNumberOfProblems(accessor, propertiesFile, 0); @@ -489,7 +489,7 @@ public void testBug247012_3() throws Exception { @Test public void testBug247012_4() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -507,7 +507,7 @@ public void testBug247012_4() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public static void main(String[] args) { \n"); @@ -517,7 +517,7 @@ public void testBug247012_4() throws Exception { ICompilationUnit client= pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); NLSSearchTestHelper.assertNumberOfProblems(accessor, propertiesFile, 1); @@ -527,7 +527,7 @@ public void testBug247012_4() throws Exception { @Test public void testBug295040() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -548,7 +548,7 @@ public void testBug295040() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" public static void main(String[] args) { \n"); @@ -559,7 +559,7 @@ public void testBug295040() throws Exception { pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Client_s1=s1\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -569,7 +569,7 @@ public void testBug295040() throws Exception { @Test public void testBug306168_1() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -587,7 +587,7 @@ public void testBug306168_1() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" private static final String X =\"Main.indirect\";//$NON-NLS-1$ \n"); @@ -598,7 +598,7 @@ public void testBug306168_1() throws Exception { pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("Main.indirect=Main.indirect\n"); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); @@ -608,7 +608,7 @@ public void testBug306168_1() throws Exception { @Test public void testBug306168_2() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test;\n"); buf.append("import java.util.MissingResourceException;\n"); buf.append("import java.util.ResourceBundle;\n"); @@ -626,7 +626,7 @@ public void testBug306168_2() throws Exception { buf.append("}\n"); ICompilationUnit accessor= pack1.createCompilationUnit("Accessor.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test;\n"); buf.append("public class Client {\n"); buf.append(" private static final String X =\"Main.undefined\";//$NON-NLS-1$ \n"); @@ -637,7 +637,7 @@ public void testBug306168_2() throws Exception { pack1.createCompilationUnit("Client.java", buf.toString(), false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); IFile propertiesFile= write((IFolder)pack1.getCorrespondingResource(), buf.toString(), "Accessor.properties"); NLSSearchTestHelper.assertNumberOfProblems(accessor, propertiesFile, 1); diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/wizardapi/NewTypeWizardTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/wizardapi/NewTypeWizardTest.java index 789c9626f53..09223d73a70 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/wizardapi/NewTypeWizardTest.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/wizardapi/NewTypeWizardTest.java @@ -191,7 +191,7 @@ public void testCreateClass2() throws Exception { public void testCreateClass3() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public abstract void foo(T t);\n"); @@ -219,7 +219,7 @@ public void testCreateClass3() throws Exception { String actual= wizardPage.getCreatedType().getCompilationUnit().getSource(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/**\n"); buf.append(" * File\n"); buf.append(" */\n"); @@ -250,7 +250,7 @@ public void testCreateClass3() throws Exception { public void testCreateClass4() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public A(T t);\n"); @@ -278,7 +278,7 @@ public void testCreateClass4() throws Exception { String actual= wizardPage.getCreatedType().getCompilationUnit().getSource(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/**\n"); buf.append(" * File\n"); buf.append(" */\n"); @@ -316,7 +316,7 @@ public void testCreateClass4() throws Exception { public void testCreateInnerClass1() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public abstract void foo(T t);\n"); @@ -345,7 +345,7 @@ public void testCreateInnerClass1() throws Exception { String actual= wizardPage.getCreatedType().getCompilationUnit().getSource(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("\n"); buf.append("import java.util.ArrayList;\n"); @@ -420,7 +420,7 @@ public void testCreateClassExtraImports1() throws Exception { public void testCreateClassExtraImports2() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public static class Inner {\n"); @@ -454,7 +454,7 @@ public void testCreateClassExtraImports2() throws Exception { String actual= wizardPage.getCreatedType().getCompilationUnit().getSource(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("/**\n"); buf.append(" * File\n"); buf.append(" */\n"); @@ -486,7 +486,7 @@ public void testCreateClassExtraImports2() throws Exception { public void testCreateClassExtraImports3() throws Exception { IPackageFragment pack0= fSourceFolder.createPackageFragment("pack", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package pack;\n"); buf.append("public class A {\n"); buf.append(" public static class Inner {\n"); @@ -496,7 +496,7 @@ public void testCreateClassExtraImports3() throws Exception { pack0.createCompilationUnit("A.java", buf.toString(), false, null); IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); // an unused import: should not be touched @@ -525,7 +525,7 @@ public void testCreateClassExtraImports3() throws Exception { String actual= wizardPage.getCreatedType().getCompilationUnit().getSource(); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test1;\n"); buf.append("\n"); buf.append("import java.util.Map;\n"); @@ -771,7 +771,7 @@ public void testAttemptCreateExistingClass() throws Exception { // Foo1.java and Foo2.java in test1 IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); buf.append("package test1;\n\n"); buf.append("public class Foo1 {\n\n"); buf.append("}\n"); @@ -780,7 +780,7 @@ public void testAttemptCreateExistingClass() throws Exception // Foo3.java in test2 pack1= fSourceFolder.createPackageFragment("test2", false, null); - buf= new StringBuffer(); + buf= new StringBuilder(); buf.append("package test2;\n\n"); buf.append("public class Foo3 {\n\n"); buf.append("}\n"); diff --git a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java index fabd00558ef..d45ea6f2f0a 100644 --- a/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java +++ b/org.eclipse.ltk.core.refactoring.tests/src/org/eclipse/ltk/core/refactoring/tests/history/MockRefactoringDescriptor.java @@ -50,7 +50,7 @@ public Map getArguments() { @Override public String toString() { - final StringBuffer buffer= new StringBuffer(128); + final StringBuilder buffer= new StringBuilder(128); buffer.append(getClass().getName()); if (ID_UNKNOWN.equals(getID()))