From 1de7c8fc2a6ecb0fa08e6aa24bcc2f066cc8f1ef Mon Sep 17 00:00:00 2001 From: Hannes Wellmann Date: Fri, 20 Oct 2023 19:53:28 +0200 Subject: [PATCH] Apply "Convert StringBuffer to StringBuilder" to jdt-core(-tests) --- .../jdt/apt/core/internal/AptPlugin.java | 2 +- .../declaration/AnnotationValueImpl.java | 4 +- .../apt/pluggable/core/Apt6Plugin.java | 2 +- .../AnnotationProcessingCompilerToolTest.java | 2 +- .../Bug340635Proc.java | 2 +- .../tests/processors/base/XMLConverter.java | 4 +- .../elements/BaseElementProcessor.java | 6 +- .../elements/Java11ElementProcessor.java | 4 +- .../elements/Java12ElementProcessor.java | 4 +- .../elements/Java13ElementProcessor.java | 4 +- .../elements/Java8ElementProcessor.java | 6 +- .../elements/Java9ElementProcessor.java | 6 +- .../elements/Java9ModuleProcessor.java | 2 +- .../apt/tests/AnnotationProcessorTests.java | 6 +- .../compiler/apt/tests/BatchTestUtils.java | 4 +- .../jdt/compiler/apt/tests/ModelTests.java | 2 +- .../jdt/compiler/apt/tests/TestUtils.java | 2 +- .../tool/tests/AbstractCompilerToolTest.java | 2 +- .../tool/tests/CompilerToolJava9Tests.java | 2 +- .../tool/tests/CompilerToolTests.java | 2 +- .../apt/model/AnnotationValueImpl.java | 4 +- .../jdt/internal/compiler/ast/ASTNode.java | 10 +- .../ast/AbstractMethodDeclaration.java | 6 +- .../ast/AbstractVariableDeclaration.java | 4 +- .../compiler/ast/AllocationExpression.java | 2 +- .../jdt/internal/compiler/ast/Annotation.java | 6 +- .../ast/AnnotationMethodDeclaration.java | 2 +- .../jdt/internal/compiler/ast/Argument.java | 4 +- .../ast/ArrayAllocationExpression.java | 2 +- .../compiler/ast/ArrayInitializer.java | 2 +- .../ast/ArrayQualifiedTypeReference.java | 2 +- .../internal/compiler/ast/ArrayReference.java | 2 +- .../compiler/ast/ArrayTypeReference.java | 2 +- .../compiler/ast/AssertStatement.java | 2 +- .../jdt/internal/compiler/ast/Assignment.java | 8 +- .../compiler/ast/BinaryExpression.java | 2 +- .../jdt/internal/compiler/ast/Block.java | 4 +- .../internal/compiler/ast/BreakStatement.java | 2 +- .../internal/compiler/ast/CaseStatement.java | 2 +- .../internal/compiler/ast/CastExpression.java | 2 +- .../compiler/ast/ClassLiteralAccess.java | 2 +- .../jdt/internal/compiler/ast/Clinit.java | 2 +- .../ast/CombinedBinaryExpression.java | 4 +- .../ast/CompilationUnitDeclaration.java | 2 +- .../compiler/ast/CompoundAssignment.java | 2 +- .../compiler/ast/ConditionalExpression.java | 2 +- .../compiler/ast/ConstructorDeclaration.java | 2 +- .../compiler/ast/ContinueStatement.java | 2 +- .../internal/compiler/ast/DoStatement.java | 2 +- .../internal/compiler/ast/EmptyStatement.java | 2 +- .../compiler/ast/ExplicitConstructorCall.java | 2 +- .../compiler/ast/ExportsStatement.java | 2 +- .../jdt/internal/compiler/ast/Expression.java | 6 +- .../compiler/ast/ExtendedStringLiteral.java | 2 +- .../compiler/ast/FieldDeclaration.java | 4 +- .../internal/compiler/ast/FieldReference.java | 2 +- .../internal/compiler/ast/ForStatement.java | 2 +- .../compiler/ast/ForeachStatement.java | 2 +- .../internal/compiler/ast/GuardedPattern.java | 2 +- .../internal/compiler/ast/IfStatement.java | 2 +- .../compiler/ast/ImportReference.java | 4 +- .../internal/compiler/ast/Initializer.java | 2 +- .../compiler/ast/InstanceOfExpression.java | 2 +- .../ast/IntersectionCastTypeReference.java | 2 +- .../jdt/internal/compiler/ast/Javadoc.java | 2 +- .../ast/JavadocArgumentExpression.java | 2 +- .../compiler/ast/JavadocFieldReference.java | 2 +- .../ast/JavadocImplicitTypeReference.java | 4 +- .../compiler/ast/JavadocMessageSend.java | 2 +- .../compiler/ast/JavadocModuleReference.java | 2 +- .../compiler/ast/JavadocReturnStatement.java | 2 +- .../compiler/ast/LabeledStatement.java | 2 +- .../compiler/ast/LambdaExpression.java | 4 +- .../jdt/internal/compiler/ast/Literal.java | 2 +- .../compiler/ast/MemberValuePair.java | 2 +- .../internal/compiler/ast/MessageSend.java | 2 +- .../compiler/ast/MethodDeclaration.java | 2 +- .../compiler/ast/ModuleDeclaration.java | 6 +- .../compiler/ast/ModuleReference.java | 2 +- .../compiler/ast/NormalAnnotation.java | 2 +- .../internal/compiler/ast/OpensStatement.java | 2 +- .../compiler/ast/OperatorExpression.java | 4 +- .../ast/PackageVisibilityStatement.java | 2 +- .../ParameterizedQualifiedTypeReference.java | 2 +- .../ast/ParameterizedSingleTypeReference.java | 2 +- .../jdt/internal/compiler/ast/Pattern.java | 2 +- .../compiler/ast/PostfixExpression.java | 2 +- .../compiler/ast/PrefixExpression.java | 2 +- .../compiler/ast/ProvidesStatement.java | 2 +- .../ast/QualifiedAllocationExpression.java | 2 +- .../compiler/ast/QualifiedNameReference.java | 2 +- .../compiler/ast/QualifiedSuperReference.java | 2 +- .../compiler/ast/QualifiedThisReference.java | 2 +- .../compiler/ast/QualifiedTypeReference.java | 2 +- .../jdt/internal/compiler/ast/Receiver.java | 2 +- .../compiler/ast/RecordComponent.java | 4 +- .../internal/compiler/ast/RecordPattern.java | 2 +- .../compiler/ast/ReferenceExpression.java | 2 +- .../compiler/ast/RequiresStatement.java | 2 +- .../compiler/ast/ReturnStatement.java | 2 +- .../compiler/ast/SingleMemberAnnotation.java | 2 +- .../compiler/ast/SingleNameReference.java | 2 +- .../compiler/ast/SingleTypeReference.java | 2 +- .../jdt/internal/compiler/ast/Statement.java | 4 +- .../internal/compiler/ast/StringLiteral.java | 2 +- .../ast/StringLiteralConcatenation.java | 2 +- .../internal/compiler/ast/SuperReference.java | 2 +- .../compiler/ast/SwitchStatement.java | 4 +- .../compiler/ast/SynchronizedStatement.java | 2 +- .../internal/compiler/ast/ThisReference.java | 2 +- .../internal/compiler/ast/ThrowStatement.java | 2 +- .../internal/compiler/ast/TryStatement.java | 2 +- .../compiler/ast/TypeDeclaration.java | 8 +- .../internal/compiler/ast/TypeParameter.java | 2 +- .../internal/compiler/ast/TypePattern.java | 2 +- .../compiler/ast/UnaryExpression.java | 2 +- .../compiler/ast/UnionTypeReference.java | 2 +- .../internal/compiler/ast/UsesStatement.java | 2 +- .../internal/compiler/ast/WhileStatement.java | 2 +- .../jdt/internal/compiler/ast/Wildcard.java | 2 +- .../internal/compiler/ast/YieldStatement.java | 2 +- .../internal/compiler/batch/BasicModule.java | 4 +- .../jdt/internal/compiler/batch/Main.java | 4 +- .../classfmt/BinaryTypeFormatter.java | 4 +- .../compiler/classfmt/ClassFileReader.java | 2 +- .../classfmt/ComponentInfoWithAnnotation.java | 2 +- .../ComponentInfoWithTypeAnnotation.java | 2 +- .../internal/compiler/classfmt/FieldInfo.java | 4 +- .../classfmt/FieldInfoWithAnnotation.java | 2 +- .../classfmt/FieldInfoWithTypeAnnotation.java | 2 +- .../compiler/classfmt/MethodInfo.java | 6 +- .../compiler/classfmt/ModuleInfo.java | 8 +- .../classfmt/RecordComponentInfo.java | 4 +- .../compiler/codegen/StackMapFrame.java | 6 +- .../codegen/StackMapFrameCodeStream.java | 2 +- .../codegen/VerificationTypeInfo.java | 2 +- .../compiler/lookup/CaptureBinding.java | 2 +- .../lookup/ConstraintExceptionFormula.java | 2 +- .../lookup/ConstraintExpressionFormula.java | 2 +- .../compiler/lookup/ConstraintFormula.java | 2 +- .../lookup/ConstraintTypeFormula.java | 2 +- .../compiler/lookup/InferenceContext18.java | 2 +- .../compiler/lookup/LocalVariableBinding.java | 4 +- .../compiler/lookup/MethodBinding.java | 2 +- .../lookup/ParameterizedTypeBinding.java | 4 +- .../compiler/lookup/PolyTypeBinding.java | 6 +- .../compiler/lookup/ReferenceBinding.java | 6 +- .../lookup/SyntheticMethodBinding.java | 2 +- .../compiler/lookup/TypeVariableBinding.java | 4 +- .../compiler/lookup/VariableBinding.java | 2 +- .../compiler/lookup/WildcardBinding.java | 2 +- .../jdt/internal/compiler/parser/Parser.java | 2 +- .../compiler/parser/RecoveredAnnotation.java | 2 +- .../compiler/parser/RecoveredBlock.java | 2 +- .../compiler/parser/RecoveredField.java | 2 +- .../compiler/parser/RecoveredInitializer.java | 2 +- .../parser/RecoveredLocalVariable.java | 2 +- .../compiler/parser/RecoveredMethod.java | 2 +- .../compiler/parser/RecoveredStatement.java | 2 +- .../compiler/parser/RecoveredType.java | 2 +- .../compiler/parser/RecoveredUnit.java | 2 +- .../parser/diagnose/DiagnoseParser.java | 2 +- .../compiler/problem/AbortCompilation.java | 4 +- .../compiler/problem/ProblemReporter.java | 6 +- .../jdt/internal/compiler/tool/Util.java | 2 +- .../compiler/util/GenericXMLWriter.java | 4 +- .../util/HashtableOfObjectToIntArray.java | 2 +- .../compiler/util/ManifestAnalyzer.java | 4 +- .../jdt/internal/compiler/util/Util.java | 4 +- .../tools/unicode/CodePointsBuilder.java | 4 +- .../compiler/parser/SelectionJavadocTest.java | 4 +- .../parser/TypeAnnotationSyntaxTest.java | 2 +- .../compiler/regression/ASTImplTests.java | 2 +- .../regression/AbstractBatchCompilerTest.java | 4 +- .../regression/AbstractRegressionTest.java | 30 +-- .../regression/ClasspathJmodTests.java | 10 +- .../regression/CompilerInvocationTests.java | 8 +- .../regression/GenericTypeSignatureTest.java | 4 +- .../regression/JavadocTestForModule.java | 18 +- .../regression/ModuleCompilationTests.java | 196 +++++++++--------- .../NullReferenceImplTransformations.java | 16 +- .../compiler/regression/ScannerTest.java | 16 +- .../tests/compiler/regression/UtilTest.java | 6 +- .../eval/EvaluationContextWrapperTest.java | 2 +- .../core/tests/junit/extension/TestCase.java | 10 +- .../tests/runtime/StandardVMLauncher.java | 2 +- .../jdt/core/tests/util/TestVerifier.java | 16 +- .../org/eclipse/jdt/core/tests/util/Util.java | 2 +- .../tests/dom/ASTConverter15JLS4Test.java | 4 +- .../tests/dom/ASTConverter15JLS8Test.java | 4 +- .../core/tests/dom/ASTConverter15Test.java | 4 +- .../core/tests/dom/ASTConverter17Test.java | 2 +- .../tests/dom/ASTConverterBindingsTest.java | 2 +- .../dom/ASTConverterJavadocFlattener.java | 4 +- .../tests/dom/ASTConverterJavadocTest.java | 6 +- .../tests/dom/ASTConverterJavadocTest_15.java | 4 +- .../tests/dom/ASTConverterJavadocTest_18.java | 4 +- .../jdt/core/tests/dom/ASTConverterTest2.java | 2 +- .../jdt/core/tests/dom/ASTMatcherTest.java | 2 +- .../jdt/core/tests/dom/ASTVisitorTest.java | 2 +- .../jdt/core/tests/dom/AbstractASTTests.java | 6 +- .../core/tests/dom/ConverterTestSetup.java | 2 +- .../core/tests/dom/MarkedASTFlattener.java | 26 +-- .../tests/dom/ProfilingASTConvertionTest.java | 14 +- .../FormatterMassiveRegressionTests.java | 4 +- .../comment/CommentFormatterUtil.java | 6 +- .../tests/model/AbstractJavaModelTests.java | 20 +- .../model/AbstractJavaSearchGenericTests.java | 4 +- .../tests/model/AbstractJavaSearchTests.java | 8 +- .../jdt/core/tests/model/ClassFileTests.java | 6 +- .../model/ClasspathInitializerTests.java | 4 +- .../jdt/core/tests/model/ClasspathTests.java | 2 +- .../model/CompletionTestsRequestor2.java | 8 +- .../model/DefaultJavaElementComparator.java | 2 +- ...archGenericConstructorEquivalentTests.java | 2 +- ...avaSearchGenericConstructorExactTests.java | 2 +- .../JavaSearchGenericConstructorTests.java | 2 +- ...avaSearchGenericMethodEquivalentTests.java | 2 +- .../JavaSearchGenericMethodExactTests.java | 2 +- .../model/JavaSearchGenericMethodTests.java | 2 +- .../JavaSearchGenericTypeEquivalentTests.java | 2 +- .../JavaSearchGenericTypeExactTests.java | 2 +- .../model/JavaSearchGenericTypeTests.java | 2 +- .../tests/model/ModifyingResourceTests.java | 4 +- .../tests/model/RootManipulationsTests.java | 6 +- .../jdt/core/tests/model/SearchTests.java | 4 +- .../core/tests/model/TypeResolveTests.java | 14 +- .../performance/AllPerformanceTests.java | 14 +- .../FullSourceWorkspaceASTTests.java | 2 +- .../FullSourceWorkspaceBuildTests.java | 6 +- ...ullSourceWorkspaceCompleteSearchTests.java | 4 +- .../FullSourceWorkspaceModelTests.java | 8 +- .../performance/FullSourceWorkspaceTests.java | 8 +- .../tests/performance/util/Statistics.java | 8 +- .../internal/codeassist/CompletionEngine.java | 22 +- ...tNodeParentAnnotationArrayInitializer.java | 2 +- .../complete/CompletionJavadoc.java | 2 +- ...CompletionOnAnnotationMemberValuePair.java | 2 +- .../CompletionOnAnnotationOfType.java | 2 +- .../complete/CompletionOnArgumentName.java | 2 +- .../complete/CompletionOnBreakStatement.java | 2 +- .../CompletionOnClassLiteralAccess.java | 2 +- .../CompletionOnContinueStatement.java | 2 +- .../CompletionOnExplicitConstructorCall.java | 2 +- .../complete/CompletionOnExportReference.java | 2 +- .../complete/CompletionOnFieldName.java | 2 +- .../complete/CompletionOnFieldType.java | 2 +- .../complete/CompletionOnImportReference.java | 2 +- ...mpletionOnJavadocAllocationExpression.java | 2 +- .../CompletionOnJavadocFieldReference.java | 2 +- .../CompletionOnJavadocMessageSend.java | 2 +- .../CompletionOnJavadocModuleReference.java | 2 +- ...CompletionOnJavadocParamNameReference.java | 2 +- ...letionOnJavadocQualifiedTypeReference.java | 2 +- ...ompletionOnJavadocSingleTypeReference.java | 2 +- .../complete/CompletionOnJavadocTag.java | 2 +- ...CompletionOnJavadocTypeParamReference.java | 2 +- .../complete/CompletionOnKeyword1.java | 2 +- .../complete/CompletionOnKeyword2.java | 2 +- .../complete/CompletionOnKeyword3.java | 2 +- .../complete/CompletionOnLocalName.java | 4 +- .../complete/CompletionOnMemberAccess.java | 2 +- .../complete/CompletionOnMemberValueName.java | 2 +- .../complete/CompletionOnMessageSend.java | 2 +- .../complete/CompletionOnMessageSendName.java | 2 +- .../complete/CompletionOnMethodName.java | 2 +- .../CompletionOnMethodReturnType.java | 2 +- .../CompletionOnMethodTypeParameter.java | 2 +- .../complete/CompletionOnModuleReference.java | 2 +- .../CompletionOnPackageReference.java | 2 +- ...ompletionOnPackageVisibilityReference.java | 2 +- ...OnParameterizedQualifiedTypeReference.java | 2 +- ...letionOnQualifiedAllocationExpression.java | 2 +- .../CompletionOnQualifiedNameReference.java | 2 +- .../CompletionOnQualifiedTypeReference.java | 2 +- .../CompletionOnRecordComponentName.java | 2 +- .../CompletionOnReferenceExpressionName.java | 2 +- .../CompletionOnSingleNameReference.java | 2 +- .../CompletionOnSingleTypeReference.java | 2 +- .../complete/CompletionOnStringLiteral.java | 2 +- .../codeassist/complete/CompletionParser.java | 2 +- .../codeassist/impl/AssistSourceField.java | 2 +- .../codeassist/impl/AssistSourceMethod.java | 2 +- .../codeassist/impl/AssistSourceType.java | 2 +- .../codeassist/select/SelectionJavadoc.java | 2 +- .../select/SelectionOnArgumentName.java | 2 +- .../SelectionOnExplicitConstructorCall.java | 2 +- .../select/SelectionOnFieldReference.java | 2 +- .../select/SelectionOnFieldType.java | 2 +- .../select/SelectionOnImportReference.java | 2 +- .../select/SelectionOnLambdaExpression.java | 2 +- .../select/SelectionOnLocalName.java | 4 +- .../select/SelectionOnMessageSend.java | 2 +- .../select/SelectionOnModuleReference.java | 2 +- .../SelectionOnNameOfMemberValuePair.java | 2 +- .../select/SelectionOnPackageReference.java | 2 +- ...SelectionOnPackageVisibilityReference.java | 2 +- ...OnParameterizedQualifiedTypeReference.java | 2 +- ...ionOnParameterizedSingleTypeReference.java | 2 +- ...ectionOnQualifiedAllocationExpression.java | 2 +- .../SelectionOnQualifiedNameReference.java | 2 +- .../SelectionOnQualifiedSuperReference.java | 2 +- .../SelectionOnQualifiedTypeReference.java | 2 +- .../SelectionOnReferenceExpressionName.java | 2 +- .../SelectionOnSingleNameReference.java | 2 +- .../SelectionOnSingleTypeReference.java | 2 +- .../select/SelectionOnSuperReference.java | 2 +- .../codeassist/select/SelectionParser.java | 4 +- .../dom/org/eclipse/jdt/core/dom/ASTNode.java | 6 +- .../jdt/core/dom/CharacterLiteral.java | 2 +- .../jdt/core/dom/MemberValuePairBinding.java | 4 +- .../jdt/core/dom/ModuleQualifiedName.java | 2 +- .../dom/org/eclipse/jdt/core/dom/Name.java | 4 +- .../eclipse/jdt/core/dom/QualifiedName.java | 2 +- .../jdt/core/dom/RecoveredTypeBinding.java | 8 +- .../core/dom/RecoveredVariableBinding.java | 2 +- .../org/eclipse/jdt/core/dom/SimpleName.java | 2 +- .../eclipse/jdt/core/dom/StringLiteral.java | 2 +- .../org/eclipse/jdt/core/dom/TypeBinding.java | 22 +- .../internal/core/dom/NaiveASTFlattener.java | 4 +- .../core/dom/SourceRangeVerifier.java | 4 +- .../core/dom/rewrite/ASTRewriteAnalyzer.java | 4 +- .../core/dom/rewrite/ASTRewriteFlattener.java | 6 +- .../eval/CodeSnippetThisReference.java | 2 +- .../compiler/SourceElementParser.java | 2 +- .../jdt/internal/core/AbstractModule.java | 6 +- .../eclipse/jdt/internal/core/Annotation.java | 2 +- .../jdt/internal/core/BinaryField.java | 2 +- .../jdt/internal/core/BinaryMethod.java | 8 +- .../jdt/internal/core/BinaryModule.java | 4 +- .../internal/core/BinaryRecordComponent.java | 2 +- .../eclipse/jdt/internal/core/BinaryType.java | 10 +- .../internal/core/ClassFileWorkingCopy.java | 2 +- .../jdt/internal/core/ClasspathEntry.java | 6 +- .../jdt/internal/core/CompilationUnit.java | 2 +- .../core/ExternalPackageFragmentRoot.java | 2 +- .../jdt/internal/core/ImportContainer.java | 4 +- .../jdt/internal/core/ImportDeclaration.java | 6 +- .../jdt/internal/core/Initializer.java | 6 +- .../internal/core/JarPackageFragmentRoot.java | 2 +- .../jdt/internal/core/JavaElement.java | 28 +-- .../jdt/internal/core/JavaElementDelta.java | 4 +- .../eclipse/jdt/internal/core/JavaModel.java | 6 +- .../jdt/internal/core/JavadocContents.java | 2 +- .../internal/core/JrtPackageFragmentRoot.java | 2 +- .../jdt/internal/core/LambdaExpression.java | 8 +- .../jdt/internal/core/LambdaMethod.java | 4 +- .../jdt/internal/core/LocalVariable.java | 6 +- .../jdt/internal/core/ModularClassFile.java | 2 +- .../internal/core/ModuleDescriptionInfo.java | 4 +- .../jdt/internal/core/NamedMember.java | 8 +- .../jdt/internal/core/PackageDeclaration.java | 2 +- .../jdt/internal/core/PackageFragment.java | 6 +- .../internal/core/PackageFragmentRoot.java | 6 +- .../internal/core/ResolvedBinaryField.java | 2 +- .../internal/core/ResolvedBinaryMethod.java | 2 +- .../jdt/internal/core/ResolvedBinaryType.java | 2 +- .../core/ResolvedLambdaExpression.java | 2 +- .../internal/core/ResolvedSourceField.java | 2 +- .../internal/core/ResolvedSourceMethod.java | 2 +- .../jdt/internal/core/ResolvedSourceType.java | 2 +- .../jdt/internal/core/SimpleDelta.java | 6 +- .../jdt/internal/core/SourceField.java | 2 +- .../jdt/internal/core/SourceMapper.java | 14 +- .../jdt/internal/core/SourceMethod.java | 10 +- .../jdt/internal/core/SourceModule.java | 2 +- .../jdt/internal/core/SourceRefElement.java | 4 +- .../eclipse/jdt/internal/core/SourceType.java | 2 +- .../jdt/internal/core/TypeParameter.java | 2 +- .../core/hierarchy/HierarchyResolver.java | 2 +- .../core/hierarchy/TypeHierarchy.java | 6 +- .../core/util/DefaultBytecodeVisitor.java | 20 +- .../jdt/internal/core/util/Disassembler.java | 144 ++++++------- .../internal/core/util/KeyToSignature.java | 12 +- .../internal/core/util/MementoTokenizer.java | 4 +- .../internal/core/util/SimpleDocument.java | 4 +- .../eclipse/jdt/internal/core/util/Util.java | 34 +-- .../search/matching/ConstructorPattern.java | 2 +- .../core/search/matching/FieldPattern.java | 2 +- .../search/matching/JavaSearchPattern.java | 4 +- .../search/matching/LocalVariablePattern.java | 2 +- .../core/search/matching/MatchingNodeSet.java | 2 +- .../core/search/matching/MethodPattern.java | 2 +- .../core/search/matching/ModulePattern.java | 2 +- .../matching/MultiTypeDeclarationPattern.java | 2 +- .../matching/PackageDeclarationPattern.java | 2 +- .../matching/PackageReferencePattern.java | 2 +- .../QualifiedTypeDeclarationPattern.java | 2 +- .../SecondaryTypeDeclarationPattern.java | 2 +- .../matching/SuperTypeReferencePattern.java | 2 +- .../matching/TypeDeclarationPattern.java | 2 +- .../search/matching/TypeParameterPattern.java | 2 +- .../search/matching/TypeReferencePattern.java | 2 +- .../core/search/processing/JobManager.java | 2 +- 394 files changed, 900 insertions(+), 900 deletions(-) diff --git a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptPlugin.java b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptPlugin.java index 977385af2bc..0821010ab2c 100644 --- a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptPlugin.java +++ b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptPlugin.java @@ -196,7 +196,7 @@ public void optionsChanged(DebugOptions options) { public static void trace(final String msg){ if (DEBUG) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('['); // SimpleDateFormat is not thread-safe, according to javadoc synchronized(TRACE_DATE_FORMAT) { diff --git a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationValueImpl.java b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationValueImpl.java index 4d9663b6ea5..d3983120469 100644 --- a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationValueImpl.java +++ b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/declaration/AnnotationValueImpl.java @@ -208,7 +208,7 @@ public String toString() { return "null"; //$NON-NLS-1$ } else if (_value instanceof String) { String value = (String) _value; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('"'); for (int i = 0; i < value.length(); i++) { Util.appendEscapedChar(sb, value.charAt(i), true); @@ -216,7 +216,7 @@ public String toString() { sb.append('"'); return sb.toString(); } else if (_value instanceof Character) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('\''); Util.appendEscapedChar(sb, ((Character) _value).charValue(), false); sb.append('\''); diff --git a/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java b/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java index 45c9eaf89c8..3a998dc4aee 100644 --- a/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java +++ b/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java @@ -130,7 +130,7 @@ public static Status createInfoStatus(Throwable e, String message) { public static void trace(final String msg) { if (DEBUG) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('['); // SimpleDateFormat is not thread-safe, according to javadoc synchronized (TRACE_DATE_FORMAT) { diff --git a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationProcessingCompilerToolTest.java b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationProcessingCompilerToolTest.java index 233125dd401..a1cdab339eb 100644 --- a/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationProcessingCompilerToolTest.java +++ b/org.eclipse.jdt.apt.tests/src/org/eclipse/jdt/apt/tests/AnnotationProcessingCompilerToolTest.java @@ -123,7 +123,7 @@ public CompilerInvocationTestsArguments( } @Override public String toString() { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for (String option: this.options) { result.append(option); result.append(' '); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/AnnotationProcessorTests/Bug340635Proc.java b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/AnnotationProcessorTests/Bug340635Proc.java index fd1b00aadbe..524679353aa 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/AnnotationProcessorTests/Bug340635Proc.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/AnnotationProcessorTests/Bug340635Proc.java @@ -52,7 +52,7 @@ public boolean process(Set annotations, RoundEnvironment DeclaredType genericType = element.asType().accept(new GenericTypeVisitor(types), null); DeclaredType erasedType = (DeclaredType) types.erasure(genericType); - StringBuffer message = new StringBuffer(); + StringBuilder message = new StringBuilder(); message.append("Erased type: " + erasedType); message.append(" - type arguments: "); for (TypeMirror typeArgument : erasedType.getTypeArguments()) { diff --git a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/base/XMLConverter.java b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/base/XMLConverter.java index 60252614f90..283cc327d65 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/base/XMLConverter.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors/org/eclipse/jdt/compiler/apt/tests/processors/base/XMLConverter.java @@ -85,7 +85,7 @@ public static String xmlToString(Document model) { public static String xmlToCutAndPasteString(Document model, int indent, boolean shift) { String modelAsString = xmlToString(model); int length = modelAsString.length(); - StringBuffer buffer = new StringBuffer(length); + StringBuilder buffer = new StringBuilder(length); java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(modelAsString, "\n\r", true); for (int i = 0; i < indent; i++) buffer.append("\t"); if (shift) indent++; @@ -101,7 +101,7 @@ public static String xmlToCutAndPasteString(Document model, int indent, boolean } continue; } - StringBuffer tokenBuffer = new StringBuffer(); + StringBuilder tokenBuffer = new StringBuilder(); for (int i = 0; i < token.length(); i++){ char c = token.charAt(i); switch (c) { diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/BaseElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/BaseElementProcessor.java index 9596ea018c7..3d5cd5b6a8d 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/BaseElementProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/BaseElementProcessor.java @@ -125,7 +125,7 @@ public void reportError(String msg) { throw new AssertionFailedError(msg + " (Binary mode= " + isBinaryMode + ")"); } protected String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; @@ -217,7 +217,7 @@ static boolean equalsRegardingNull(Object expected, Object actual) { public void assertEquals(String msg, int expected, int actual) { if (expected != actual) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(msg); buf.append(", expected " + expected + " but was " + actual); reportError(buf.toString()); @@ -235,7 +235,7 @@ protected void verifyAnnotations(AnnotatedConstruct construct, String[] annots) protected String getAnnotationString(AnnotationMirror annot) { DeclaredType annotType = annot.getAnnotationType(); TypeElement type = (TypeElement) annotType.asElement(); - StringBuffer buf = new StringBuffer("@" + type.getSimpleName()); + StringBuilder buf = new StringBuilder("@" + type.getSimpleName()); Map values = annot.getElementValues(); Set keys = values.keySet(); buf.append('('); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java11ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java11ElementProcessor.java index ca4f767bd73..6f1d6ad7cc5 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java11ElementProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java11ElementProcessor.java @@ -152,7 +152,7 @@ public void reportError(String msg) { throw new AssertionFailedError(msg); } private String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; @@ -227,7 +227,7 @@ static boolean equalsRegardingNull(Object expected, Object actual) { public void assertEquals(String msg, int expected, int actual) { if (expected != actual) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(msg); buf.append(", expected " + expected + " but was " + actual); reportError(buf.toString()); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java12ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java12ElementProcessor.java index 7a80f35d402..d67ebfb555d 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java12ElementProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java12ElementProcessor.java @@ -346,7 +346,7 @@ public void reportError(String msg) { throw new AssertionFailedError(msg); } private String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; @@ -438,7 +438,7 @@ static boolean equalsRegardingNull(Object expected, Object actual) { public void assertEquals(String msg, int expected, int actual) { if (expected != actual) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(msg); buf.append(", expected " + expected + " but was " + actual); reportError(buf.toString()); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java13ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java13ElementProcessor.java index aa7b4adf4c9..5080eac9297 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java13ElementProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java13ElementProcessor.java @@ -141,7 +141,7 @@ public void reportError(String msg) { throw new AssertionFailedError(msg); } private String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; @@ -233,7 +233,7 @@ static boolean equalsRegardingNull(Object expected, Object actual) { public void assertEquals(String msg, int expected, int actual) { if (expected != actual) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(msg); buf.append(", expected " + expected + " but was " + actual); reportError(buf.toString()); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java index 81056d1ec7c..ea767424d95 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java8ElementProcessor.java @@ -1115,7 +1115,7 @@ private void createPackageBinary() throws IOException { } private String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; @@ -1147,7 +1147,7 @@ private void verifyAnnotations(AnnotatedConstruct construct, String[] annots, St private String getAnnotationString(AnnotationMirror annot) { DeclaredType annotType = annot.getAnnotationType(); TypeElement type = (TypeElement) annotType.asElement(); - StringBuffer buf = new StringBuffer("@" + type.getSimpleName()); + StringBuilder buf = new StringBuilder("@" + type.getSimpleName()); Map values = annot.getElementValues(); Set keys = values.keySet(); buf.append('('); @@ -1244,7 +1244,7 @@ static boolean equalsRegardingNull(Object expected, Object actual) { public void assertEquals(String msg, int expected, int actual) { if (expected != actual) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(msg); buf.append(", expected " + expected + " but was " + actual); reportError(buf.toString()); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java index c2453676add..0b71019ac14 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ElementProcessor.java @@ -1229,7 +1229,7 @@ public void reportError(String msg) { throw new AssertionFailedError(msg); } protected String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; @@ -1310,7 +1310,7 @@ static boolean equalsRegardingNull(Object expected, Object actual) { public void assertEquals(String msg, int expected, int actual) { if (expected != actual) { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); buf.append(msg); buf.append(", expected " + expected + " but was " + actual); reportError(buf.toString()); @@ -1333,7 +1333,7 @@ private void verifyAnnotations(AnnotatedConstruct construct, String[] annots) { private String getAnnotationString(AnnotationMirror annot) { DeclaredType annotType = annot.getAnnotationType(); TypeElement type = (TypeElement) annotType.asElement(); - StringBuffer buf = new StringBuffer("@" + type.getQualifiedName()); + StringBuilder buf = new StringBuilder("@" + type.getQualifiedName()); Map values = annot.getElementValues(); Set keys = values.keySet(); buf.append('('); diff --git a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ModuleProcessor.java b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ModuleProcessor.java index 68cd283ddee..5af25dd7541 100644 --- a/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ModuleProcessor.java +++ b/org.eclipse.jdt.compiler.apt.tests/processors8/org/eclipse/jdt/compiler/apt/tests/processors/elements/Java9ModuleProcessor.java @@ -117,7 +117,7 @@ public void reportError(String msg) { throw new AssertionFailedError(msg); } private String getExceptionStackTrace(Throwable t) { - StringBuffer buf = new StringBuffer(t.getMessage()); + StringBuilder buf = new StringBuilder(t.getMessage()); StackTraceElement[] traces = t.getStackTrace(); for (int i = 0; i < traces.length; i++) { StackTraceElement trace = traces[i]; diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/AnnotationProcessorTests.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/AnnotationProcessorTests.java index d8e8785ef83..a7babed7ad2 100644 --- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/AnnotationProcessorTests.java +++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/AnnotationProcessorTests.java @@ -32,11 +32,11 @@ public class AnnotationProcessorTests extends TestCase { public final class DiagnosticReport implements DiagnosticListener { public int count; - public StringBuffer buffer; + public StringBuilder buffer; private final List> warnings = new ArrayList<>(); DiagnosticReport() { this.count = 0; - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); } @Override public void report(Diagnostic diagnostic) { @@ -61,7 +61,7 @@ public String toString() { } public void clear() { this.count = 0; - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); } } diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java index 43b9ec73e86..3c44f1d69d1 100644 --- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java +++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/BatchTestUtils.java @@ -75,10 +75,10 @@ public class BatchTestUtils { private static File _tmpGenDir; public static final class DiagnosticReport implements DiagnosticListener { - public StringBuffer buffer; + public StringBuilder buffer; private final List> diagnostics = new ArrayList<>(); DiagnosticReport() { - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); } public void report(Diagnostic diagnostic) { diagnostics.add(diagnostic); diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/ModelTests.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/ModelTests.java index b50e0f847dc..51f04893e8e 100644 --- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/ModelTests.java +++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/ModelTests.java @@ -177,7 +177,7 @@ private void internalTest(JavaCompiler compiler, String processorClass, String e List options = new ArrayList(); options.add("-A" + processorClass); - final StringBuffer reported = new StringBuffer(); + final StringBuilder reported = new StringBuilder(); BatchTestUtils.compileTree(compiler, options, targetFolder, new DiagnosticListener () { @Override public void report(Diagnostic diag) { diff --git a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/TestUtils.java b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/TestUtils.java index 837b6b943c8..ef63c932747 100644 --- a/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/TestUtils.java +++ b/org.eclipse.jdt.compiler.apt.tests/src/org/eclipse/jdt/compiler/apt/tests/TestUtils.java @@ -39,7 +39,7 @@ public static File concatPath(String... names) { public static String convertToIndependentLineDelimiter(String source) { if (source.indexOf('\n') == -1 && source.indexOf('\r') == -1) return source; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, length = source.length(); i < length; i++) { char car = source.charAt(i); if (car == '\r') { diff --git a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/AbstractCompilerToolTest.java b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/AbstractCompilerToolTest.java index b3b2ff7541b..204ffd40238 100644 --- a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/AbstractCompilerToolTest.java +++ b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/AbstractCompilerToolTest.java @@ -49,7 +49,7 @@ static class CompilerInvocationTestsArguments { } @Override public String toString() { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for (String option: this.options) { result.append(option); result.append(' '); diff --git a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolJava9Tests.java b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolJava9Tests.java index 3e6a6fd0750..627cd46156a 100644 --- a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolJava9Tests.java +++ b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolJava9Tests.java @@ -1230,7 +1230,7 @@ public static byte[] read(java.io.File file) throws java.io.IOException { public static String convertToIndependentLineDelimiter(String source) { if (source.indexOf('\n') == -1 && source.indexOf('\r') == -1) return source; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, length = source.length(); i < length; i++) { char car = source.charAt(i); if (car == '\r') { diff --git a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java index e3d8b434cc0..60d7b1a6453 100644 --- a/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java +++ b/org.eclipse.jdt.compiler.tool.tests/src/org/eclipse/jdt/compiler/tool/tests/CompilerToolTests.java @@ -1354,7 +1354,7 @@ private static String normalized(String s) { public static String convertToIndependantLineDelimiter(String source) { if (source == null) return ""; if (source.indexOf('\n') == -1 && source.indexOf('\r') == -1) return source; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, length = source.length(); i < length; i++) { char car = source.charAt(i); if (car == '\r') { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java index d11e047d617..60d382e1f72 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/apt/model/AnnotationValueImpl.java @@ -266,7 +266,7 @@ public String toString() { return "null"; //$NON-NLS-1$ } else if (this._value instanceof String) { String value = (String) this._value; - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('"'); for (int i = 0; i < value.length(); i++) { Util.appendEscapedChar(sb, value.charAt(i), true); @@ -274,7 +274,7 @@ public String toString() { sb.append('"'); return sb.toString(); } else if (this._value instanceof Character) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); sb.append('\''); Util.appendEscapedChar(sb, ((Character) this._value).charValue(), false); sb.append('\''); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ASTNode.java index c91855bfaf2..5f07c7d5b8f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ASTNode.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ASTNode.java @@ -663,9 +663,9 @@ public boolean isType() { return false; } - public abstract StringBuffer print(int indent, StringBuffer output); + public abstract StringBuilder print(int indent, StringBuilder output); - public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output) { + public static StringBuilder printAnnotations(Annotation[] annotations, StringBuilder output) { int length = annotations.length; for (int i = 0; i < length; i++) { if (i > 0) { @@ -681,13 +681,13 @@ public static StringBuffer printAnnotations(Annotation[] annotations, StringBuff return output; } - public static StringBuffer printIndent(int indent, StringBuffer output) { + public static StringBuilder printIndent(int indent, StringBuilder output) { for (int i = indent; i > 0; i--) output.append(" "); //$NON-NLS-1$ return output; } - public static StringBuffer printModifiers(int modifiers, StringBuffer output) { + public static StringBuilder printModifiers(int modifiers, StringBuilder output) { if ((modifiers & ClassFileConstants.AccPublic) != 0) output.append("public "); //$NON-NLS-1$ @@ -1497,7 +1497,7 @@ public int sourceEnd() { @Override public String toString() { - return print(0, new StringBuffer(30)).toString(); + return print(0, new StringBuilder(30)).toString(); } public void traverse(ASTVisitor visitor, BlockScope scope) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java index 19a4f70834c..7a30651a14f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java @@ -493,7 +493,7 @@ public boolean isStatic() { public abstract void parseStatements(Parser parser, CompilationUnitDeclaration unit); @Override - public StringBuffer print(int tab, StringBuffer output) { + public StringBuilder print(int tab, StringBuilder output) { if (this.javadoc != null) { this.javadoc.print(tab, output); @@ -539,7 +539,7 @@ public StringBuffer print(int tab, StringBuffer output) { return output; } - public StringBuffer printBody(int indent, StringBuffer output) { + public StringBuilder printBody(int indent, StringBuilder output) { if (isAbstract() || (this.modifiers & ExtraCompilerModifiers.AccSemicolonBody) != 0) return output.append(';'); @@ -556,7 +556,7 @@ public StringBuffer printBody(int indent, StringBuffer output) { return output; } - public StringBuffer printReturnType(int indent, StringBuffer output) { + public StringBuilder printReturnType(int indent, StringBuilder output) { return output; } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java index e85cdfffec4..dff60fb0c35 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java @@ -87,7 +87,7 @@ public boolean isTypeAccess() { } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { printAsExpression(indent, output); switch(getKind()) { case ENUM_CONSTANT: @@ -97,7 +97,7 @@ public StringBuffer printStatement(int indent, StringBuffer output) { } } - public StringBuffer printAsExpression(int indent, StringBuffer output) { + public StringBuilder printAsExpression(int indent, StringBuilder output) { printIndent(indent, output); printModifiers(this.modifiers, output); if (this.annotations != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java index e7c62fd53dd..fd75cc8ac3a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java @@ -318,7 +318,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { if (this.type != null) { // type null for enum constant initializations output.append("new "); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Annotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Annotation.java index d7e186c0598..ccab636f432 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Annotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Annotation.java @@ -208,7 +208,7 @@ public boolean visit(ArrayAllocationExpression allocationExpression, BlockScope @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer .append("search location for ") //$NON-NLS-1$ .append(this.searchedAnnotation) @@ -679,7 +679,7 @@ private static void checkContainerAnnotationTypeTarget(ASTNode culpritNode, Scop if ((containerAnnotationTypeTargets & ~targets) != 0) { class MissingTargetBuilder { - StringBuffer targetBuffer = new StringBuffer(); + StringBuilder targetBuffer = new StringBuilder(); void check(long targetMask, char[] targetName) { if ((containerAnnotationTypeTargets & targetMask & ~targets) != 0) { // if targetMask equals TagBits.AnnotationForType implies @@ -814,7 +814,7 @@ public boolean isRuntimeVisible() { public abstract MemberValuePair[] memberValuePairs(); @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append('@'); this.type.printExpression(0, output); return output; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java index b75eae8a0b0..7644d64c86d 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java @@ -59,7 +59,7 @@ public void parseStatements(Parser parser, CompilationUnitDeclaration unit) { } @Override - public StringBuffer print(int tab, StringBuffer output) { + public StringBuilder print(int tab, StringBuilder output) { printIndent(tab, output); printModifiers(this.modifiers, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Argument.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Argument.java index 2d19f0957a9..5eaca0f0351 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Argument.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Argument.java @@ -179,7 +179,7 @@ public boolean hasNullTypeAnnotation(AnnotationPosition position) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); printModifiers(this.modifiers, output); @@ -197,7 +197,7 @@ public StringBuffer print(int indent, StringBuffer output) { } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { return print(indent, output).append(';'); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java index 2a298198f19..3a810d11773 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java @@ -97,7 +97,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolea @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append("new "); //$NON-NLS-1$ this.type.print(0, output); for (int i = 0; i < this.dimensions.length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java index dd48533ef69..abc8aa4a15d 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayInitializer.java @@ -142,7 +142,7 @@ public void generateCode(TypeReference typeReference, ArrayAllocationExpression } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append('{'); if (this.expressions != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java index 1fbbae8fdc7..4ff6b693bb2 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java @@ -128,7 +128,7 @@ protected TypeBinding internalResolveType(Scope scope, int location) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ super.printExpression(indent, output); if ((this.bits & IsVarArgs) != 0) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java index 5522eabe2fc..a5470eb9e64 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayReference.java @@ -196,7 +196,7 @@ public void generatePostIncrement(BlockScope currentScope, CodeStream codeStream } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { this.receiver.printExpression(0, output).append('['); return this.position.printExpression(0, output).append(']'); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java index 4f59a79ea5d..66e270b41dc 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ArrayTypeReference.java @@ -126,7 +126,7 @@ protected TypeBinding getTypeBinding(Scope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ super.printExpression(indent, output); if ((this.bits & IsVarArgs) != 0) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java index 87b5d8eeb1e..6c830cb3ce0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/AssertStatement.java @@ -211,7 +211,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f } @Override -public StringBuffer printStatement(int tab, StringBuffer output) { +public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output); output.append("assert "); //$NON-NLS-1$ this.assertExpression.printExpression(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Assignment.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Assignment.java index 4dfb485b6cc..730af102d2b 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Assignment.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Assignment.java @@ -170,25 +170,25 @@ public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) { } @Override -public StringBuffer print(int indent, StringBuffer output) { +public StringBuilder print(int indent, StringBuilder output) { //no () when used as a statement printIndent(indent, output); return printExpressionNoParenthesis(indent, output); } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { //subclass redefine printExpressionNoParenthesis() output.append('('); return printExpressionNoParenthesis(0, output).append(')'); } -public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { +public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { this.lhs.printExpression(indent, output).append(" = "); //$NON-NLS-1$ return this.expression.printExpression(0, output); } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { //no () when used as a statement return print(indent, output).append(';'); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java index f542b5601d1..6bade66e923 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BinaryExpression.java @@ -1819,7 +1819,7 @@ public void optimizedBooleanConstant(int leftId, int operator, int rightId) { } @Override -public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { +public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { // keep implementation in sync with // CombinedBinaryExpression#printExpressionNoParenthesis this.left.printExpression(indent, output).append(' ').append(operatorToString()).append(' '); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Block.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Block.java index fc8e826f852..948fef19ba6 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Block.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Block.java @@ -99,7 +99,7 @@ public boolean isEmptyBlock() { return this.statements == null; } -public StringBuffer printBody(int indent, StringBuffer output) { +public StringBuilder printBody(int indent, StringBuilder output) { if (this.statements == null) return output; for (int i = 0; i < this.statements.length; i++) { this.statements[i].printStatement(indent + 1, output); @@ -109,7 +109,7 @@ public StringBuffer printBody(int indent, StringBuffer output) { } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output); output.append("{\n"); //$NON-NLS-1$ printBody(indent, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java index 73f0914e174..7ae2388128c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java @@ -94,7 +94,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl } @Override -public StringBuffer printStatement(int tab, StringBuffer output) { +public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output).append("break"); //$NON-NLS-1$ if (this.label != null) output.append(' ').append(this.label); return output.append(';'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java index 0cc2325231d..aafec3b4138 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java @@ -132,7 +132,7 @@ public boolean containsPatternVariable() { return false; } @Override -public StringBuffer printStatement(int tab, StringBuffer output) { +public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output); if (this.constantExpressions == null) { output.append("default "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CastExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CastExpression.java index 7c6a978b669..c3df9589a38 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CastExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CastExpression.java @@ -593,7 +593,7 @@ public Constant optimizedBooleanConstant() { } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { int parenthesesCount = (this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; String suffix = ""; //$NON-NLS-1$ for(int i = 0; i < parenthesesCount; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java index 04d8f6e547e..909b66c2dc9 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ClassLiteralAccess.java @@ -73,7 +73,7 @@ public void generateCode( } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return this.type.print(0, output).append(".class"); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Clinit.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Clinit.java index 7320fd11f00..833e5a03b34 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Clinit.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Clinit.java @@ -383,7 +383,7 @@ public void parseStatements(Parser parser, CompilationUnitDeclaration unit) { } @Override - public StringBuffer print(int tab, StringBuffer output) { + public StringBuilder print(int tab, StringBuilder output) { printIndent(tab, output).append("()"); //$NON-NLS-1$ printBody(tab + 1, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.java index e46fa85b665..5431c0e5012 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CombinedBinaryExpression.java @@ -366,8 +366,8 @@ private void initArity(Expression expression, int value) { } @Override -public StringBuffer printExpressionNoParenthesis(int indent, - StringBuffer output) { +public StringBuilder printExpressionNoParenthesis(int indent, + StringBuilder output) { // keep implementation in sync with // BinaryExpression#printExpressionNoParenthesis and // OperatorExpression#printExpression diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java index b70f3ad2e5e..b35ae9ed9aa 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java @@ -488,7 +488,7 @@ public boolean hasErrors() { } @Override -public StringBuffer print(int indent, StringBuffer output) { +public StringBuilder print(int indent, StringBuilder output) { if (this.currentPackage != null) { printIndent(indent, output).append("package "); //$NON-NLS-1$ this.currentPackage.print(0, output, false).append(";\n"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java index e98fa2fbcf0..b390ca578a0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java @@ -121,7 +121,7 @@ public String operatorToString() { } @Override - public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { + public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { this.lhs.printExpression(indent, output).append(' ').append(operatorToString()).append(' '); return this.expression.printExpression(0, output) ; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java index 86a81e390ef..e673bdf149b 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConditionalExpression.java @@ -456,7 +456,7 @@ public Constant optimizedBooleanConstant() { } @Override - public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { + public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { this.condition.printExpression(indent, output).append(" ? "); //$NON-NLS-1$ this.valueIfTrue.printExpression(0, output).append(" : "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java index d675809c5c7..563d27a6758 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java @@ -600,7 +600,7 @@ public void parseStatements(Parser parser, CompilationUnitDeclaration unit) { } @Override -public StringBuffer printBody(int indent, StringBuffer output) { +public StringBuilder printBody(int indent, StringBuilder output) { output.append(" {"); //$NON-NLS-1$ if (this.constructorCall != null) { output.append('\n'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java index ff8d8956c09..d39b297b421 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ContinueStatement.java @@ -97,7 +97,7 @@ public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, Fl } @Override -public StringBuffer printStatement(int tab, StringBuffer output) { +public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output).append("continue "); //$NON-NLS-1$ if (this.label != null) output.append(this.label); return output.append(';'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/DoStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/DoStatement.java index 8bd10b46134..22a9626b743 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/DoStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/DoStatement.java @@ -213,7 +213,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output).append("do"); //$NON-NLS-1$ if (this.action == null) output.append(" ;\n"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.java index 6a67a4eb3d5..19762f3aac5 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/EmptyStatement.java @@ -49,7 +49,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream){ } @Override - public StringBuffer printStatement(int tab, StringBuffer output) { + public StringBuilder printStatement(int tab, StringBuilder output) { return printIndent(tab, output).append(';'); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java index 37bac3808f7..cbcbdf51ad9 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java @@ -270,7 +270,7 @@ public void manageSyntheticAccessIfNecessary(BlockScope currentScope, FlowInfo f } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output); if (this.qualification != null) this.qualification.printExpression(0, output).append('.'); if (this.typeArguments != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java index 932435caee0..ee83b1fd41a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExportsStatement.java @@ -24,7 +24,7 @@ public ExportsStatement(ImportReference pkgRef, ModuleReference[] targets) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); output.append("exports "); //$NON-NLS-1$ super.print(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java index f647d1ccfd1..1fad742508e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Expression.java @@ -1148,15 +1148,15 @@ public TypeBinding postConversionType(Scope scope) { } @Override -public StringBuffer print(int indent, StringBuffer output) { +public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); return printExpression(indent, output); } -public abstract StringBuffer printExpression(int indent, StringBuffer output); +public abstract StringBuilder printExpression(int indent, StringBuilder output); @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { return print(indent, output).append(";"); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java index 1a073006ebd..2c83770e54b 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExtendedStringLiteral.java @@ -72,7 +72,7 @@ public ExtendedStringLiteral extendWith(StringLiteral lit) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return output.append("ExtendedStringLiteral{").append(this.source).append('}'); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java index 714ef30c957..0ab3f851a13 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldDeclaration.java @@ -182,14 +182,14 @@ public boolean isFinal() { return (this.modifiers & ClassFileConstants.AccFinal) != 0; } @Override -public StringBuffer print(int indent, StringBuffer output) { +public StringBuilder print(int indent, StringBuilder output) { if (this.isARecordComponent) output.append("/* Implicit */"); //$NON-NLS-1$ return super.print(indent, output); } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { if (this.javadoc != null) { this.javadoc.print(indent, output); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldReference.java index 3fa15be4397..282c891b112 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/FieldReference.java @@ -645,7 +645,7 @@ public TypeBinding postConversionType(Scope scope) { } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { return this.receiver.printExpression(0, output).append('.').append(this.token); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForStatement.java index e1787c58675..9ef3d2a2325 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForStatement.java @@ -373,7 +373,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } @Override - public StringBuffer printStatement(int tab, StringBuffer output) { + public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output).append("for ("); //$NON-NLS-1$ //inits diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java index a7ea75bd4da..2d23fb918aa 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ForeachStatement.java @@ -465,7 +465,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output).append("for ("); //$NON-NLS-1$ if (this.pattern != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/GuardedPattern.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/GuardedPattern.java index 9106a4827d6..6db84d30b35 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/GuardedPattern.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/GuardedPattern.java @@ -172,7 +172,7 @@ public TypeBinding resolveAtType(BlockScope scope, TypeBinding u) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { this.primaryPattern.print(indent, output).append(" when "); //$NON-NLS-1$ return this.condition.print(indent, output); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IfStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IfStatement.java index d5af0e01b0e..f4f609da87f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IfStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IfStatement.java @@ -272,7 +272,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output).append("if ("); //$NON-NLS-1$ this.condition.printExpression(0, output).append(")\n"); //$NON-NLS-1$ this.thenStatement.printStatement(indent + 2, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ImportReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ImportReference.java index 07462bdad5f..09602ac51ce 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ImportReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ImportReference.java @@ -81,12 +81,12 @@ public void checkPackageConflict(CompilationUnitScope scope) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { return print(indent, output, true); } - public StringBuffer print(int tab, StringBuffer output, boolean withOnDemand) { + public StringBuilder print(int tab, StringBuilder output, boolean withOnDemand) { /* when withOnDemand is false, only the name is printed */ for (int i = 0; i < this.tokens.length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Initializer.java index 90cd2996e06..90c7e467423 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Initializer.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Initializer.java @@ -95,7 +95,7 @@ public void parseStatements( } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { if (this.modifiers != 0) { printIndent(indent, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java index db8e16d08f6..0cb159691b4 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java @@ -250,7 +250,7 @@ private void addAssignment(BlockScope currentScope, CodeStream codeStream, Local } @Override -public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { +public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { this.expression.printExpression(indent, output).append(" instanceof "); //$NON-NLS-1$ return this.pattern == null ? this.type.print(0, output) : this.pattern.printExpression(0, output); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java index 0f3676bb194..40dc3e7f22b 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/IntersectionCastTypeReference.java @@ -181,7 +181,7 @@ public void traverse(ASTVisitor visitor, ClassScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { int length = this.typeReferences == null ? 0 : this.typeReferences.length; printIndent(indent, output); for (int i = 0; i < length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Javadoc.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Javadoc.java index fef841670f2..8b16c46bb81 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Javadoc.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Javadoc.java @@ -177,7 +177,7 @@ public ASTNode getNodeStartingAt(int start) { * @see org.eclipse.jdt.internal.compiler.ast.ASTNode#print(int, java.lang.StringBuffer) */ @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output).append("/**\n"); //$NON-NLS-1$ if (this.paramReferences != null) { for (int i = 0, length = this.paramReferences.length; i < length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java index 87614976fa3..de95a42bffb 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java @@ -82,7 +82,7 @@ private TypeBinding internalResolveType(Scope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { if (this.argument == null) { if (this.token != null) { output.append(this.token); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java index d8e29ee3cf8..962f0bfedbd 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocFieldReference.java @@ -120,7 +120,7 @@ public boolean isSuperAccess() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { if (this.receiver != null) { this.receiver.printExpression(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java index 093658e0fd3..384916a2c9a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocImplicitTypeReference.java @@ -139,7 +139,7 @@ public void traverse(ASTVisitor visitor, ClassScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { - return new StringBuffer(); + public StringBuilder printExpression(int indent, StringBuilder output) { + return new StringBuilder(); } } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java index 4fdc64dc718..71cd1be4b83 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocMessageSend.java @@ -185,7 +185,7 @@ public boolean isSuperAccess() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ if (this.receiver != null) { this.receiver.printExpression(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java index 34800f5799a..8ca795f6596 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocModuleReference.java @@ -91,7 +91,7 @@ public void setModuleReference(ModuleReference moduleReference) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { if (this.moduleReference != null) { output.append(this.moduleReference.moduleName); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java index 9e3b0828ab1..36e18670736 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java @@ -42,7 +42,7 @@ public void resolve(BlockScope scope) { } @Override - public StringBuffer printStatement(int tab, StringBuffer output) { + public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output).append("return"); //$NON-NLS-1$ if ((this.bits & ASTNode.Empty) == 0) output.append(' ').append(" "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java index fa0b95186db..6facbe19cf7 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LabeledStatement.java @@ -120,7 +120,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } @Override - public StringBuffer printStatement(int tab, StringBuffer output) { + public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output).append(this.label).append(": "); //$NON-NLS-1$ if (this.statement == null) diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java index 3afbbf67ca4..355d51f8e4c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java @@ -745,11 +745,11 @@ public boolean isValueCompatible() { } @Override - public StringBuffer printExpression(int tab, StringBuffer output) { + public StringBuilder printExpression(int tab, StringBuilder output) { return printExpression(tab, output, false); } - public StringBuffer printExpression(int tab, StringBuffer output, boolean makeShort) { + public StringBuilder printExpression(int tab, StringBuilder output, boolean makeShort) { int parenthesesCount = (this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT; String suffix = ""; //$NON-NLS-1$ for(int i = 0; i < parenthesesCount; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Literal.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Literal.java index 0b07e127cde..97357678a31 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Literal.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Literal.java @@ -40,7 +40,7 @@ public FlowInfo analyseCode( public abstract TypeBinding literalType(BlockScope scope); @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ return output.append(source()); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java index 3a7bb060db8..b1693b8428b 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java @@ -52,7 +52,7 @@ public MemberValuePair(char[] token, int sourceStart, int sourceEnd, Expression } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { output .append(this.name) .append(" = "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MessageSend.java index eed0f2d854d..efcd93f8b45 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MessageSend.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MessageSend.java @@ -701,7 +701,7 @@ public TypeBinding postConversionType(Scope scope) { } @Override -public StringBuffer printExpression(int indent, StringBuffer output){ +public StringBuilder printExpression(int indent, StringBuilder output){ if (!this.receiver.isImplicitThis()) this.receiver.printExpression(0, output).append('.'); if (this.typeArguments != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java index 49ef2ab2c58..17288ac9b64 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java @@ -253,7 +253,7 @@ public void parseStatements(Parser parser, CompilationUnitDeclaration unit) { } @Override - public StringBuffer printReturnType(int indent, StringBuffer output) { + public StringBuilder printReturnType(int indent, StringBuilder output) { if (this.returnType == null) return output; return this.returnType.printExpression(0, output).append(' '); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java index b6a089d65b2..dfec8d22bcf 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleDeclaration.java @@ -360,7 +360,7 @@ public void traverse(ASTVisitor visitor, CompilationUnitScope unitScope) { visitor.visit(this, unitScope); } - public StringBuffer printHeader(int indent, StringBuffer output) { + public StringBuilder printHeader(int indent, StringBuilder output) { if (this.annotations != null) { for (int i = 0; i < this.annotations.length; i++) { this.annotations[i].print(indent, output); @@ -376,7 +376,7 @@ public StringBuffer printHeader(int indent, StringBuffer output) { output.append(CharOperation.charToString(this.moduleName)); return output; } - public StringBuffer printBody(int indent, StringBuffer output) { + public StringBuilder printBody(int indent, StringBuilder output) { output.append(" {"); //$NON-NLS-1$ if (this.requires != null) { for(int i = 0; i < this.requiresCount; i++) { @@ -414,7 +414,7 @@ public StringBuffer printBody(int indent, StringBuffer output) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { // printIndent(indent, output); printHeader(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java index c8ebf645c12..419f57b48ab 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ModuleReference.java @@ -33,7 +33,7 @@ public ModuleReference(char[][] tokens, long[] sourcePositions) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { for (int i = 0; i < this.tokens.length; i++) { if (i > 0) output.append('.'); output.append(this.tokens[i]); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java index 8362d6eb86b..e1a8a7dbf41 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/NormalAnnotation.java @@ -49,7 +49,7 @@ public MemberValuePair[] memberValuePairs() { return this.memberValuePairs == null ? NoValuePairs : this.memberValuePairs; } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { super.printExpression(indent, output); output.append('('); if (this.memberValuePairs != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OpensStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OpensStatement.java index e1da2b772bd..65601675786 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OpensStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OpensStatement.java @@ -34,7 +34,7 @@ public int computeSeverity(int problemId) { } } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); output.append("opens "); //$NON-NLS-1$ super.print(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java index 52b56dbe073..50aea3494ab 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/OperatorExpression.java @@ -1568,11 +1568,11 @@ public String operatorToString() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ output.append('('); return printExpressionNoParenthesis(0, output).append(')'); } - public abstract StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output); + public abstract StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java index ca132c9b531..96adb6e559f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PackageVisibilityStatement.java @@ -71,7 +71,7 @@ protected PlainPackageBinding resolvePackageReference(Scope scope) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { this.pkgRef.print(indent, output); if (this.isQualified()) { output.append(" to "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java index 186a523a66e..87569e09e0f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedQualifiedTypeReference.java @@ -394,7 +394,7 @@ private void createArrayType(Scope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { int length = this.tokens.length; for (int i = 0; i < length - 1; i++) { if (this.annotations != null && this.annotations[i] != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java index 839bb3d8931..dc9ae7c2f7c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ParameterizedSingleTypeReference.java @@ -339,7 +339,7 @@ private TypeBinding createArrayType(Scope scope, TypeBinding type) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ if (this.annotations != null && this.annotations[0] != null) { printAnnotations(this.annotations[0], output); output.append(' '); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Pattern.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Pattern.java index edc9e839d48..eed3625c380 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Pattern.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Pattern.java @@ -133,7 +133,7 @@ public Pattern primary() { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { return this.printExpression(indent, output); } } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java index 8e2153996c4..8fcee0f1b16 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PostfixExpression.java @@ -61,7 +61,7 @@ public String operatorToString() { } @Override -public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { +public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { return this.lhs.printExpression(indent, output).append(' ').append(operatorToString()); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java index 3ad6f433114..1702d9c86df 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/PrefixExpression.java @@ -45,7 +45,7 @@ public String operatorToString() { } @Override -public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { +public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { output.append(operatorToString()).append(' '); return this.lhs.printExpression(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java index 20eae5c1c71..6cf87c94510 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ProvidesStatement.java @@ -118,7 +118,7 @@ public List getResolvedImplementations() { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); output.append("provides "); //$NON-NLS-1$ this.serviceInterface.print(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java index 3014f1e67fd..2599122b2bb 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java @@ -285,7 +285,7 @@ public void manageEnclosingInstanceAccessIfNecessary(BlockScope currentScope, Fl } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { if (this.enclosingInstance != null) this.enclosingInstance.printExpression(0, output).append('.'); super.printExpression(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java index ce56b7d6b38..2794a583beb 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedNameReference.java @@ -993,7 +993,7 @@ public TypeBinding postConversionType(Scope scope) { } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { for (int i = 0; i < this.tokens.length; i++) { if (i > 0) output.append('.'); output.append(this.tokens[i]); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java index 286fe919150..aadd723d930 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedSuperReference.java @@ -49,7 +49,7 @@ public boolean isThis() { } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { return this.qualification.print(0, output).append(".super"); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java index 37e193dd93f..2edde0af6f2 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedThisReference.java @@ -151,7 +151,7 @@ int findCompatibleEnclosing(ReferenceBinding enclosingType, TypeBinding type, Bl } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return this.qualification.print(0, output).append(".this"); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java index 856fe9c3deb..f6db1827fa5 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java @@ -203,7 +203,7 @@ public char[][] getTypeName(){ } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { for (int i = 0; i < this.tokens.length; i++) { if (i > 0) output.append('.'); if (this.annotations != null && this.annotations[i] != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Receiver.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Receiver.java index 73988869138..0ad7b94e4b3 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Receiver.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Receiver.java @@ -26,7 +26,7 @@ public boolean isReceiver() { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); printModifiers(this.modifiers, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java index bc910fd34cc..eab24c571a0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordComponent.java @@ -130,7 +130,7 @@ void validateNullAnnotations(BlockScope scope) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); printModifiers(this.modifiers, output); @@ -148,7 +148,7 @@ public StringBuffer print(int indent, StringBuffer output) { } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { return print(indent, output).append(';'); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java index 78eebf39fb5..1cd993b7498 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RecordPattern.java @@ -423,7 +423,7 @@ else if (this.type != null) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append(this.type).append('('); if (this.patterns != null) { for (int i = 0; i < this.patterns.length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java index bf21f48d2d0..755aea79b56 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java @@ -1097,7 +1097,7 @@ public void setFieldIndex(int depth) { } @Override - public StringBuffer printExpression(int tab, StringBuffer output) { + public StringBuilder printExpression(int tab, StringBuilder output) { this.lhs.print(0, output); output.append("::"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java index ea1b95d4628..3e5090c04f9 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/RequiresStatement.java @@ -35,7 +35,7 @@ public boolean isStatic() { return (this.modifiers & ClassFileConstants.ACC_STATIC_PHASE) != 0; } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { output.append("requires "); //$NON-NLS-1$ if (isTransitive()) output.append("transitive "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java index 3512e9c145f..fc57449d7a0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ReturnStatement.java @@ -282,7 +282,7 @@ public void prepareSaveValueLocation(TryStatement targetTryStatement){ } @Override -public StringBuffer printStatement(int tab, StringBuffer output){ +public StringBuilder printStatement(int tab, StringBuilder output){ printIndent(tab, output).append("return "); //$NON-NLS-1$ if (this.expression != null ) this.expression.printExpression(0, output) ; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java index 19369242886..649140aea10 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleMemberAnnotation.java @@ -56,7 +56,7 @@ public MemberValuePair[] memberValuePairs() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { super.printExpression(indent, output); output.append('('); this.memberValue.printExpression(indent, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java index 397a3d168bd..dc5a0048e26 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleNameReference.java @@ -995,7 +995,7 @@ public TypeBinding postConversionType(Scope scope) { } @Override -public StringBuffer printExpression(int indent, StringBuffer output){ +public StringBuilder printExpression(int indent, StringBuilder output){ return output.append(this.token); } public TypeBinding reportError(BlockScope scope) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java index a251e726ed5..f2fe2e72a5f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SingleTypeReference.java @@ -98,7 +98,7 @@ public boolean isBaseTypeReference() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ if (this.annotations != null && this.annotations[0] != null) { printAnnotations(this.annotations[0], output); output.append(' '); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Statement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Statement.java index 34295834c2b..d259eb6fdca 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Statement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Statement.java @@ -478,11 +478,11 @@ public boolean isValidJavaStatement() { } @Override -public StringBuffer print(int indent, StringBuffer output) { +public StringBuilder print(int indent, StringBuilder output) { return printStatement(indent, output); } -public abstract StringBuffer printStatement(int indent, StringBuffer output); +public abstract StringBuilder printStatement(int indent, StringBuilder output); public abstract void resolve(BlockScope scope); public LocalVariableBinding[] getPatternVariablesWhenTrue() { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java index 4043e44022e..f8867283078 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteral.java @@ -80,7 +80,7 @@ public TypeBinding literalType(BlockScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { // handle some special char..... output.append('\"'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.java index e53b34ce452..6e199b86a9d 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/StringLiteralConcatenation.java @@ -60,7 +60,7 @@ public StringLiteralConcatenation extendsWith(StringLiteral lit) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append("StringLiteralConcatenation{"); //$NON-NLS-1$ for (int i = 0, max = this.counter; i < max; i++) { this.literals[i].printExpression(indent, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SuperReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SuperReference.java index 8aaf7a2f918..2c96e4498f8 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SuperReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SuperReference.java @@ -57,7 +57,7 @@ public boolean isThis() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ return output.append("super"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java index 66e08a1ce5a..5e644a9f5f4 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SwitchStatement.java @@ -1048,7 +1048,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream, boolean generateCode(currentScope, codeStream); // redirecting to statement part } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output).append("switch ("); //$NON-NLS-1$ this.expression.printExpression(0, output).append(") {"); //$NON-NLS-1$ @@ -1736,7 +1736,7 @@ public boolean continueCompletes() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return printStatement(indent, output); } } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java index 9800b69234b..7c6e78bbbd1 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/SynchronizedStatement.java @@ -216,7 +216,7 @@ public void resolve(BlockScope upperScope) { } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output); output.append("synchronized ("); //$NON-NLS-1$ this.expression.printExpression(0, output).append(')'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThisReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThisReference.java index 6aa7a597a60..20e08d0bafc 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThisReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThisReference.java @@ -121,7 +121,7 @@ public int nullStatus(FlowInfo flowInfo, FlowContext flowContext) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ if (isImplicitThis()) return output; return output.append("this"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java index bc41e37119c..bfa0da9ba7a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ThrowStatement.java @@ -66,7 +66,7 @@ public void generateCode(BlockScope currentScope, CodeStream codeStream) { } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output).append("throw "); //$NON-NLS-1$ this.exception.printExpression(0, output); return output.append(';'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TryStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TryStatement.java index 6aab623916e..36c13baa6e3 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TryStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TryStatement.java @@ -1076,7 +1076,7 @@ public boolean isSubRoutineEscaping() { } @Override -public StringBuffer printStatement(int indent, StringBuffer output) { +public StringBuilder printStatement(int indent, StringBuilder output) { int length = this.resources.length; printIndent(indent, output).append("try" + (length == 0 ? "\n" : " (")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ for (int i = 0; i < length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java index 20d670ee1ea..4161f22dfe9 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java @@ -1163,7 +1163,7 @@ public void parseMethods(Parser parser, CompilationUnitDeclaration unit) { } @Override -public StringBuffer print(int indent, StringBuffer output) { +public StringBuilder print(int indent, StringBuilder output) { if (this.javadoc != null) { this.javadoc.print(indent, output); } @@ -1174,7 +1174,7 @@ public StringBuffer print(int indent, StringBuffer output) { return printBody(indent, output); } -public StringBuffer printBody(int indent, StringBuffer output) { +public StringBuilder printBody(int indent, StringBuilder output) { output.append(" {"); //$NON-NLS-1$ if (this.memberTypes != null) { for (int i = 0; i < this.memberTypes.length; i++) { @@ -1204,7 +1204,7 @@ public StringBuffer printBody(int indent, StringBuffer output) { return printIndent(indent, output).append('}'); } -public StringBuffer printHeader(int indent, StringBuffer output) { +public StringBuilder printHeader(int indent, StringBuilder output) { printModifiers(this.modifiers, output); if (this.annotations != null) { printAnnotations(this.annotations, output); @@ -1282,7 +1282,7 @@ public StringBuffer printHeader(int indent, StringBuffer output) { } @Override -public StringBuffer printStatement(int tab, StringBuffer output) { +public StringBuilder printStatement(int tab, StringBuilder output) { return print(tab, output); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java index 64daa059f17..90643141d55 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypeParameter.java @@ -180,7 +180,7 @@ public void resolveAnnotations(Scope scope) { } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { if (this.annotations != null) { printAnnotations(this.annotations, output); output.append(' '); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java index 03de8444c59..bbf3f090b7a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/TypePattern.java @@ -284,7 +284,7 @@ public void traverse(ASTVisitor visitor, BlockScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return this.local != null ? this.local.printAsExpression(indent, output) : output; } } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java index 46fd40dba2e..113c6d75a27 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnaryExpression.java @@ -219,7 +219,7 @@ public void generateOptimizedBoolean( } @Override - public StringBuffer printExpressionNoParenthesis(int indent, StringBuffer output) { + public StringBuilder printExpressionNoParenthesis(int indent, StringBuilder output) { output.append(operatorToString()).append(' '); return this.expression.printExpression(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java index cb9b2e838a7..cfe054c7963 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UnionTypeReference.java @@ -131,7 +131,7 @@ public void traverse(ASTVisitor visitor, ClassScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { int length = this.typeReferences == null ? 0 : this.typeReferences.length; printIndent(indent, output); for (int i = 0; i < length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UsesStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UsesStatement.java index 22ea27cbb60..edd2ebc3895 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UsesStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/UsesStatement.java @@ -21,7 +21,7 @@ public UsesStatement(TypeReference serviceInterface) { this.serviceInterface = serviceInterface; } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); output.append("uses "); //$NON-NLS-1$ this.serviceInterface.print(0, output); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java index f816d5ad6fd..d1c6cf2088d 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/WhileStatement.java @@ -302,7 +302,7 @@ public boolean containsPatternVariable() { } @Override - public StringBuffer printStatement(int tab, StringBuffer output) { + public StringBuilder printStatement(int tab, StringBuilder output) { printIndent(tab, output).append("while ("); //$NON-NLS-1$ this.condition.printExpression(0, output).append(')'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Wildcard.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Wildcard.java index 15caa6a312f..2f2915df4c7 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Wildcard.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/Wildcard.java @@ -88,7 +88,7 @@ private TypeBinding internalResolveType(Scope scope, ReferenceBinding genericTyp } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ if (this.annotations != null && this.annotations[0] != null) { printAnnotations(this.annotations[0], output); output.append(' '); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java index 10be0b1e617..8ab652191c3 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/YieldStatement.java @@ -255,7 +255,7 @@ public TypeBinding resolveExpressionType(BlockScope scope1) { } @Override -public StringBuffer printStatement(int tab, StringBuffer output) { +public StringBuilder printStatement(int tab, StringBuilder output) { if (!this.isImplicit) printIndent(tab, output).append("yield"); //$NON-NLS-1$ if (this.expression != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/BasicModule.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/BasicModule.java index d879914c51e..caf7748bb4a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/BasicModule.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/BasicModule.java @@ -209,11 +209,11 @@ public int hashCode() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); toStringContent(buffer); return buffer.toString(); } - protected void toStringContent(StringBuffer buffer) { + protected void toStringContent(StringBuilder buffer) { buffer.append("\nmodule "); //$NON-NLS-1$ buffer.append(this.name).append(' '); buffer.append('{').append('\n'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/Main.java index 08d80ee3a14..1331fe14f6e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/Main.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/batch/Main.java @@ -407,7 +407,7 @@ private void extractContext(CategorizedProblem problem, char[] unitSource) { while ((c = unitSource[end]) == ' ' || c == '\t') end--; // copy source - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(unitSource, begin, end - begin + 1); HashMap parameters = new HashMap<>(); parameters.put(Logger.VALUE, String.valueOf(buffer)); @@ -3264,7 +3264,7 @@ private static String getAllEncodings(Set encodings) { String[] allEncodings = new String[size]; encodings.toArray(allEncodings); Arrays.sort(allEncodings); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0; i < size; i++) { if (i > 0) { buffer.append(", "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/BinaryTypeFormatter.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/BinaryTypeFormatter.java index 5751b215cc3..85e54b3fba9 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/BinaryTypeFormatter.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/BinaryTypeFormatter.java @@ -75,12 +75,12 @@ public static String annotationToString(IBinaryTypeAnnotation typeAnnotation) { } public static String methodToString(IBinaryMethod method) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); methodToStringContent(result, method); return result.toString(); } - public static void methodToStringContent(StringBuffer buffer, IBinaryMethod method) { + public static void methodToStringContent(StringBuilder buffer, IBinaryMethod method) { int modifiers = method.getModifiers(); char[] desc = method.getGenericSignature(); if (desc == null) diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java index 0af97034f86..95397b0130c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ClassFileReader.java @@ -677,7 +677,7 @@ public char[] getEnclosingMethod() { } if (this.enclosingMethod == null) { // read the name - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); int nameAndTypeOffset = this.constantPoolOffsets[this.enclosingNameAndTypeIndex]; int utf8Offset = this.constantPoolOffsets[u2At(nameAndTypeOffset + 1)]; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java index 8baf2efb371..b17de909431 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithAnnotation.java @@ -46,7 +46,7 @@ protected void reset() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); if (this.annotations != null) { buffer.append('\n'); for (int i = 0; i < this.annotations.length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java index 290c5bb6ae8..028f7dcb051 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ComponentInfoWithTypeAnnotation.java @@ -40,7 +40,7 @@ protected void reset() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); if (this.typeAnnotations != null) { buffer.append('\n'); buffer.append("type annotations:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java index 3237d28fad6..6f0d5930589 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfo.java @@ -425,11 +425,11 @@ public void throwFormatException() throws ClassFormatException { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); toStringContent(buffer); return buffer.toString(); } -protected void toStringContent(StringBuffer buffer) { +protected void toStringContent(StringBuilder buffer) { int modifiers = getModifiers(); buffer .append('{') diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java index 0875834ae05..da246037bdc 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithAnnotation.java @@ -52,7 +52,7 @@ protected void reset() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); if (this.annotations != null) { buffer.append('\n'); for (int i = 0; i < this.annotations.length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.java index a3927cbadc0..a713557d0f1 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/FieldInfoWithTypeAnnotation.java @@ -42,7 +42,7 @@ protected void reset() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); if (this.typeAnnotations != null) { buffer.append('\n'); buffer.append("type annotations:"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java index 2c4bb07f6aa..707b9a5507e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/MethodInfo.java @@ -450,15 +450,15 @@ public int sizeInBytes() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); toString(buffer); return buffer.toString(); } -void toString(StringBuffer buffer) { +void toString(StringBuilder buffer) { buffer.append(getClass().getName()); toStringContent(buffer); } -protected void toStringContent(StringBuffer buffer) { +protected void toStringContent(StringBuilder buffer) { BinaryTypeFormatter.methodToStringContent(buffer, this); } private synchronized void readCodeAttribute() { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java index 75943283c12..7eb09702c62 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/ModuleInfo.java @@ -316,11 +316,11 @@ public char[][] targets() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); toStringContent(buffer); return buffer.toString(); } - protected void toStringContent(StringBuffer buffer) { + protected void toStringContent(StringBuilder buffer) { buffer.append(this.packageName); if (this.exportedToCount > 0) { buffer.append(" to "); //$NON-NLS-1$ @@ -367,11 +367,11 @@ public int hashCode() { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); toStringContent(buffer); return buffer.toString(); } - protected void toStringContent(StringBuffer buffer) { + protected void toStringContent(StringBuilder buffer) { buffer.append("\nmodule "); //$NON-NLS-1$ buffer.append(this.name).append(' '); buffer.append('{').append('\n'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java index b15c6aeab9c..7a35dec800d 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/classfmt/RecordComponentInfo.java @@ -253,11 +253,11 @@ public void throwFormatException() throws ClassFormatException { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); toStringContent(buffer); return buffer.toString(); } -protected void toStringContent(StringBuffer buffer) { +protected void toStringContent(StringBuilder buffer) { buffer .append('{') .append(getTypeName()) diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.java index a0fc8e25b3d..c26bdd6019e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrame.java @@ -323,12 +323,12 @@ public int getOffsetDelta(StackMapFrame prevFrame) { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); printFrame(buffer, this); return String.valueOf(buffer); } - private void printFrame(StringBuffer buffer, StackMapFrame frame) { + private void printFrame(StringBuilder buffer, StackMapFrame frame) { String pattern = "[pc : {0} locals: {1} stack items: {2}\nlocals: {3}\nstack: {4}\n]"; //$NON-NLS-1$ int localsLength = frame.locals == null ? 0 : frame.locals.length; buffer.append(MessageFormat.format(pattern, @@ -338,7 +338,7 @@ private void printFrame(StringBuffer buffer, StackMapFrame frame) { } private String print(VerificationTypeInfo[] infos, int length) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append('['); if (infos != null) { for (int i = 0; i < length; i++) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java index 9b9c691686f..ed29f9929ad 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java @@ -72,7 +72,7 @@ public int hashCode() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append('(').append(this.pc).append(',').append(this.binding.constantPoolName()).append(')'); return String.valueOf(buffer); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java index c2e2244d2cb..b837667b1de 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/codegen/VerificationTypeInfo.java @@ -152,7 +152,7 @@ public int id() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); switch (this.tag) { case VerificationTypeInfo.ITEM_UNINITIALIZED_THIS: buffer.append("uninitialized_this(").append(readableName()).append(")"); //$NON-NLS-1$//$NON-NLS-2$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java index e872dea4ba3..fd4858d2a78 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding.java @@ -440,7 +440,7 @@ public char[] shortReadableName() { @Override public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) { - StringBuffer nameBuffer = new StringBuffer(10); + StringBuilder nameBuffer = new StringBuilder(10); appendNullAnnotation(nameBuffer, options); nameBuffer.append(this.sourceName()); if (!this.inRecursiveFunction) { // CaptureBinding18 can be recursive indeed diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java index 13a3d2f0ec1..d799906421c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExceptionFormula.java @@ -158,7 +158,7 @@ Collection inputVariables(final InferenceContext18 context) { @Override public String toString() { - StringBuffer buf = new StringBuffer().append(LEFT_ANGLE_BRACKET); + StringBuilder buf = new StringBuilder().append(LEFT_ANGLE_BRACKET); this.left.printExpression(4, buf); buf.append(" \u2286throws "); //$NON-NLS-1$ appendTypeName(buf, this.right); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java index 489091fe75c..adfb15a1238 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintExpressionFormula.java @@ -557,7 +557,7 @@ Collection inputVariables(final InferenceContext18 context) { // debugging: @Override public String toString() { - StringBuffer buf = new StringBuffer().append(LEFT_ANGLE_BRACKET); + StringBuilder buf = new StringBuilder().append(LEFT_ANGLE_BRACKET); this.left.printExpression(4, buf); buf.append(relationToString(this.relation)); appendTypeName(buf, this.right); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java index bb2359561aa..7639e9197f0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintFormula.java @@ -59,7 +59,7 @@ public boolean applySubstitution(BoundSet solutionSet, InferenceVariable[] varia } // for debug toString(): - protected void appendTypeName(StringBuffer buf, TypeBinding type) { + protected void appendTypeName(StringBuilder buf, TypeBinding type) { if (type instanceof CaptureBinding18) buf.append(type.toString()); // contains more info than readable name else diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java index 33fa2bbca0b..f2fa61b6017 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ConstraintTypeFormula.java @@ -424,7 +424,7 @@ public boolean applySubstitution(BoundSet solutionSet, InferenceVariable[] varia // debugging @Override public String toString() { - StringBuffer buf = new StringBuffer("Type Constraint:\n"); //$NON-NLS-1$ + StringBuilder buf = new StringBuilder("Type Constraint:\n"); //$NON-NLS-1$ buf.append('\t').append(LEFT_ANGLE_BRACKET); appendTypeName(buf, this.left); buf.append(relationToString(this.relation)); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java index cabdc8d52b5..231c4dc4957 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/InferenceContext18.java @@ -1976,7 +1976,7 @@ public ReferenceBinding inferRecordPatternParameterization( return null; // should not happen. // 1.If T is not downcast convertible (5.5) to the raw type R, inference fails. Expression synthExpr = new Expression() { - @Override public StringBuffer printExpression(int indent, StringBuffer output) { + @Override public StringBuilder printExpression(int indent, StringBuilder output) { return output; } }; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java index bc8d686de00..fbe66e1c482 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/LocalVariableBinding.java @@ -101,7 +101,7 @@ public final int kind() { */ @Override public char[] computeUniqueKey(boolean isLeaf) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); // declaring method or type BlockScope scope = this.declaringScope; @@ -212,7 +212,7 @@ public AnnotationBinding[] getAnnotations() { return sourceType.retrieveAnnotations(this); } - private void getScopeKey(BlockScope scope, StringBuffer buffer) { + private void getScopeKey(BlockScope scope, StringBuilder buffer) { int scopeIndex = scope.scopeIndex(); if (scopeIndex != -1) { getScopeKey((BlockScope)scope.parent, buffer); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java index 8003ebfd136..953f81590df 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java @@ -1310,7 +1310,7 @@ public MethodBinding tiebreakMethod() { } @Override public String toString() { - StringBuffer output = new StringBuffer(10); + StringBuilder output = new StringBuilder(10); if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) != 0) { output.append("[unresolved] "); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java index 7de8255db04..6b8b64af21c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ParameterizedTypeBinding.java @@ -1385,7 +1385,7 @@ public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNa @Override char[] nullAnnotatedReadableName(CompilerOptions options) { - StringBuffer nameBuffer = new StringBuffer(10); + StringBuilder nameBuffer = new StringBuilder(10); if (isMemberType()) { nameBuffer.append(enclosingType().nullAnnotatedReadableName(options, false)); nameBuffer.append('.'); @@ -1424,7 +1424,7 @@ char[] nullAnnotatedReadableName(CompilerOptions options) { @Override char[] nullAnnotatedShortReadableName(CompilerOptions options) { - StringBuffer nameBuffer = new StringBuffer(10); + StringBuilder nameBuffer = new StringBuilder(10); if (isMemberType()) { nameBuffer.append(enclosingType().nullAnnotatedReadableName(options, true)); nameBuffer.append('.'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java index dfe3acec75e..13d4382d16a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/PolyTypeBinding.java @@ -70,13 +70,13 @@ public char[] sourceName() { @Override public char[] readableName() { - return this.expression.printExpression(0, new StringBuffer()).toString().toCharArray(); + return this.expression.printExpression(0, new StringBuilder()).toString().toCharArray(); } @Override public char[] shortReadableName() { return this.expression instanceof LambdaExpression ? - ((LambdaExpression) this.expression).printExpression(0, new StringBuffer(), true).toString().toCharArray() : readableName(); + ((LambdaExpression) this.expression).printExpression(0, new StringBuilder(), true).toString().toCharArray() : readableName(); } @Override @@ -86,7 +86,7 @@ public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) { @Override public String toString() { - StringBuffer buffer = new StringBuffer("PolyTypeBinding for: "); //$NON-NLS-1$ + StringBuilder buffer = new StringBuilder("PolyTypeBinding for: "); //$NON-NLS-1$ return this.expression.printExpression(0, buffer).toString(); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java index 6053dc0c4dd..7d9beae05eb 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java @@ -1869,7 +1869,7 @@ public char[] readableName(boolean showGenerics) /*java.lang.Object, p.X */ return readableName; } -protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { +protected void appendNullAnnotation(StringBuilder nameBuffer, CompilerOptions options) { if (options.isAnnotationBasedNullAnalysisEnabled) { if (options.usesNullTypeAnnotations()) { for (AnnotationBinding annotation : this.typeAnnotations) { @@ -1924,7 +1924,7 @@ public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNa } char[] nullAnnotatedReadableName(CompilerOptions options) { - StringBuffer nameBuffer = new StringBuffer(10); + StringBuilder nameBuffer = new StringBuilder(10); if (isMemberType()) { nameBuffer.append(enclosingType().nullAnnotatedReadableName(options, false)); nameBuffer.append('.'); @@ -1963,7 +1963,7 @@ char[] nullAnnotatedReadableName(CompilerOptions options) { } char[] nullAnnotatedShortReadableName(CompilerOptions options) { - StringBuffer nameBuffer = new StringBuffer(10); + StringBuilder nameBuffer = new StringBuilder(10); if (isMemberType()) { nameBuffer.append(enclosingType().nullAnnotatedReadableName(options, true)); nameBuffer.append('.'); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java index 5f582e80627..1d84f3b61b2 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/SyntheticMethodBinding.java @@ -329,7 +329,7 @@ public SyntheticMethodBinding(SourceTypeBinding declaringClass) { public SyntheticMethodBinding(SourceTypeBinding declaringEnum, int startIndex, int endIndex) { this.declaringClass = declaringEnum; this.index = nextSmbIndex(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(TypeConstants.SYNTHETIC_ENUM_CONSTANT_INITIALIZATION_METHOD_PREFIX).append(this.index); this.selector = String.valueOf(buffer).toCharArray(); this.modifiers = ClassFileConstants.AccPrivate | ClassFileConstants.AccStatic; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java index 0c8c7e48c88..692b14d81ee 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java @@ -901,7 +901,7 @@ public String toString() { @Override public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) { - StringBuffer nameBuffer = new StringBuffer(10); + StringBuilder nameBuffer = new StringBuilder(10); appendNullAnnotation(nameBuffer, options); nameBuffer.append(this.sourceName()); if (!this.inRecursiveFunction) { @@ -932,7 +932,7 @@ public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNa } @Override - protected void appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options) { + protected void appendNullAnnotation(StringBuilder nameBuffer, CompilerOptions options) { int oldSize = nameBuffer.length(); super.appendNullAnnotation(nameBuffer, options); if (oldSize == nameBuffer.length()) { // nothing appended in super.appendNullAnnotation()? diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java index f24410637ee..6a2f05f236a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/VariableBinding.java @@ -94,7 +94,7 @@ public void setConstant(Constant constant) { } @Override public String toString() { - StringBuffer output = new StringBuffer(10); + StringBuilder output = new StringBuilder(10); ASTNode.printModifiers(this.modifiers, output); if ((this.modifiers & ExtraCompilerModifiers.AccUnresolved) != 0) { output.append("[unresolved] "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java index eefed9a1572..859fd866cd0 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/lookup/WildcardBinding.java @@ -799,7 +799,7 @@ public char[] readableName() { @Override public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) { - StringBuffer buffer = new StringBuffer(10); + StringBuilder buffer = new StringBuilder(10); appendNullAnnotation(buffer, options); switch (this.boundKind) { case Wildcard.UNBOUND : diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java index ca9d80d17e6..f65e5585afb 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/Parser.java @@ -334,7 +334,7 @@ private static void buildFileForReadableName( for (int i = 0; i < tokens.length; i = i + 3) { if("1".equals(tokens[i])) { //$NON-NLS-1$ int index = newNonTerminalIndex[newLhs[Integer.parseInt(tokens[i + 1])]]; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); if(!alreadyAdded[index]) { alreadyAdded[index] = true; buffer.append(newName[index]); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.java index 149a0b1d453..adcc3d75545 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredAnnotation.java @@ -216,7 +216,7 @@ public int sourceEnd() { @Override public String toString(int tab) { if (this.annotation != null) { - return tabString(tab) + "Recovered annotation:\n" + this.annotation.print(tab + 1, new StringBuffer(10)); //$NON-NLS-1$ + return tabString(tab) + "Recovered annotation:\n" + this.annotation.print(tab + 1, new StringBuilder(10)); //$NON-NLS-1$ } else { return tabString(tab) + "Recovered annotation: identiferPtr=" + this.identifierPtr + " identiferlengthPtr=" + this.identifierLengthPtr + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java index 6998df0018f..7dbf45b43da 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredBlock.java @@ -289,7 +289,7 @@ public void resetPendingModifiers() { } @Override public String toString(int tab) { - StringBuffer result = new StringBuffer(tabString(tab)); + StringBuilder result = new StringBuilder(tabString(tab)); result.append("Recovered block:\n"); //$NON-NLS-1$ this.blockDeclaration.print(tab + 1, result); if (this.statements != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java index e97da2d1a59..8958a4e3c4f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredField.java @@ -181,7 +181,7 @@ public int sourceEnd(){ } @Override public String toString(int tab){ - StringBuffer buffer = new StringBuffer(tabString(tab)); + StringBuilder buffer = new StringBuilder(tabString(tab)); buffer.append("Recovered field:\n"); //$NON-NLS-1$ this.fieldDeclaration.print(tab + 1, buffer); if (this.annotations != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java index d770857db80..597170efee7 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredInitializer.java @@ -266,7 +266,7 @@ public void resetPendingModifiers() { } @Override public String toString(int tab) { - StringBuffer result = new StringBuffer(tabString(tab)); + StringBuilder result = new StringBuilder(tabString(tab)); result.append("Recovered initializer:\n"); //$NON-NLS-1$ this.fieldDeclaration.print(tab + 1, result); if (this.annotations != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java index 5680910d938..73840513e6a 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredLocalVariable.java @@ -97,7 +97,7 @@ public int sourceEnd(){ } @Override public String toString(int tab) { - return tabString(tab) + "Recovered local variable:\n" + this.localDeclaration.print(tab + 1, new StringBuffer(10)); //$NON-NLS-1$ + return tabString(tab) + "Recovered local variable:\n" + this.localDeclaration.print(tab + 1, new StringBuilder(10)); //$NON-NLS-1$ } @Override public Statement updatedStatement(int depth, Set knownTypes){ diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java index 3e167b8df9a..6522545182f 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredMethod.java @@ -325,7 +325,7 @@ public int sourceEnd(){ } @Override public String toString(int tab) { - StringBuffer result = new StringBuffer(tabString(tab)); + StringBuilder result = new StringBuilder(tabString(tab)); result.append("Recovered method:\n"); //$NON-NLS-1$ this.methodDeclaration.print(tab + 1, result); if (this.annotations != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java index 7849d2cedfe..3610c40947e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredStatement.java @@ -51,7 +51,7 @@ public int sourceEnd(){ } @Override public String toString(int tab){ - return tabString(tab) + "Recovered statement:\n" + this.statement.print(tab + 1, new StringBuffer(10)); //$NON-NLS-1$ + return tabString(tab) + "Recovered statement:\n" + this.statement.print(tab + 1, new StringBuilder(10)); //$NON-NLS-1$ } public Statement updatedStatement(int depth, Set knownTypes){ if (this.nestedBlock != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java index 5a3ccddf0ad..09535ab11da 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredType.java @@ -452,7 +452,7 @@ public int sourceEnd(){ } @Override public String toString(int tab) { - StringBuffer result = new StringBuffer(tabString(tab)); + StringBuilder result = new StringBuilder(tabString(tab)); result.append("Recovered type:\n"); //$NON-NLS-1$ if ((this.typeDeclaration.bits & ASTNode.IsAnonymousType) != 0) { result.append(tabString(tab)); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java index 6b7f3d6bd88..5cd686a5a73 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/RecoveredUnit.java @@ -251,7 +251,7 @@ public int getLastStart() { } @Override public String toString(int tab) { - StringBuffer result = new StringBuffer(tabString(tab)); + StringBuilder result = new StringBuilder(tabString(tab)); result.append("Recovered unit: [\n"); //$NON-NLS-1$ this.unitDeclaration.print(tab + 1, result); result.append(tabString(tab + 1)); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java index 15b95434af1..c33b1a4ed66 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/parser/diagnose/DiagnoseParser.java @@ -453,7 +453,7 @@ private void diagnoseParse0(boolean record) { } private static char[] displayEscapeCharacters(char[] tokenSource, int start, int end) { - StringBuffer tokenSourceBuffer = new StringBuffer(); + StringBuilder tokenSourceBuffer = new StringBuilder(); for (int i = 0; i < start; i++) { tokenSourceBuffer.append(tokenSource[i]); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.java index aa139ab317d..1373ace0445 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/AbortCompilation.java @@ -61,7 +61,7 @@ public AbortCompilation(boolean isSilent, RuntimeException silentException) { @Override public String getMessage() { String message = super.getMessage(); - StringBuffer buffer = new StringBuffer(message == null ? Util.EMPTY_STRING : message); + StringBuilder buffer = new StringBuilder(message == null ? Util.EMPTY_STRING : message); if (this.problem != null) { buffer.append(this.problem); } else if (this.exception != null) { @@ -94,7 +94,7 @@ public void updateContext(ASTNode astNode, CompilationResult unitResult) { } public String getKey() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); if (this.problem != null) { buffer.append(this.problem); } diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java index 13f821b58b4..82bcba87a2c 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java @@ -3217,7 +3217,7 @@ public void illegalStaticModifierForMemberType(SourceTypeBinding type) { type.sourceEnd()); } public void illegalUsageOfQualifiedTypeReference(QualifiedTypeReference qualifiedTypeReference) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); char[][] tokens = qualifiedTypeReference.tokens; for (int i = 0; i < tokens.length; i++) { if (i > 0) buffer.append('.'); @@ -10549,11 +10549,11 @@ public void referenceExpressionArgumentNullityMismatch(ReferenceExpression locat } public void illegalReturnRedefinition(ASTNode location, MethodBinding descriptorMethod, boolean isUnchecked, TypeBinding providedType) { - StringBuffer methodSignature = new StringBuffer() + StringBuilder methodSignature = new StringBuilder() .append(descriptorMethod.declaringClass.readableName()) .append('.') .append(descriptorMethod.readableName()); - StringBuffer shortSignature = new StringBuffer() + StringBuilder shortSignature = new StringBuilder() .append(descriptorMethod.declaringClass.shortReadableName()) .append('.') .append(descriptorMethod.shortReadableName()); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/Util.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/Util.java index 203b28370da..e63e43d3fc2 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/Util.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/tool/Util.java @@ -58,7 +58,7 @@ public String getSource(char[] unitSource) { || unitSource.length == 0) return "No source available"; //$NON-NLS-1$ - StringBuffer errorBuffer = new StringBuffer(); + StringBuilder errorBuffer = new StringBuilder(); errorBuffer.append('\t'); char c; diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.java index 86299cb1f7d..a4f698d0710 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.java @@ -25,7 +25,7 @@ public class GenericXMLWriter extends PrintWriter { /* constants */ private static final String XML_VERSION= ""; //$NON-NLS-1$ - private static void appendEscapedChar(StringBuffer buffer, char c) { + private static void appendEscapedChar(StringBuilder buffer, char c) { String replacement= getReplacement(c); if (replacement != null) { buffer.append('&'); @@ -36,7 +36,7 @@ private static void appendEscapedChar(StringBuffer buffer, char c) { } } private static String getEscaped(String s) { - StringBuffer result= new StringBuffer(s.length() + 10); + StringBuilder result= new StringBuilder(s.length() + 10); for (int i= 0; i < s.length(); ++i) appendEscapedChar(result, s.charAt(i)); return result.toString(); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.java index 08713353810..79b5775637d 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/HashtableOfObjectToIntArray.java @@ -150,7 +150,7 @@ public int size() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); Object key; for (int i = 0, length = this.keyTable.length; i < length; i++) { if ((key = this.keyTable[i]) != null) { diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java index 48014f82bb2..7ecea0e63a1 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/ManifestAnalyzer.java @@ -56,7 +56,7 @@ public boolean analyzeManifestContents(InputStream inputStream) throws IOExcepti */ public boolean analyzeManifestContents(char[] chars) { int state = START, substate = 0; - StringBuffer currentJarToken = new StringBuffer(); + StringBuilder currentJarToken = new StringBuilder(); int currentChar; this.classpathSectionsCount = 0; this.calledFilesNames = null; @@ -177,7 +177,7 @@ public boolean analyzeManifestContents(char[] chars) { } // >>>>>>>>>>>>>>>> Method Extracted from analyzeManifestContents in the READING_JAR Block - private boolean addCurrentTokenJarWhenNecessary(StringBuffer currentJarToken) { + private boolean addCurrentTokenJarWhenNecessary(StringBuilder currentJarToken) { if (currentJarToken != null && currentJarToken.length() > 0) { if (this.calledFilesNames == null) { this.calledFilesNames = new ArrayList(); diff --git a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/Util.java b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/Util.java index 20790159b19..07bfd7cc43e 100644 --- a/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/Util.java +++ b/org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/util/Util.java @@ -559,7 +559,7 @@ private static boolean startsWith(byte[] a, byte[] start) { */ public static String getExceptionSummary(Throwable exception) { CharSequence buffer = getStackTrace(exception); - StringBuffer exceptionBuffer = new StringBuffer(50); + StringBuilder exceptionBuffer = new StringBuilder(50); exceptionBuffer.append(exception.toString()); // only keep leading frame portion of the trace (i.e. line no. 2 from the stacktrace) lookupLine2: for (int i = 0, lineSep = 0, max = buffer.length(), line2Start = 0; i < max; i++) { @@ -1638,7 +1638,7 @@ public static boolean effectivelyEqual(Object [] one, Object [] two) { return true; } - public static void appendEscapedChar(StringBuffer buffer, char c, boolean stringLiteral) { + public static void appendEscapedChar(StringBuilder buffer, char c, boolean stringLiteral) { switch (c) { case '\b' : buffer.append("\\b"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core.internal.tools/src/org/eclipse/jdt/core/internal/tools/unicode/CodePointsBuilder.java b/org.eclipse.jdt.core.internal.tools/src/org/eclipse/jdt/core/internal/tools/unicode/CodePointsBuilder.java index bfef37ca1a0..ee096b77803 100644 --- a/org.eclipse.jdt.core.internal.tools/src/org/eclipse/jdt/core/internal/tools/unicode/CodePointsBuilder.java +++ b/org.eclipse.jdt.core.internal.tools/src/org/eclipse/jdt/core/internal/tools/unicode/CodePointsBuilder.java @@ -85,7 +85,7 @@ private static void printDistribution(ArrayList array, int increment) { private static void printRange(int counter, int bound, int increment, int totalCounter, int length, int numberOfFiguresForRange, int numberOfFiguresForCounters) { if (counter != 0) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); int low = bound - increment; if (low != 0) { low++; @@ -105,7 +105,7 @@ private static String display(int value, int numberOfFiguresForRange, int radix) if ((value % 10) == 0) { numberOfFigures = (int) (Math.log(value + 1) / Math.log(10)); } - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); switch (radix) { case 10: while (numberOfFigures < numberOfFiguresForRange) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java index c9d010fb59c..59d3f9701b7 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/SelectionJavadocTest.java @@ -48,7 +48,7 @@ public class SelectionJavadocTest extends AbstractSelectionTest { String source; ICompilationUnit unit; - StringBuffer result; + StringBuilder result; public SelectionJavadocTest(String testName) { super(testName); @@ -134,7 +134,7 @@ protected void setUp() throws Exception { void setUnit(String name, String source) { this.source = source; this.unit = new CompilationUnit(source.toCharArray(), name, null); - this.result = new StringBuffer(); + this.result = new StringBuilder(); } /* diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java index c90d246dea6..4f2a40076d3 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/TypeAnnotationSyntaxTest.java @@ -128,7 +128,7 @@ public void storeLocations(Annotation annotation, int[] tab) { return; } - StringBuffer buffer = new StringBuffer("["); + StringBuilder buffer = new StringBuilder("["); for (int i = 0, max = tab.length; i < max; i += 2) { if (i > 0) { buffer.append(", "); diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java index c9893032c6a..daece46ee1a 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ASTImplTests.java @@ -887,7 +887,7 @@ public void test0019() { // Helper classes: define visitors leveraged by some tests class ASTCollector extends ASTVisitor { - StringBuffer collector = new StringBuffer(); + StringBuilder collector = new StringBuilder(); public String result() { return this.collector.toString(); } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java index ea599e6ca6f..383c50b4111 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractBatchCompilerTest.java @@ -96,7 +96,7 @@ String normalized(String originalValue) { protected static class TestCompilationProgress extends CompilationProgress { boolean isCanceled = false; int workedSoFar = 0; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); public void begin(int remainingWork) { this.buffer.append("----------\n[worked: 0 - remaining: ").append(remainingWork).append("]\n"); } @@ -438,7 +438,7 @@ protected void createCascadedJars() { protected String getLibraryClassesAsQuotedString() { String[] paths = Util.getJavaClassLibs(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append('"'); for (int i = 0, max = paths.length; i < max; i++) { if (i != 0) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java index 54c91673e0b..7b3d55bbdaa 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AbstractRegressionTest.java @@ -559,10 +559,10 @@ static int minorFromRawVersion (String version, String rawVersion) { } // returns 0L if everything went fine; else the lower word contains the // exit value and the upper word is non-zero iff the error log has contents - long compile(File directory, String options, String[] sourceFileNames, StringBuffer log) throws IOException, InterruptedException { + long compile(File directory, String options, String[] sourceFileNames, StringBuilder log) throws IOException, InterruptedException { return compile(directory, options, sourceFileNames, log, true); } - long compile(File directory, String options, String[] sourceFileNames, StringBuffer log, boolean extendCommandLine) throws IOException, InterruptedException { + long compile(File directory, String options, String[] sourceFileNames, StringBuilder log, boolean extendCommandLine) throws IOException, InterruptedException { Process compileProcess = null; long result = 0L; // WORK classpath should depend on the compiler, not on the default runtime @@ -589,7 +589,7 @@ long compile(File directory, String options, String[] sourceFileNames, StringBuf } compileProcess = Runtime.getRuntime().exec(cmdLineAsString, env, directory); Logger errorLogger = new Logger(compileProcess.getErrorStream(), - "ERROR", log == null ? new StringBuffer() : log); + "ERROR", log == null ? new StringBuilder() : log); errorLogger.start(); int compilerResult = compileProcess.waitFor(); result |= compilerResult; // caveat: may never terminate under specific conditions @@ -643,7 +643,7 @@ private JavaRuntime(String rootDirectoryPath, String version, String rawVersion, this.minor = minor; } // returns 0 if everything went fine - int execute(File directory, String options, String className, StringBuffer stdout, StringBuffer stderr) throws IOException, InterruptedException { + int execute(File directory, String options, String className, StringBuilder stdout, StringBuilder stderr) throws IOException, InterruptedException { Process executionProcess = null; try { StringBuilder cmdLine = new StringBuilder(this.javaPathName); @@ -656,10 +656,10 @@ int execute(File directory, String options, String className, StringBuffer stdou cmdLine.append(className); executionProcess = Runtime.getRuntime().exec(cmdLine.toString(), env, directory); Logger outputLogger = new Logger(executionProcess.getInputStream(), - "RUNTIME OUTPUT", stdout == null ? new StringBuffer() : stdout); + "RUNTIME OUTPUT", stdout == null ? new StringBuilder() : stdout); outputLogger.start(); Logger errorLogger = new Logger(executionProcess.getErrorStream(), - "RUNTIME ERROR", stderr == null ? new StringBuffer() : stderr); + "RUNTIME ERROR", stderr == null ? new StringBuilder() : stderr); errorLogger.start(); int result = executionProcess.waitFor(); // caveat: may never terminate under specific conditions outputLogger.join(); // make sure we get the whole output @@ -1238,15 +1238,15 @@ String getCompilerOptions() { // documented in Process); however, we could have a single worker // take care of this static class Logger extends Thread { - StringBuffer buffer; + StringBuilder buffer; InputStream inputStream; String type; Logger(InputStream inputStream, String type) { this.inputStream = inputStream; this.type = type; - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); } - Logger(InputStream inputStream, String type, StringBuffer buffer) { + Logger(InputStream inputStream, String type, StringBuilder buffer) { this.inputStream = inputStream; this.type = type; this.buffer = buffer; @@ -1473,7 +1473,7 @@ protected void compileAndDeploy(String source, String directoryName, String clas e.printStackTrace(); return; } - StringBuffer buffer = new StringBuffer() + StringBuilder buffer = new StringBuilder() .append("\"") .append(fileName) .append("\" -d \"") @@ -2550,7 +2550,7 @@ protected void runJavac( // complianceLevel is not set); consider accepting the compiler // in such case and see what happens JavacTestOptions.Excuse excuse = options.excuseFor(compiler); - StringBuffer compilerLog = new StringBuffer(); + StringBuilder compilerLog = new StringBuilder(); File javacOutputDirectory = null; int mismatch = 0; String sourceFileNames[] = null; @@ -2637,13 +2637,13 @@ protected void runJavac( !javacTestErrorFlag && mismatch == 0 && sourceFileNames != null && !className.endsWith(PACKAGE_INFO_NAME) && !className.endsWith(MODULE_INFO_NAME)) { JavaRuntime runtime = JavaRuntime.fromCurrentVM(); - StringBuffer stderr = new StringBuffer(); - StringBuffer stdout = new StringBuffer(); + StringBuilder stderr = new StringBuilder(); + StringBuilder stdout = new StringBuilder(); String vmOptions = ""; if (vmArguments != null) { int l = vmArguments.length; if (l > 0) { - StringBuffer buffer = new StringBuffer(vmArguments[0]); + StringBuilder buffer = new StringBuilder(vmArguments[0]); for (int i = 1; i < l; i++) { buffer.append(' '); buffer.append(vmArguments[i]); @@ -2722,7 +2722,7 @@ protected String expandFileNameForJavac(String fileName) { return fileName; } void handleMismatch(JavacCompiler compiler, String testName, String[] testFiles, String expectedCompilerLog, - String expectedOutputString, String expectedErrorString, StringBuffer compilerLog, String output, String err, + String expectedOutputString, String expectedErrorString, StringBuilder compilerLog, String output, String err, JavacTestOptions.Excuse excuse, int mismatch) { if (mismatch != 0) { if (excuse != null && excuse.clears(mismatch)) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java index fff7b4bc35f..60e0020d161 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ClasspathJmodTests.java @@ -74,7 +74,7 @@ public void test001() { " return null;\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" --module-path \"") @@ -107,7 +107,7 @@ public void test002() { " return null;\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" --module-path \"") @@ -151,7 +151,7 @@ public void test003() { " return null;\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -195,7 +195,7 @@ public void test004() { " return null;\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" --module-path \"") @@ -249,7 +249,7 @@ public void test005() { " public static java.sql.Connection con = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" --module-path \"") diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java index 362d466096d..6f9a140152a 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CompilerInvocationTests.java @@ -1328,8 +1328,8 @@ class ProblemAttributes { expectedProblemAttributes.put("ClassExtendFinalRecord", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("RecordErasureIncompatibilityInCanonicalConstructor", new ProblemAttributes(CategorizedProblem.CAT_TYPE)); expectedProblemAttributes.put("JavadocInvalidModule", new ProblemAttributes(CategorizedProblem.CAT_INTERNAL)); - StringBuffer failures = new StringBuffer(); - StringBuffer correctResult = new StringBuffer(70000); + StringBuilder failures = new StringBuilder(); + StringBuilder correctResult = new StringBuilder(70000); Field[] fields = (iProblemClass = IProblem.class).getFields(); Arrays.sort(fields, new Comparator() { @Override @@ -2440,8 +2440,8 @@ class ProblemAttributes { } } fields = IProblem.class.getFields(); - StringBuffer failures = new StringBuffer(); - StringBuffer correctResult = new StringBuffer(70000); + StringBuilder failures = new StringBuilder(); + StringBuilder correctResult = new StringBuilder(70000); Arrays.sort(fields, new Comparator() { @Override public int compare(Object o1, Object o2) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java index 19bbb872a0c..8ac95ac76e6 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeSignatureTest.java @@ -43,13 +43,13 @@ @SuppressWarnings({ "rawtypes" }) public class GenericTypeSignatureTest extends AbstractRegressionTest { static class Logger extends Thread { - StringBuffer buffer; + StringBuilder buffer; InputStream inputStream; String type; Logger(InputStream inputStream, String type) { this.inputStream = inputStream; this.type = type; - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); } @Override diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java index 941d268c1bf..8e7902c34b4 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTestForModule.java @@ -82,7 +82,7 @@ protected void writeFile(String directoryName, String fileName, String source) { } class Runner extends AbstractRegressionTest.Runner { - StringBuffer commandLine = new StringBuffer(); + StringBuilder commandLine = new StringBuilder(); String outputDir = OUTPUT_DIR + File.separator + "javac"; List fileNames = new ArrayList<>(); /** will replace any -8, -9 ... option for javac */ @@ -115,7 +115,7 @@ Set runConformModuleTest() { } } - void runConformModuleTest(List testFileNames, StringBuffer commandLine, + void runConformModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory) { @@ -123,7 +123,7 @@ void runConformModuleTest(List testFileNames, StringBuffer commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, OUTPUT_DIR + File.separator + "javac"); } - void runConformModuleTest(List testFileNames, StringBuffer commandLine, + void runConformModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String output) { @@ -165,7 +165,7 @@ Set runConformModuleTest(String[] testFiles, String commandLine, System.err.println("Skip testing javac in "+testName()); continue; } - StringBuffer log = new StringBuffer(); + StringBuilder log = new StringBuilder(); try { long compileResult = javacCompiler.compile( outputDir, /* directory */ @@ -191,21 +191,21 @@ Set runConformModuleTest(String[] testFiles, String commandLine, return null; } - void runNegativeModuleTest(List testFileNames, StringBuffer commandLine, + void runNegativeModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch) { runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, OUTPUT_DIR + File.separator + "javac"); } - void runNegativeModuleTest(List testFileNames, StringBuffer commandLine, + void runNegativeModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch, String output) { runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, output, JavacTestOptions.DEFAULT); } - void runNegativeModuleTest(List testFileNames, StringBuffer commandLine, + void runNegativeModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch, String output, JavacTestOptions options) { @@ -241,7 +241,7 @@ void runNegativeModuleTest(String[] testFiles, String commandLine, JavacTestOptions.Excuse excuse = options.excuseFor(javacCompiler); commandLine = adjustForJavac(commandLine, null); - StringBuffer log = new StringBuffer(); + StringBuilder log = new StringBuilder(); int mismatch = 0; try { long compileResult = javacCompiler.compile( @@ -616,7 +616,7 @@ public void testBug549855d() { " public int foo() { return 0; }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -enableJavadoc ") diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java index 229a8aaf652..710fca5e4dd 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ModuleCompilationTests.java @@ -92,7 +92,7 @@ protected void writeFile(String directoryName, String fileName, String source) { } class Runner extends AbstractRegressionTest.Runner { - StringBuffer commandLine = new StringBuffer(); + StringBuilder commandLine = new StringBuilder(); String outputDir = OUTPUT_DIR + File.separator + "javac"; List fileNames = new ArrayList<>(); /** will replace any -8, -9 ... option for javac */ @@ -125,7 +125,7 @@ Set runConformModuleTest() { } } - void runConformModuleTest(List testFileNames, StringBuffer commandLine, + void runConformModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory) { @@ -133,7 +133,7 @@ void runConformModuleTest(List testFileNames, StringBuffer commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, OUTPUT_DIR + File.separator + "javac"); } - void runConformModuleTest(List testFileNames, StringBuffer commandLine, + void runConformModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String output) { @@ -175,7 +175,7 @@ Set runConformModuleTest(String[] testFiles, String commandLine, System.err.println("Skip testing javac in "+testName()); continue; } - StringBuffer log = new StringBuffer(); + StringBuilder log = new StringBuilder(); try { long compileResult = javacCompiler.compile( outputDir, /* directory */ @@ -201,21 +201,21 @@ Set runConformModuleTest(String[] testFiles, String commandLine, return null; } - void runNegativeModuleTest(List testFileNames, StringBuffer commandLine, + void runNegativeModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch) { runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, OUTPUT_DIR + File.separator + "javac"); } - void runNegativeModuleTest(List testFileNames, StringBuffer commandLine, + void runNegativeModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch, String output) { runNegativeModuleTest(testFileNames, commandLine, expectedFailureOutOutputString, expectedFailureErrOutputString, shouldFlushOutputDirectory, javacErrorMatch, output, JavacTestOptions.DEFAULT); } - void runNegativeModuleTest(List testFileNames, StringBuffer commandLine, + void runNegativeModuleTest(List testFileNames, StringBuilder commandLine, String expectedFailureOutOutputString, String expectedFailureErrOutputString, boolean shouldFlushOutputDirectory, String javacErrorMatch, String output, JavacTestOptions options) { @@ -251,7 +251,7 @@ void runNegativeModuleTest(String[] testFiles, String commandLine, JavacTestOptions.Excuse excuse = options.excuseFor(javacCompiler); commandLine = adjustForJavac(commandLine, null); - StringBuffer log = new StringBuffer(); + StringBuilder log = new StringBuilder(); int mismatch = 0; try { long compileResult = javacCompiler.compile( @@ -506,7 +506,7 @@ public void test006() { " java.awt.Image image;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -546,7 +546,7 @@ public void test007() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -599,7 +599,7 @@ public void test008() { " public static java.sql.Connection con = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -649,7 +649,7 @@ public void test008a() { String systemDirectory = OUTPUT_DIR+File.separator+"system"; writeFile(systemDirectory, "readme.txt", "Not a valid system"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append("--system ").append(systemDirectory) @@ -697,7 +697,7 @@ public void test009() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" --module-source-path " + "\"" + directory + "\""); @@ -824,7 +824,7 @@ public void test010() { " q.Y y = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" -p \"") @@ -879,7 +879,7 @@ public void test012() { "public class Z extends Object {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" -classpath \"") @@ -925,7 +925,7 @@ public void test013() { " q.Y y = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9") .append(" -classpath \"") @@ -1026,7 +1026,7 @@ public void test014() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1072,7 +1072,7 @@ public void test015() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1125,7 +1125,7 @@ public void test016() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1171,7 +1171,7 @@ public void test017() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1236,7 +1236,7 @@ public void test018() { "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1308,7 +1308,7 @@ public void test019b() { " s.t.Tester t;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1352,7 +1352,7 @@ public void test019c() { "public abstract class X {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1396,7 +1396,7 @@ public void test019fail() { " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1460,7 +1460,7 @@ public void test020() { " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1496,7 +1496,7 @@ public void test021() { " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1532,7 +1532,7 @@ public void test022() { " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1562,7 +1562,7 @@ public void test023() { " requires transitive java.sql;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1591,7 +1591,7 @@ public void test024() { " requires transitive java.sql;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1620,7 +1620,7 @@ public void test025() { " requires transitive java.sql;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1680,7 +1680,7 @@ public void test028() { " p1.X1 x1 = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" -p \"") @@ -1733,7 +1733,7 @@ public void test029() { " java.sql.Connection con = p.X.getConnection();\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1793,7 +1793,7 @@ public void test030() { " Connection con = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1854,7 +1854,7 @@ public void test031() { " Connection con = null;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1901,7 +1901,7 @@ public void test032() { " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -1952,7 +1952,7 @@ public void test033() { "public class X extends a.A {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2009,7 +2009,7 @@ public void test034() { "public class X extends a.A {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2068,7 +2068,7 @@ public void test035() { "public class X extends a.A {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2120,7 +2120,7 @@ public void testBug515985() { " }\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2176,7 +2176,7 @@ public void testApiLeak1() { " }\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2251,7 +2251,7 @@ public void testApiLeak2() { " }\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2344,7 +2344,7 @@ public void testPackageConflict0() { " requires transitive mod.y;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2431,7 +2431,7 @@ public void testPackageConflict1() { " p2.sub.C4 f4;\n" + // no conflict mod.one/p2 <-> mod.two/p2.sub "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2501,7 +2501,7 @@ public void testPackageConflict3() { "public class C3 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2551,7 +2551,7 @@ public void testPackageConflict4() { "public class C1 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2569,7 +2569,7 @@ public void testPackageConflict4() { writeFileCollecting(files, directory + File.separator + "p", "X.java", "public class X extends pm.C1 { \n" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2611,7 +2611,7 @@ public void _testPackageConflict4a() { "public class C1 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2629,7 +2629,7 @@ public void _testPackageConflict4a() { writeFileCollecting(files, directory + File.separator + "p", "X.java", "public class X extends pm.C1 { \n" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2677,7 +2677,7 @@ public void testPackageConflict5() { "public class C1 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2695,7 +2695,7 @@ public void testPackageConflict5() { writeFileCollecting(files, directory + File.separator + "p", "X.java", "public class X extends pm.C1 { \n" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2709,7 +2709,7 @@ public void testPackageConflict5() { "The package pm is accessible from more than one module: mod.y, mod.x\n", false, "reads package pm from both"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2752,7 +2752,7 @@ public void testPackageConflict6() { "public class C1 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2770,7 +2770,7 @@ public void testPackageConflict6() { writeFileCollecting(files, directory + File.separator + "p", "X.java", "public class X extends pm.C1 { \n" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2819,7 +2819,7 @@ public void testPackageConflict7() { "public class C1 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2837,7 +2837,7 @@ public void testPackageConflict7() { writeFileCollecting(files, directory + File.separator + "p", "X.java", "public class X { \n" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2890,7 +2890,7 @@ public void testPackageTypeConflict1() { " p1.p2.t3.t4 f;\n" + // no conflict mod.one/p1.p2.t3 <-> mod.two/p1.p2.t3 "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2918,7 +2918,7 @@ public void testBug519922() { "public class Test implements org.eclipse.SomeInterface {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -2951,7 +2951,7 @@ public void testMixedSourcepath() { " exports p.q;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3004,7 +3004,7 @@ public void testAPILeakDetection1() { "public class C2 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3065,7 +3065,7 @@ public void testAPILeakDetection2() { " public C0[] f2;\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3118,7 +3118,7 @@ public void testAPILeakDetection3() { " public C0[] f2;\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3157,7 +3157,7 @@ public void testAPILeakDetection4() { " public C3.C4 f2;\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3226,7 +3226,7 @@ public void testAPILeakDetection5() { " public void m2(p.exp2.C2 arg) {}\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3273,7 +3273,7 @@ public void testAPILeakDetection6() { " public @ANN String test(@ANN String arg, @ANN C0 c) { return \"\"; }\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3319,7 +3319,7 @@ public void testAPILeakDetection7() { " X, Y, Z;\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3349,7 +3349,7 @@ public void testBug486013_comment27() { " List l;\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3438,7 +3438,7 @@ public void testBug518295c() { " requires mod.two;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" -p \"") @@ -3470,7 +3470,7 @@ public void testUnnamedPackage_Bug520839() { "public class X {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3518,7 +3518,7 @@ public void testAutoModule1() throws Exception { " p.a.X f;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3554,7 +3554,7 @@ public void testBug521458a() { " requires mod.two;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" -p \"") @@ -3588,7 +3588,7 @@ public void _testBug521458b() { " requires mod.two;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" -p \"") @@ -3619,7 +3619,7 @@ public void testBug521362_emptyFile() { writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java", ""); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3655,7 +3655,7 @@ public void testBug521362_mismatchingdeclaration() { writeFileCollecting(files, moduleLoc + File.separator + "p1", "X.java", "package q;\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3696,7 +3696,7 @@ public void testBug521362_multiplePackages() { "package q2;\n"); writeFileCollecting(files, moduleLoc + File.separator + "p3", "X.java", "package p3;\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3742,7 +3742,7 @@ public void testBug521362_multiplePackages2() { "package q2;\n"); writeFileCollecting(files, moduleLoc + File.separator + "p3" + File.separator + "p4" + File.separator + "p5", "X.java", "package p3.p4.p5;\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3816,7 +3816,7 @@ public void testBug500170b() { "module mod.one { \n" + " requires java.sql;\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -8") .append(" -classpath \"") @@ -3883,7 +3883,7 @@ public void testBug522472c() { "X.java", "package x.y.z;\n" + "public class X {}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -3914,7 +3914,7 @@ public void testBug522472c() { "@SuppressWarnings(\"unused\")\n" + "public class Main {" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -4476,7 +4476,7 @@ public void testLimitModules1() { "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -4515,7 +4515,7 @@ public void testLimitModules2() { "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -4553,7 +4553,7 @@ public void testLimitModules3() { "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -4581,7 +4581,7 @@ public void testLimitModules4() { "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" --module-path \"") @@ -4610,7 +4610,7 @@ public void testLimitModules5() { "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" --module-path \"") @@ -4693,7 +4693,7 @@ public void testBug508889_002() throws Exception { "package pack1;\n" + "public class X11 {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -4919,7 +4919,7 @@ public void testBug520858c() { " return \"\";\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -source 9 ") .append(" --module-source-path " + "\"" + srcDir + "\" "); @@ -4954,7 +4954,7 @@ public void testBug520858d() { " return \"\";\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -source 9 ") .append(" --module-source-path " + "\"" + srcDir + "\" ") @@ -4991,7 +4991,7 @@ public void testBug520858e() { " return \"\";\n" + " }\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -source 9 ") .append(" --module-source-path " + "\"" + srcDir + "\" ") @@ -5032,7 +5032,7 @@ public void testBug530575() { "public class C1 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5058,7 +5058,7 @@ public void testBug530575() { "public class X extends px.C1 { \n" + " py.C1 c = null;\n" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5345,7 +5345,7 @@ public void testBug548195() { "public class X {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); String binDir = OUTPUT_DIR + File.separator + out; buffer.append("-d " + binDir ) .append(" -9 ") @@ -5388,7 +5388,7 @@ public void testBug548195fail() { "public class X {\n" + "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); String binDir = OUTPUT_DIR + File.separator + out; buffer.append("-d " + binDir ) .append(" -9 ") @@ -5432,7 +5432,7 @@ public void testPackageTypeConflict2() { "public class t4 {\n" + "}\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5468,7 +5468,7 @@ public void testBug550178() throws Exception { "}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + outDir ) .append(" -9 ") .append(" --module-path \"") @@ -5660,7 +5660,7 @@ public void testBug522472a() { "A.java", "package a.b.c;\n" + "public class A {}"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5689,7 +5689,7 @@ public void testBug522472a() { "import x.y.z.*;\n" + "public class Main {" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5749,7 +5749,7 @@ public void testBug522472b() { writeFileCollecting(files, moduleLoc + File.separator + "x" + File.separator + "y" + File.separator + "z", "X.java", "package x.y.z;\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5779,7 +5779,7 @@ public void testBug522472b() { "import x.y.z.*;\n" + "public class Main {" + "}"); - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") @@ -5841,7 +5841,7 @@ public void testBug522472d() { writeFileCollecting(files, moduleLoc + File.separator + "x" + File.separator + "y" + File.separator + "z", "X.java", "package x.y.z;\n"); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("-d " + OUTPUT_DIR + File.separator + out ) .append(" -9 ") .append(" -classpath \"") diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java index d4cd6d24135..73d1c81e78d 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceImplTransformations.java @@ -1684,20 +1684,20 @@ void printTruthTables(File outputDirectory) { ((State) transitionsSet.getValue()).printableBitsField.charAt(bit); } } - StringBuffer line; - line = new StringBuffer(140); + StringBuilder line; + line = new StringBuilder(140); line.append(" "); for (int i = 1; i <= State.stateWidth; i++) { line.append(i); line.append(' '); } out.println(line); - line = new StringBuffer(140); + line = new StringBuilder(140); line.append(" ---------------------"); out.println(line); for (row = 0; row < State.statesNb; row++) { if (keepRow[row]) { - line = new StringBuffer(140); + line = new StringBuilder(140); line.append(truthTableRowNames[row]); line.append(" | "); for (int i = 0; i < State.stateWidth; i++) { @@ -2357,9 +2357,9 @@ else if (keepColumn[row + 1]) { keepColumn[row] = true; } } - StringBuffer line; + StringBuilder line; for (int i = 0; i < State.stateWidth; i++) { - line = new StringBuffer(140); + line = new StringBuilder(140); line.append(" "); for (column = 0; column < State.statesNb; column++) { if (keepColumn[column]) { @@ -2369,7 +2369,7 @@ else if (keepColumn[row + 1]) { } out.println(line); } - line = new StringBuffer(140); + line = new StringBuilder(140); line.append(" --"); for (column = 0; column < State.statesNb; column++) { if (keepColumn[column]) { @@ -2380,7 +2380,7 @@ else if (keepColumn[row + 1]) { out.println(line); for (row = 0; row < State.statesNb; row++) { if (keepRow[row]) { - line = new StringBuffer(140); + line = new StringBuilder(140); line.append(truthTableRowNames[row]); line.append(" | "); for (column = 0; column < State.statesNb; column++) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java index ad93939506c..50509de87fb 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ScannerTest.java @@ -549,7 +549,7 @@ public void test027() { scanner.resetTo(0, source.length - 1); try { int token; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { try { switch(token) { @@ -578,7 +578,7 @@ public void test028() { scanner.resetTo(0, source.length - 1); try { int token; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { try { switch(token) { @@ -610,7 +610,7 @@ public void test029() { scanner.resetTo(0, source.length - 1); try { int token; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { try { switch(token) { @@ -864,7 +864,7 @@ public void test042() { IScanner scanner = ToolFactory.createScanner(true, true, true, "1.5", "1.5"); final char[] source = "\"a\\u000D\"".toCharArray(); scanner.setSource(source); - final StringBuffer buffer = new StringBuffer(); + final StringBuilder buffer = new StringBuilder(); try { int token; while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) { @@ -893,7 +893,7 @@ public void test043() { IScanner scanner = ToolFactory.createScanner(true, true, true, "1.5", "1.5"); final char[] source = "\"\\u004Ca\\u000D\"".toCharArray(); scanner.setSource(source); - final StringBuffer buffer = new StringBuffer(); + final StringBuilder buffer = new StringBuilder(); try { int token; while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) { @@ -921,7 +921,7 @@ public void test044() { IScanner scanner = ToolFactory.createScanner(true, true, true, "1.5", "1.5"); final char[] source = "\"\\u004Ca\\u000D\\u0022".toCharArray(); scanner.setSource(source); - final StringBuffer buffer = new StringBuffer(); + final StringBuilder buffer = new StringBuilder(); try { int token; while ((token = scanner.getNextToken()) != ITerminalSymbols.TokenNameEOF) { @@ -1483,7 +1483,7 @@ public void testBug531716_001_since_13() { scanner.resetTo(0, source.length - 1); try { int token; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { try { switch(token) { @@ -1516,7 +1516,7 @@ public void testBug531716_001_since_13_1() { scanner.resetTo(0, source.length - 1); try { int token; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while ((token = scanner.getNextToken()) != TerminalTokens.TokenNameEOF) { try { switch(token) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java index 32e7e8a3295..dbedb74878e 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/UtilTest.java @@ -25,7 +25,7 @@ @SuppressWarnings({ "rawtypes" }) public class UtilTest extends AbstractRegressionTest { -StringBuffer camelCaseErrors; +StringBuilder camelCaseErrors; public UtilTest(String name) { super(name); @@ -50,7 +50,7 @@ void assertCamelCase(String pattern, String name, boolean match) { void assertCamelCase(String pattern, String name, boolean prefixMatch, boolean match) { boolean camelCase = CharOperation.camelCaseMatch(pattern==null?null:pattern.toCharArray(), name==null?null:name.toCharArray(), prefixMatch); if (match != camelCase) { - StringBuffer line = new StringBuffer("'"); + StringBuilder line = new StringBuilder("'"); line.append(name); line.append("' SHOULD"); if (!match) line.append(" NOT"); @@ -72,7 +72,7 @@ void assertCamelCase(String pattern, String name, boolean prefixMatch, boolean m @Override protected void setUp() throws Exception { super.setUp(); - this.camelCaseErrors = new StringBuffer(); + this.camelCaseErrors = new StringBuilder(); } public boolean checkPathMatch(char[] pattern, char[] path, boolean isCaseSensitive) { diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationContextWrapperTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationContextWrapperTest.java index 87c6d95fb37..a23b5cc2f80 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationContextWrapperTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/eval/EvaluationContextWrapperTest.java @@ -179,7 +179,7 @@ private Map compileAndDeploy15(String source, String className, e.printStackTrace(); return result; } - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer .append("\"") .append(fileName) diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java index babd5439d1f..cc953a271fb 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/junit/extension/TestCase.java @@ -104,7 +104,7 @@ public class TestCase extends PerformanceTestCase { try { // https://bugs.eclipse.org/bugs/show_bug.cgi?id=384531 // compiler.version is a timestamp since the the above fix (of the format: v20120725-181921) - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0; i < version.length(); i++) { if (Character.isDigit(version.charAt(i))) { buffer.append(version.charAt(i)); @@ -249,11 +249,11 @@ public static void assertStringEquals(String message, String expected, String ac return; if (expected != null && expected.equals(actual)) return; - final StringBuffer formatted; + final StringBuilder formatted; if (message != null) { - formatted = new StringBuffer(message).append('.'); + formatted = new StringBuilder(message).append('.'); } else { - formatted = new StringBuffer(); + formatted = new StringBuilder(); } if (showLineSeparators) { expected = showLineSeparators(expected); @@ -963,7 +963,7 @@ static public void assertSame(String message, int expected, int actual) { failNotSame(message, expected, actual); } static public void failNotSame(String message, int expected, int actual) { - StringBuffer formatted= new StringBuffer(); + StringBuilder formatted= new StringBuilder(); if (message != null) { formatted.append(message).append(' '); } diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java index fe31df85d3b..7ba0e8633b7 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/StandardVMLauncher.java @@ -95,7 +95,7 @@ public String[] getCommandLine() { List commandLine = new ArrayList<>(); // VM binary - StringBuffer vmLocation = new StringBuffer(this.vmPath); + StringBuilder vmLocation = new StringBuilder(this.vmPath); vmLocation .append(this.vmPath.endsWith(File.separator) ? "" : File.separator) .append("bin") diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java index 5267bd52f5d..1b376b2169c 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/TestVerifier.java @@ -33,8 +33,8 @@ public class TestVerifier { boolean reuseVM = true; String[] classpathCache; LocalVirtualMachine vm; - StringBuffer outputBuffer; - StringBuffer errorBuffer; + StringBuilder outputBuffer; + StringBuilder errorBuffer; Socket socket; public TestVerifier(boolean reuseVM) { this.reuseVM = reuseVM; @@ -114,14 +114,14 @@ private void compileVerifyTests(String verifierDir) { BatchCompiler.compile("\"" + fileName + "\" -d \"" + verifierDir + "\" -warn:-resource -classpath \"" + Util.getJavaClassLibsAsString() + "\"", new PrintWriter(System.out), new PrintWriter(System.err), null/*progress*/); } public void execute(String className, String[] classpaths) { - this.outputBuffer = new StringBuffer(); - this.errorBuffer = new StringBuffer(); + this.outputBuffer = new StringBuilder(); + this.errorBuffer = new StringBuilder(); launchAndRun(className, classpaths, null, null); } public void execute(String className, String[] classpaths, String[] programArguments, String[] vmArguments) { - this.outputBuffer = new StringBuffer(); - this.errorBuffer = new StringBuffer(); + this.outputBuffer = new StringBuilder(); + this.errorBuffer = new StringBuilder(); launchAndRun(className, classpaths, programArguments, vmArguments); } @@ -645,8 +645,8 @@ public boolean verifyClassFiles(String sourceFilePath, String className, String } public boolean verifyClassFiles(String sourceFilePath, String className, String expectedOutputString, String expectedErrorStringStart, String[] classpaths, String[] programArguments, String[] vmArguments) { - this.outputBuffer = new StringBuffer(); - this.errorBuffer = new StringBuffer(); + this.outputBuffer = new StringBuilder(); + this.errorBuffer = new StringBuilder(); if (this.reuseVM && programArguments == null) { launchVerifyTestsIfNeeded(classpaths, vmArguments); loadAndRun(className, classpaths); diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java index c682c688563..d67f91de47d 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java @@ -163,7 +163,7 @@ public class Util { OUTPUT_DIRECTORY = pathDir; } -public static void appendProblem(StringBuffer problems, IProblem problem, char[] source, int problemCount) { +public static void appendProblem(StringBuilder problems, IProblem problem, char[] source, int problemCount) { problems.append(problemCount + (problem.isError() ? ". ERROR" : problem.isWarning() ? ". WARNING" : ". INFO")); problems.append(" in " + new String(problem.getOriginatingFileName())); if (source != null) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java index 5ffae4db419..2c6fc2e2f03 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS4Test.java @@ -7547,7 +7547,7 @@ public void test0230() throws JavaModelException { IBinding[] bindings= parser.createBindings(new IJavaElement[] { type }, null); if (bindings.length == 1 && bindings[0] instanceof ITypeBinding) { ITypeBinding typeBinding= (ITypeBinding) bindings[0]; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while (typeBinding != null) { buffer.append(typeBinding.getAnnotations().length); typeBinding= typeBinding.getSuperclass(); @@ -7574,7 +7574,7 @@ public void test0231() throws JavaModelException { List types = unit.types(); TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0); ITypeBinding typeBinding = typeDeclaration.resolveBinding(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while (typeBinding != null) { buffer.append(typeBinding.getAnnotations().length); typeBinding= typeBinding.getSuperclass(); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java index bbb27e82acf..fd139c8be05 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15JLS8Test.java @@ -7535,7 +7535,7 @@ public void test0230() throws JavaModelException { IBinding[] bindings= parser.createBindings(new IJavaElement[] { type }, null); if (bindings.length == 1 && bindings[0] instanceof ITypeBinding) { ITypeBinding typeBinding= (ITypeBinding) bindings[0]; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while (typeBinding != null) { buffer.append(typeBinding.getAnnotations().length); typeBinding= typeBinding.getSuperclass(); @@ -7562,7 +7562,7 @@ public void test0231() throws JavaModelException { List types = unit.types(); TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0); ITypeBinding typeBinding = typeDeclaration.resolveBinding(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while (typeBinding != null) { buffer.append(typeBinding.getAnnotations().length); typeBinding= typeBinding.getSuperclass(); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java index ea1053c2590..7c21a796ee8 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java @@ -7558,7 +7558,7 @@ public void test0230() throws JavaModelException { IBinding[] bindings= parser.createBindings(new IJavaElement[] { type }, null); if (bindings.length == 1 && bindings[0] instanceof ITypeBinding) { ITypeBinding typeBinding= (ITypeBinding) bindings[0]; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while (typeBinding != null) { buffer.append(typeBinding.getAnnotations().length); typeBinding= typeBinding.getSuperclass(); @@ -7585,7 +7585,7 @@ public void test0231() throws JavaModelException { List types = unit.types(); TypeDeclaration typeDeclaration = (TypeDeclaration) types.get(0); ITypeBinding typeBinding = typeDeclaration.resolveBinding(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while (typeBinding != null) { buffer.append(typeBinding.getAnnotations().length); typeBinding= typeBinding.getSuperclass(); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java index 534abb4a453..7e76b75f5a3 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter17Test.java @@ -737,7 +737,7 @@ public void test0018() throws JavaModelException { CompilationUnit unit = (CompilationUnit) node; assertProblemsSize(unit, 0); class InferredTypeFromExpectedVisitor extends ASTVisitor { - StringBuffer buf = new StringBuffer(); + StringBuilder buf = new StringBuilder(); public boolean visit(ClassInstanceCreation creation) { this.buf.append(creation.isResolvedTypeInferredFromExpectedType()); return false; diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java index 0fc13291521..5f914c71d01 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterBindingsTest.java @@ -532,7 +532,7 @@ private void checkBindingEqualityForProject(String projectName) throws JavaModel if (DEBUG) { if (unit.types().size() > 0 ) { AbstractTypeDeclaration typeDeclaration = (AbstractTypeDeclaration) unit.types().get(0); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); PackageDeclaration packageDeclaration = unit.getPackage(); if (packageDeclaration != null) { buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName()); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocFlattener.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocFlattener.java index 5da7d519551..a04e020ce09 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocFlattener.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocFlattener.java @@ -25,7 +25,7 @@ public class ASTConverterJavadocFlattener extends ASTVisitor { * The string buffer into which the serialized representation of the AST is * written. */ - private final StringBuffer buffer; + private final StringBuilder buffer; private final int indent = 0; private final String comment; @@ -33,7 +33,7 @@ public class ASTConverterJavadocFlattener extends ASTVisitor { * Creates a new AST printer. */ ASTConverterJavadocFlattener(String comment) { - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); this.comment = comment; } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java index 63b90deface..77dd6183217 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest.java @@ -135,7 +135,7 @@ public class ASTConverterJavadocTest extends ConverterTestSetup { // Debug protected String prefix = ""; protected boolean debug = false; - protected StringBuffer problems; + protected StringBuilder problems; protected String compilerOption = JavaCore.IGNORE; protected List failures; protected boolean stopOnFailure = true; @@ -238,7 +238,7 @@ protected void setUp() throws Exception { super.setUp(); TEST_COUNTERS[0]++; this.failures = new ArrayList(); - this.problems = new StringBuffer(); + this.problems = new StringBuilder(); this.workingCopies = null; this.savedLevel = this.astLevel; } @@ -1393,7 +1393,7 @@ public void test010() throws JavaModelException { * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=47396" */ public void test011() throws JavaModelException { - this.problems = new StringBuffer(); + this.problems = new StringBuilder(); this.sourceUnit = getCompilationUnit("Converter" , "src", "javadoc.test011", "Test.java"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ ASTNode result = runConversion(this.sourceUnit, true); assumeNotNull("No compilation unit", result); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_15.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_15.java index 420df115605..2460377e381 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_15.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_15.java @@ -116,7 +116,7 @@ public class ASTConverterJavadocTest_15 extends ConverterTestSetup { // Debug protected String prefix = ""; protected boolean debug = false; - protected StringBuffer problems; + protected StringBuilder problems; protected String compilerOption = JavaCore.IGNORE; protected List failures; protected boolean stopOnFailure = true; @@ -222,7 +222,7 @@ protected void setUp() throws Exception { super.setUp(); TEST_COUNTERS[0]++; this.failures = new ArrayList(); - this.problems = new StringBuffer(); + this.problems = new StringBuilder(); this.workingCopies = null; this.savedLevel = this.astLevel; } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_18.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_18.java index 13405ab49af..6fabb2c2155 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_18.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterJavadocTest_18.java @@ -101,7 +101,7 @@ public class ASTConverterJavadocTest_18 extends ConverterTestSetup { // Debug protected String prefix = ""; protected boolean debug = false; - protected StringBuffer problems; + protected StringBuilder problems; protected String compilerOption = JavaCore.IGNORE; protected List failures; protected boolean stopOnFailure = true; @@ -160,7 +160,7 @@ protected void setUp() throws Exception { super.setUp(); TEST_COUNTERS[0]++; this.failures = new ArrayList(); - this.problems = new StringBuffer(); + this.problems = new StringBuilder(); this.workingCopies = null; this.savedLevel = this.astLevel; } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java index 905676c9b50..619b9a094b0 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTest2.java @@ -5262,7 +5262,7 @@ public void test0571() throws CoreException, IOException { IOrdinaryClassFile classFile = getClassFile("P", "/P/test0571.jar", "", "X$Y.class"); CompilationUnit unit = (CompilationUnit) runConversion(getJLS3(), classFile, 0, true); IProblem[] problems = unit.getProblems(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, length = problems.length; i < length; i++) Util.appendProblem(buffer, problems[i], source.toCharArray(), i); assertEquals("Unexpected problems", "", buffer.toString()); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java index b0302e67a2e..abb08794d31 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTMatcherTest.java @@ -114,7 +114,7 @@ public static Test suite() { EnumConstantDeclaration EC2; Type T3; Type T4; - final StringBuffer b = new StringBuffer(); + final StringBuilder b = new StringBuilder(); int API_LEVEL; diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java index 4a2a5e5d5a2..82d3d366205 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTVisitorTest.java @@ -131,7 +131,7 @@ public static Test suite() { Type T4; String T4S; - final StringBuffer b = new StringBuffer(); + final StringBuilder b = new StringBuilder(); int API_LEVEL; diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java index e48f267dfa4..7c4cae002b0 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/AbstractASTTests.java @@ -337,7 +337,7 @@ protected ASTNode buildAST(MarkerInfo markerInfo, IClassFile classFile, boolean CompilationUnit unit = (CompilationUnit) parser.createAST(null); if (reportErrors) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); IProblem[] problems = unit.getProblems(); for (int i = 0, length = problems.length; i < length; i++) Util.appendProblem(buffer, problems[i], markerInfo.source.toCharArray(), i+1); @@ -418,7 +418,7 @@ private ASTNode[] buildASTs(String newContents, ICompilationUnit cu, int flags) } if ((flags & ICompilationUnit.FORCE_PROBLEM_DETECTION) != 0) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); IProblem[] problems = unit.getProblems(); for (int i = 0, length = problems.length; i < length; i++) Util.appendProblem(buffer, problems[i], newContents.toCharArray(), i+1); @@ -476,7 +476,7 @@ protected ASTNode[] buildASTs(int JLSLevel, String newContents, ICompilationUnit } if (reportErrors) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); IProblem[] problems = unit.getProblems(); for (int i = 0, length = problems.length; i < length; i++) Util.appendProblem(buffer, problems[i], newContents.toCharArray(), i+1); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java index aeb7407b8a6..d13d5cda1a4 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ConverterTestSetup.java @@ -864,7 +864,7 @@ protected void assertProblemsSize(CompilationUnit compilationUnit, int expectedS private void checkProblemMessages(String expectedOutput, final IProblem[] problems, final int length) { if (length != 0) { if (expectedOutput != null) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0; i < length; i++) { buffer.append(problems[i].getMessage()); if (i < length - 1) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/MarkedASTFlattener.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/MarkedASTFlattener.java index 00fc353a643..a44cdeeb51c 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/MarkedASTFlattener.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/MarkedASTFlattener.java @@ -55,7 +55,7 @@ public DefaultMarkedNodeLabelProvider(int options) { this.options = options; } - private void appendBinding(ASTNode node, StringBuffer buffer) { + private void appendBinding(ASTNode node, StringBuilder buffer) { buffer.append('['); try { IBinding binding = resolveBinding(node); @@ -89,7 +89,7 @@ private void appendBinding(ASTNode node, StringBuffer buffer) { buffer.append(']'); } - private void appendBindingFlags(IBinding binding, StringBuffer buffer) { + private void appendBindingFlags(IBinding binding, StringBuilder buffer) { boolean firstFlag = true; if (binding.isDeprecated()) { if (!firstFlag) buffer.append('|'); @@ -111,11 +111,11 @@ private void appendBindingFlags(IBinding binding, StringBuffer buffer) { } } - private void appendBindingKey(IBinding binding, StringBuffer buffer) { + private void appendBindingKey(IBinding binding, StringBuilder buffer) { buffer.append(binding.getKey()); } - private void appendBindingKind(IBinding binding, StringBuffer buffer) { + private void appendBindingKind(IBinding binding, StringBuilder buffer) { switch (binding.getKind()) { case IBinding.ANNOTATION: buffer.append("ANNOTATION");break; @@ -134,7 +134,7 @@ private void appendBindingKind(IBinding binding, StringBuffer buffer) { } } - private void appendFlags(ASTNode node, StringBuffer buffer) { + private void appendFlags(ASTNode node, StringBuilder buffer) { boolean firstFlag = true; int flags = node.getFlags(); if ((flags & ASTNode.MALFORMED) != 0) { @@ -165,7 +165,7 @@ private void appendFlags(ASTNode node, StringBuffer buffer) { } } - private void appendNodeExtendedPosition(ASTNode node, StringBuffer buffer) { + private void appendNodeExtendedPosition(ASTNode node, StringBuilder buffer) { ASTNode root = node.getRoot(); if (root.getNodeType() == ASTNode.COMPILATION_UNIT) { @@ -188,7 +188,7 @@ private void appendNodeExtendedPosition(ASTNode node, StringBuffer buffer) { } - private void appendNodePosition(ASTNode node, StringBuffer buffer) { + private void appendNodePosition(ASTNode node, StringBuilder buffer) { buffer.append('['); buffer.append(node.getStartPosition()); buffer.append(','); @@ -196,7 +196,7 @@ private void appendNodePosition(ASTNode node, StringBuffer buffer) { buffer.append(']'); } - private void appendNodeType(ASTNode node, StringBuffer buffer) { + private void appendNodeType(ASTNode node, StringBuilder buffer) { switch (node.getNodeType()) { case ASTNode.ANNOTATION_TYPE_DECLARATION : buffer.append("ANNOTATION_TYPE_DECLARATION");break; @@ -383,7 +383,7 @@ private void appendNodeType(ASTNode node, StringBuffer buffer) { @Override public String getText(ASTNode node) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); boolean first = true; @@ -495,7 +495,7 @@ public static abstract class MarkedNodeLabelProvider { private Map markerPositonInBuffer; private boolean[] foundNodeFromMarker; - private final StringBuffer markedNodesBuffer; + private final StringBuilder markedNodesBuffer; private final MarkedNodeLabelProvider labelProvider; @@ -507,12 +507,12 @@ public MarkedASTFlattener( this.reportAST = reportAST; this.reportProblems = reportProblems; - this.markedNodesBuffer = new StringBuffer(); + this.markedNodesBuffer = new StringBuilder(); this.labelProvider = labelProvider; } public String getResult() { - StringBuffer resultBuffer = new StringBuffer(); + StringBuilder resultBuffer = new StringBuilder(); if (this.reportAST) { resultBuffer.append(AST_DELIMITER); @@ -529,7 +529,7 @@ public String getResult() { resultBuffer.append(PROBLEMS_DELIMITER); resultBuffer.append('\n'); - StringBuffer problemBuffer = new StringBuffer(); + StringBuilder problemBuffer = new StringBuilder(); IProblem[] problems = this.unit.getProblems(); int problemCount = problems.length; if (problemCount != 0) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java index c84f531bb90..b8620e559ae 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ProfilingASTConvertionTest.java @@ -90,7 +90,7 @@ public String display(int value, int numberOfFiguresForRange) { if ((value % 10) == 0) { numberOfFigures = (int) (Math.log(value + 1)/ Math.log(10)); } - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); while(numberOfFigures < numberOfFiguresForRange) { buffer.append(" "); numberOfFigures++; @@ -138,7 +138,7 @@ private void printDistribution(long[] array, int increment) { */ private void printRange(int counter, int bound, int increment, int totalCounter, int length, int numberOfFiguresForRange, int numberOfFiguresForCounters) { if (counter != 0) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); int low = bound - increment; if (low != 0) { low++; @@ -265,7 +265,7 @@ public void test0000() throws JavaModelException { CompilationUnit unit = (CompilationUnit) node; assertEquals("Has problem", 0, unit.getProblems().length); TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName()); IResource resource = this.compilationUnits[i].getResource(); if (resource instanceof IFile) { @@ -303,7 +303,7 @@ public void test0001() throws JavaModelException { CompilationUnit unit = (CompilationUnit) node; assertEquals("Has problem", 0, unit.getProblems().length); TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName()); IResource resource = this.compilationUnits[i].getResource(); if (resource instanceof IFile) { @@ -342,7 +342,7 @@ public void test0002() throws JavaModelException { CompilationUnit unit = (CompilationUnit) node; assertEquals("Has problem", 0, unit.getProblems().length); TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName()); IResource resource = this.compilationUnits[i].getResource(); if (resource instanceof IFile) { @@ -382,7 +382,7 @@ public void test0003() throws JavaModelException { CompilationUnit unit = (CompilationUnit) node; assertEquals("Has problem", 0, unit.getProblems().length); TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName()); IResource resource = this.compilationUnits[i].getResource(); if (resource instanceof IFile) { @@ -422,7 +422,7 @@ public void test0004() throws JavaModelException { CompilationUnit unit = (CompilationUnit) node; assertEquals("Has problem", 0, unit.getProblems().length); TypeDeclaration typeDeclaration = (TypeDeclaration) unit.types().get(0); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(unit.getPackage().getName()).append(".").append(typeDeclaration.getName()); IResource resource = this.compilationUnits[i].getResource(); if (resource instanceof IFile) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java index 92fdcabd159..4c0099392e4 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/FormatterMassiveRegressionTests.java @@ -834,7 +834,7 @@ private static void setProfilesDir(int profiles, List subDirs) { } } -private static void appendProfiles(int profiles, StringBuffer buffer) { +private static void appendProfiles(int profiles, StringBuilder buffer) { String joinLines = null; boolean first = true; switch (profiles & PROFILE_JOIN_LINES_MASK) { @@ -1187,7 +1187,7 @@ else if (this.canCompare) { private void print() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); // Log version info buffer.append("Version : "); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/comment/CommentFormatterUtil.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/comment/CommentFormatterUtil.java index b9439574d86..eba2f4c9942 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/comment/CommentFormatterUtil.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/comment/CommentFormatterUtil.java @@ -115,7 +115,7 @@ public static String format(int kind, String source, int offset, int length, int * @since 3.1 */ private static int inferIndentationLevel(String reference, int tabSize) { - StringBuffer expanded= expandTabs(reference, tabSize); + StringBuilder expanded= expandTabs(reference, tabSize); int spaceWidth, referenceWidth; spaceWidth= 1; @@ -135,8 +135,8 @@ private static int inferIndentationLevel(String reference, int tabSize) { * @return the expanded string * @since 3.1 */ - private static StringBuffer expandTabs(String string, int tabSize) { - StringBuffer expanded= new StringBuffer(); + private static StringBuilder expandTabs(String string, int tabSize) { + StringBuilder expanded= new StringBuilder(); for (int i= 0, n= string.length(), chars= 0; i < n; i++) { char ch= string.charAt(i); if (ch == '\t') { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java index 0c97b632dc0..8864e196d30 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaModelTests.java @@ -315,7 +315,7 @@ public boolean isActive() { } public static class ProblemRequestor implements IProblemRequestor { - public StringBuffer problems; + public StringBuilder problems; public int problemCount; protected char[] unitSource; public boolean isActive = true; @@ -341,7 +341,7 @@ public void initialize(char[] source) { this.unitSource = source; } public void reset() { - this.problems = new StringBuffer(); + this.problems = new StringBuilder(); this.problemCount = 0; } } @@ -562,7 +562,7 @@ public void waitForResourceDelta() { protected DeltaListener deltaListener = new DeltaListener(); public static class LogListenerWithHistory implements ILogListener { - private final StringBuffer buffer = new StringBuffer(); + private final StringBuilder buffer = new StringBuilder(); private final List logs = new ArrayList<>(); public void logging(IStatus status, String plugin) { @@ -980,7 +980,7 @@ protected void assertResourceNotOnClasspathEntry(IJavaProject project, IResource protected void assertResourceTreeEquals(String message, String expected, Object[] resources) throws CoreException { sortResources(resources); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, length = resources.length; i < length; i++) { printResourceTree(resources[i], buffer, 0); if (i != length-1) buffer.append("\n"); @@ -996,7 +996,7 @@ protected void assertResourceTreeEquals(String message, String expected, Object[ ); } - private void printResourceTree(Object resource, StringBuffer buffer, int indent) throws CoreException { + private void printResourceTree(Object resource, StringBuilder buffer, int indent) throws CoreException { for (int i = 0; i < indent; i++) buffer.append(" "); if (resource instanceof IResource) { @@ -1134,7 +1134,7 @@ protected void assertMarkers(String message, String expectedMarkers, IMarker[] m } protected void assertMemberValuePairEquals(String expected, IMemberValuePair member) throws JavaModelException { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); appendAnnotationMember(buffer, member); String actual = buffer.toString(); if (!expected.equals(actual)) { @@ -1191,7 +1191,7 @@ protected void assertSourceEquals(String message, String expected, String actual assertEquals(message, expected, actual); } protected void assertAnnotationsEqual(String expected, IAnnotation[] annotations) throws JavaModelException { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0; i < annotations.length; i++) { IAnnotation annotation = annotations[i]; appendAnnotation(buffer, annotation); @@ -1204,7 +1204,7 @@ protected void assertAnnotationsEqual(String expected, IAnnotation[] annotations assertEquals("Unexpected annotations", expected, actual); } - protected void appendAnnotation(StringBuffer buffer, IAnnotation annotation) throws JavaModelException { + protected void appendAnnotation(StringBuilder buffer, IAnnotation annotation) throws JavaModelException { buffer.append('@'); buffer.append(annotation.getElementName()); IMemberValuePair[] members = annotation.getMemberValuePairs(); @@ -1220,7 +1220,7 @@ protected void appendAnnotation(StringBuffer buffer, IAnnotation annotation) thr } } - private void appendAnnotationMember(StringBuffer buffer, IMemberValuePair member) throws JavaModelException { + private void appendAnnotationMember(StringBuilder buffer, IMemberValuePair member) throws JavaModelException { if (member == null) { buffer.append(""); return; @@ -1248,7 +1248,7 @@ private void appendAnnotationMember(StringBuffer buffer, IMemberValuePair member } } - private void appendAnnotationMemberValue(StringBuffer buffer, Object value, int kind) throws JavaModelException { + private void appendAnnotationMemberValue(StringBuilder buffer, Object value, int kind) throws JavaModelException { if (value == null) { buffer.append(""); return; diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchGenericTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchGenericTests.java index b9a44f62a94..01ea4527075 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchGenericTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchGenericTests.java @@ -43,7 +43,7 @@ protected void setUp () throws Exception { /* * Add given line to given buffer. */ - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (buffer.length() > 0) buffer.append('\n'); buffer.append(line); } @@ -53,7 +53,7 @@ void addResultLine(StringBuffer buffer, char[] line) { */ final String cleanResults(String expected) { char[][] lines = CharOperation.splitOn('\n', expected.toCharArray()); - StringBuffer buffer = new StringBuffer(expected.length()); + StringBuilder buffer = new StringBuilder(expected.length()); for (int i=0, n=lines.length; i").toCharArray(); buffer.append(path); @@ -280,7 +280,7 @@ public int size() { public static class JavaSearchResultCollector extends SearchRequestor { int flags = SHOW_POTENTIAL; // default protected SearchMatch match; - public StringBuffer results = new StringBuffer(), line; + public StringBuilder results = new StringBuilder(), line; public int showFlavors = 0; public int count = 0; List lines = new ArrayList(); @@ -306,7 +306,7 @@ protected void writeLine() throws CoreException { try { IResource resource = this.match.getResource(); IJavaElement element = getElement(this.match); - this.line = new StringBuffer(); + this.line = new StringBuilder(); if ((this.flags & SHOW_MATCH_KIND) != 0) { String matchClassName = this.match.getClass().getName(); this.line.append(matchClassName.substring(matchClassName.lastIndexOf('.')+1)); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java index e3b39ff4858..631e785018c 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClassFileTests.java @@ -546,7 +546,7 @@ public void testAnnotations26() throws JavaModelException { "@java.lang.Deprecated\n" + "@test342757.Annot\n" + "@java.lang.Deprecated\n"; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, max = methods.length; i < max; i++) { ILocalVariable[] parameters = methods[i].getParameters(); for (int j = 0, max2 = parameters.length; j < max2; j++) { @@ -1452,7 +1452,7 @@ public void testWorkingCopy08() throws CoreException { " }\n" + "}" ); - problemRequestor.problems = new StringBuffer(); + problemRequestor.problems = new StringBuilder(); problemRequestor.problemCount = 0; copy.reconcile(ICompilationUnit.NO_AST, false/*don't force problems*/, owner, null/*no progress*/); assertProblems( @@ -1486,7 +1486,7 @@ public void testWorkingCopy09() throws CoreException { " workingcopy.X x;\n" + "}" ); - problemRequestor.problems = new StringBuffer(); + problemRequestor.problems = new StringBuilder(); problemRequestor.problemCount = 0; copy.reconcile(ICompilationUnit.NO_AST, false/*don't force problems*/, owner, null/*no progress*/); assertProblems( diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java index 84f2f16df85..e4c5304a62e 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathInitializerTests.java @@ -641,7 +641,7 @@ public void initialize(IPath containerPath, IJavaProject p) throws CoreException */ public void testContainerInitializer13() throws CoreException { IResourceChangeListener listener = new IResourceChangeListener() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); public void resourceChanged(IResourceChangeEvent event) { this.buffer.append(event.getDelta().findMember(new Path("/P1"))); } @@ -775,7 +775,7 @@ public void testContainerInitializer16() throws CoreException { */ public void testContainerInitializer17() throws CoreException { IResourceChangeListener listener = new IResourceChangeListener() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); public void resourceChanged(IResourceChangeEvent event) { this.buffer.append(event.getDelta().findMember(new Path("/P2"))); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java index 19cdf70eab7..b8b830b3660 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java @@ -5027,7 +5027,7 @@ public void testNoResourceChange05() throws CoreException { */ public void testNoResourceChange06() throws CoreException { ILogListener listener = new ILogListener(){ - private final StringBuffer buffer = new StringBuffer(); + private final StringBuilder buffer = new StringBuilder(); public void logging(IStatus status, String plugin) { this.buffer.append(status); this.buffer.append('\n'); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java index c7cd4edee2c..4fbb8fb335f 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java @@ -318,7 +318,7 @@ public int compare(Object o1, Object o2) { */ public String getResultsWithoutSorting() { if(this.proposalsPtr < 0) return ""; - StringBuffer buffer = printProposal(this.proposals[0]); + StringBuilder buffer = printProposal(this.proposals[0]); for(int i = 1; i <=this.proposalsPtr; i++) { if(i > 0) buffer.append('\n'); buffer.append(printProposal(this.proposals[i])); @@ -336,12 +336,12 @@ public String[] getStringsResult() { return strings; } - protected StringBuffer printProposal(CompletionProposal proposal) { - StringBuffer buffer = new StringBuffer(); + protected StringBuilder printProposal(CompletionProposal proposal) { + StringBuilder buffer = new StringBuilder(); return printProposal(proposal, 0, buffer); } - protected StringBuffer printProposal(CompletionProposal proposal, int tab, StringBuffer buffer) { + protected StringBuilder printProposal(CompletionProposal proposal, int tab, StringBuilder buffer) { for (int i = 0; i < tab; i++) { buffer.append(" "); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/DefaultJavaElementComparator.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/DefaultJavaElementComparator.java index e5d49746c3c..a01cf97431d 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/DefaultJavaElementComparator.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/DefaultJavaElementComparator.java @@ -257,7 +257,7 @@ private String buildSignature(BodyDeclaration node) { switch(node.getNodeType()) { case ASTNode.METHOD_DECLARATION : MethodDeclaration methodDeclaration = (MethodDeclaration) node; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(methodDeclaration.getName().getIdentifier()); final List parameters = methodDeclaration.parameters(); int length1 = parameters.size(); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorEquivalentTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorEquivalentTests.java index 7c2656cd5b3..77cb8e559e7 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorEquivalentTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorEquivalentTests.java @@ -46,7 +46,7 @@ public static Test suite() { * Add line to result only if it is not an erasure match rule. */ @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (!CharOperation.match(RESULT_ERASURE_MATCH, line, true)) { super.addResultLine(buffer, line); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorExactTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorExactTests.java index 4010f27ba86..a4d91c70b75 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorExactTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorExactTests.java @@ -46,7 +46,7 @@ public static Test suite() { * Do not add line if this is not an exact match rule. */ @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (CharOperation.match(RESULT_EXACT_MATCH, line, true)) { super.addResultLine(buffer, line); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorTests.java index 077557a8ad7..685e22fb8ac 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericConstructorTests.java @@ -70,7 +70,7 @@ long removeFirstTypeArgument(char[] line) { } @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { long positions = removeFirstTypeArgument(line); if (buffer.length() > 0) buffer.append('\n'); if (positions != -1) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodEquivalentTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodEquivalentTests.java index 20ddbfd4c1e..4e94d9008b3 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodEquivalentTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodEquivalentTests.java @@ -47,7 +47,7 @@ public static Test suite() { * Add line to result only if it is not an erasure match rule. */ @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (!CharOperation.match(RESULT_ERASURE_MATCH, line, true) && !CharOperation.match(RESULT_POTENTIAL_MATCH, line, true)) { super.addResultLine(buffer, line); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodExactTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodExactTests.java index 57ee599028e..392419374aa 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodExactTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodExactTests.java @@ -46,7 +46,7 @@ public static Test suite() { * Do not add line if this is not an exact match rule. */ @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (CharOperation.match(RESULT_EXACT_MATCH, line, true)) { super.addResultLine(buffer, line); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodTests.java index dcdc92863d9..12401cbcec0 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericMethodTests.java @@ -70,7 +70,7 @@ long removeFirstTypeArgument(char[] line) { } @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { long positions = removeFirstTypeArgument(line); if (buffer.length() > 0) buffer.append('\n'); if (positions != -1) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeEquivalentTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeEquivalentTests.java index 79e17c42303..3fa86bb4ae1 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeEquivalentTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeEquivalentTests.java @@ -48,7 +48,7 @@ public static Test suite() { * Add line to result only if it is not an erasure match rule. */ @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (!CharOperation.match(RESULT_ERASURE_MATCH, line, true)) { super.addResultLine(buffer, line); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeExactTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeExactTests.java index 6d8ff0599fc..ad8cdfa3636 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeExactTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeExactTests.java @@ -55,7 +55,7 @@ public static Test suite() { * Do not add line if this is not an exact match rule. */ @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { if (CharOperation.match(RESULT_EXACT_MATCH, line, true)) { super.addResultLine(buffer, line); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeTests.java index ba1873351b7..3f63cf416f5 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchGenericTypeTests.java @@ -87,7 +87,7 @@ int[] removeLastTypeArgument(char[] line) { } @Override - void addResultLine(StringBuffer buffer, char[] line) { + void addResultLine(StringBuilder buffer, char[] line) { int[] positions = removeLastTypeArgument(line); if (buffer.length() > 0) buffer.append('\n'); if (positions != null) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java index e36a0f509fc..f78c3187274 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ModifyingResourceTests.java @@ -234,11 +234,11 @@ protected IFile editFile(String path, String content) throws CoreException { * of the tree. */ protected String expandAll(IJavaElement element) throws CoreException { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); this.expandAll(element, 0, buffer); return buffer.toString(); } -private void expandAll(IJavaElement element, int tab, StringBuffer buffer) throws CoreException { +private void expandAll(IJavaElement element, int tab, StringBuilder buffer) throws CoreException { IJavaElement[] children = null; // force opening of element by getting its children if (element instanceof IParent) { diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RootManipulationsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RootManipulationsTests.java index f401d19ce70..b239e0ee0fc 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RootManipulationsTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/RootManipulationsTests.java @@ -33,7 +33,7 @@ public RootManipulationsTests(String name) { super(name); } protected void assertJavaProject(String expected, IJavaProject project) throws CoreException { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); populate(buffer, project, 0); String actual = buffer.toString(); @@ -79,7 +79,7 @@ protected void move(IPackageFragmentRoot root, IPath destination, IClasspathEntr sibling, null); } -protected void populate(StringBuffer buffer, IJavaElement element, int indent) throws CoreException { +protected void populate(StringBuilder buffer, IJavaElement element, int indent) throws CoreException { if (!(element instanceof IParent) || !(element instanceof IOpenable)) return; if (buffer.length() != 0) { @@ -117,7 +117,7 @@ protected void populate(StringBuffer buffer, IJavaElement element, int indent) t } } } -protected void populate(StringBuffer buffer, Object nonJavaResource, int indent) { +protected void populate(StringBuilder buffer, Object nonJavaResource, int indent) { if (buffer.length() != 0) { buffer.append("\n"); } diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java index ad92d4d3137..1f0f5f087ac 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SearchTests.java @@ -94,7 +94,7 @@ public void acceptMethod( int modifiers, String path, int methodIndex) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); char c = '.'; char[] noname = new String("").toCharArray(); buffer.append(path); @@ -138,7 +138,7 @@ public void acceptMethod( buffer.append(')'); this.results.add(buffer.toString()); } - static void checkAndAddtoBuffer(StringBuffer buffer, char[] precond, char c) { + static void checkAndAddtoBuffer(StringBuilder buffer, char[] precond, char c) { if (precond == null || precond.length == 0) return; buffer.append(precond); buffer.append(c); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java index d9d9e55fdf2..de3047a6c11 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/TypeResolveTests.java @@ -442,7 +442,7 @@ public void testParamAnnotations3() throws CoreException { assertEquals(annotationString2, iAnnotation.toString()); IMemberValuePair[] memberValuePairs = iAnnotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - StringBuffer output = new StringBuffer(); + StringBuilder output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); @@ -496,7 +496,7 @@ public void testParamAnnotations4() throws CoreException, IOException { assertEquals("@p.Marker [in Test(int, java.lang.String, int) [in X [in X.class [in p [in lib334783_2.jar [in P]]]]]]", annotation.toString()); IMemberValuePair[] memberValuePairs = annotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - StringBuffer output = new StringBuffer(); + StringBuilder output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); @@ -515,7 +515,7 @@ public void testParamAnnotations4() throws CoreException, IOException { assertEquals(annotationString2, annotation.toString()); memberValuePairs = annotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - output = new StringBuffer(); + output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); @@ -571,7 +571,7 @@ public void testParamAnnotations5() throws CoreException, IOException { assertEquals("@p.Marker [in Test(int, java.lang.String, int) [in X [in X.class [in p [in lib334783_3.jar [in P]]]]]]", annotation.toString()); IMemberValuePair[] memberValuePairs = annotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - StringBuffer output = new StringBuffer(); + StringBuilder output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); @@ -583,7 +583,7 @@ public void testParamAnnotations5() throws CoreException, IOException { assertEquals(annotationString2, annotation.toString()); memberValuePairs = annotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - output = new StringBuffer(); + output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); @@ -692,7 +692,7 @@ public void testParamAnnotations8() throws CoreException, IOException { assertEquals("@p.Marker [in X(int, java.lang.String, int) [in X [in X.class [in p [in lib334783_3.jar [in P]]]]]]", annotation.toString()); IMemberValuePair[] memberValuePairs = annotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - StringBuffer output = new StringBuffer(); + StringBuilder output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); @@ -704,7 +704,7 @@ public void testParamAnnotations8() throws CoreException, IOException { assertEquals(annotationString2, annotation.toString()); memberValuePairs = annotation.getMemberValuePairs(); assertEquals("Wrong number of pairs", 1, memberValuePairs.length); - output = new StringBuffer(); + output = new StringBuilder(); output.append(memberValuePairs[0].getMemberName()); output.append(' '); output.append(memberValuePairs[0].getValue()); diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java index 5849b9a73de..d290980b09d 100644 --- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java +++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/AllPerformanceTests.java @@ -72,9 +72,9 @@ public static Test suite() { // Display warning if one of subset static fields is not null // (this may modify tests run order and make stored results invalid) - StringBuffer buffer = null; + StringBuilder buffer = null; if (TestCase.TESTS_NAMES != null) { - buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - following subset is still defined and may alter tests order:\n"); buffer.append(" + TESTS_NAMES = new String[] { "); int length = TestCase.TESTS_NAMES.length; @@ -88,7 +88,7 @@ public static Test suite() { } if (TestCase.TESTS_PREFIX != null) { if (buffer == null) { - buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - following subset is still defined and may alter tests order:\n"); } buffer.append(" + TESTS_PREFIX = "); @@ -99,7 +99,7 @@ public static Test suite() { } if (TestCase.TESTS_NUMBERS != null) { if (buffer == null) { - buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - following subset is still defined and may alter tests order:\n"); } buffer.append(" + TESTS_NUMBERS = new int[] { "); @@ -112,7 +112,7 @@ public static Test suite() { } if (TestCase.TESTS_RANGE != null) { if (buffer == null) { - buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - following subset is still defined and may alter tests order:\n"); } buffer.append(" + TESTS_RANGE = new int[] { "); @@ -128,7 +128,7 @@ public static Test suite() { long maxMem = Runtime.getRuntime().maxMemory(); // -Xmx boolean tooMuch = false; if (maxMem < (MAX_MEM*0.98) || (tooMuch = maxMem > (MAX_MEM*1.02))) { - if (buffer == null) buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + if (buffer == null) buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - "); buffer.append(tooMuch ? "too much " : "not enough "); buffer.append("max memory allocated ("); @@ -141,7 +141,7 @@ public static Test suite() { long totalMem = Runtime.getRuntime().totalMemory(); // -Xms tooMuch = false; if (totalMem < (TOTAL_MEM*0.98)|| (tooMuch = totalMem > (TOTAL_MEM*1.02))) { - if (buffer == null) buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + if (buffer == null) buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - "); buffer.append(tooMuch ? "too much " : "not enough "); buffer.append("total memory allocated ("); diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java index 425b9e48271..40bb1bbb0ac 100644 --- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java +++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceASTTests.java @@ -792,7 +792,7 @@ public void acceptAST(ICompilationUnit source, CompilationUnit ast) { IProblem[] problems = ast.getProblems(); int length = problems.length; if (length > 0) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i=0; i 0) { - StringBuffer debugBuffer = new StringBuffer(); + StringBuilder debugBuffer = new StringBuilder(); for (int i=0; i (MAX_MEM*1.02))) { - if (buffer == null) buffer = new StringBuffer("WARNING: Performance tests results may be invalid !!!\n"); + if (buffer == null) buffer = new StringBuilder("WARNING: Performance tests results may be invalid !!!\n"); buffer.append(" - "); buffer.append(tooMuch ? "too much " : "not enough "); buffer.append("max memory allocated ("); diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java index 63a5fc36ec9..83659a5f410 100644 --- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java +++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceModelTests.java @@ -342,7 +342,7 @@ protected void assertElementsEqual(String message, String expected, IJavaElement * @see org.eclipse.jdt.core.tests.model.AbstractJavaModelTests#assertElementsEqual(String, String, IJavaElement[], boolean) */ protected void assertElementsEqual(String message, String expected, IJavaElement[] elements, boolean showResolvedInfo) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); if (elements != null) { for (int i = 0, length = elements.length; i < length; i++){ JavaElement element = (JavaElement)elements[i]; @@ -766,7 +766,7 @@ public void testPerfReconcileBigFileWithSyntaxError() throws JavaModelException " \"}\\n\"" + " );\n" + "}\n"; - StringBuffer bigContents = new StringBuffer(); + StringBuilder bigContents = new StringBuilder(); bigContents.append("public class BigCU {\n"); int fooIndex = 0; while (fooIndex < 2000) { // add 2000 methods (so that source is close to 1MB) @@ -817,7 +817,7 @@ public void testReconcileDuplicates() throws JavaModelException { tagAsSummary("Reconcile editor change on file with lots of duplicates", false); // do NOT put in fingerprint // build big file contents - StringBuffer contents = new StringBuffer(); + StringBuilder contents = new StringBuilder(); contents.append("public class CUWithDuplicates {\n"); int fooIndex = 0; while (fooIndex < 2000) { // add 2000 duplicate methods @@ -867,7 +867,7 @@ public void testPerfDeleteLotsOfMembersAndReconcile() throws JavaModelException tagAsSummary("Reconcile editor change after deleting lots of members", false); // do NOT put in fingerprint // build big file contents - StringBuffer contents = new StringBuffer(); + StringBuilder contents = new StringBuilder(); contents.append("public class LotsOfMembers {\n"); int fooIndex = 0; while (fooIndex < 15000) { // add 15000 methods diff --git a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java index 4d40a615782..743dfe253c3 100644 --- a/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java +++ b/org.eclipse.jdt.core.tests.performance/src/org/eclipse/jdt/core/tests/performance/FullSourceWorkspaceTests.java @@ -218,7 +218,7 @@ protected static String compliance() { // Scenario information String scenarioReadableName, scenarioShortName; - StringBuffer scenarioComment; + StringBuilder scenarioComment; static Map SCENARII_COMMENT = new HashMap(); // Time measuring @@ -514,15 +514,15 @@ protected void logPerfResult(PrintStream[] logStreams, int count) { } // Update comment buffers - StringBuffer[] scenarioComments = (StringBuffer[]) SCENARII_COMMENT.get(getClass()); + StringBuilder[] scenarioComments = (StringBuilder[]) SCENARII_COMMENT.get(getClass()); if (scenarioComments == null) { - scenarioComments = new StringBuffer[length]; + scenarioComments = new StringBuilder[length]; SCENARII_COMMENT.put(getClass(), scenarioComments); } for (int i=0; i'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnContinueStatement.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnContinueStatement.java index 72e1259e5ae..c98d04aa4ea 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnContinueStatement.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnContinueStatement.java @@ -39,7 +39,7 @@ public void resolve(BlockScope scope) { throw new CompletionNodeFound(this, scope); } @Override - public StringBuffer printStatement(int indent, StringBuffer output) { + public StringBuilder printStatement(int indent, StringBuilder output) { printIndent(indent, output); output.append("continue "); //$NON-NLS-1$ output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java index 6bab9cda86d..3b43e82b192 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnJavadocQualifiedTypeReference.java @@ -57,7 +57,7 @@ public int getCompletionFlags() { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java index d59ca2c286b..fbf609fe5c8 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword1.java @@ -44,7 +44,7 @@ protected TypeBinding getTypeBinding(Scope scope) { throw new CompletionNodeFound(this, scope); } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ return output.append("'); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java index 32fcd6cc3c5..f7a4f198292 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword2.java @@ -33,7 +33,7 @@ public char[][] getPossibleKeywords() { return this.possibleKeywords; } @Override - public StringBuffer print(int indent, StringBuffer output, boolean withOnDemand) { + public StringBuilder print(int indent, StringBuilder output, boolean withOnDemand) { return printIndent(indent, output).append("'); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java index 42b606b1a55..0679fae9a4b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnKeyword3.java @@ -41,7 +41,7 @@ public boolean afterTryOrCatch() { return this.tryOrCatch; } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return output.append("'); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java index 5104513857f..b027b835ae9 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnLocalName.java @@ -36,7 +36,7 @@ public void resolve(BlockScope scope) { } @Override - public StringBuffer printAsExpression(int indent, StringBuffer output) { + public StringBuilder printAsExpression(int indent, StringBuilder output) { printIndent(indent, output); output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java index 23e40e325c3..e81fb3a214d 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMemberValueName.java @@ -34,7 +34,7 @@ public CompletionOnMemberValueName(char[] token, int sourceStart, int sourceEnd) } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java index ae0aa1964f2..80fe2f9bcd7 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnMessageSend.java @@ -68,7 +68,7 @@ public TypeBinding resolveType(BlockScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java index 52397359f9e..a2baea0246b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnParameterizedQualifiedTypeReference.java @@ -94,7 +94,7 @@ public TypeBinding resolveType(ClassScope scope, int location) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { switch (this.kind) { case K_CLASS : output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java index 03cfe83e008..ac44a052aef 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionOnSingleTypeReference.java @@ -91,7 +91,7 @@ public boolean isSuperType(){ return this.kind == K_CLASS || this.kind == K_INTERFACE; } @Override -public StringBuffer printExpression(int indent, StringBuffer output){ +public StringBuilder printExpression(int indent, StringBuilder output){ switch (this.kind) { case K_CLASS : output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java index 16ccdcb9b8d..3eebefa6547 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/complete/CompletionParser.java @@ -6187,7 +6187,7 @@ protected boolean assistNodeNeedsStacking() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("elementKindStack : int[] = {"); //$NON-NLS-1$ for (int i = 0; i <= this.elementPtr; i++) { buffer.append(String.valueOf(this.elementKindStack[i])).append(','); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java index 6bc52442fc0..2236e1c8e17 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceField.java @@ -69,7 +69,7 @@ public boolean isResolved() { } @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info,boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info,boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo && isResolved()); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java index 89e22cf9c3b..a6b9837c97a 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceMethod.java @@ -70,7 +70,7 @@ public boolean isResolved() { } @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info,boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info,boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo && isResolved()); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java index 2f4157b96a5..4e0bd328b31 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/impl/AssistSourceType.java @@ -81,7 +81,7 @@ public boolean isResolved() { } @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info,boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info,boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo && isResolved()); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java index 8f388598246..e3d689a0ee1 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionJavadoc.java @@ -33,7 +33,7 @@ public SelectionJavadoc(int sourceStart, int sourceEnd) { } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { super.print(indent, output); if (this.selectedNode != null) { String selectedString = null; diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java index 5634b5b2142..d6b1d6946e0 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnArgumentName.java @@ -39,7 +39,7 @@ public TypeBinding bind(MethodScope scope, TypeBinding typeBinding, boolean used } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output); output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java index 725387edd00..453112dd54b 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnFieldType.java @@ -26,7 +26,7 @@ public SelectionOnFieldType(TypeReference type) { this.name = CharOperation.NO_CHAR; } @Override - public StringBuffer printStatement(int tab, StringBuffer output) { + public StringBuilder printStatement(int tab, StringBuilder output) { return this.type.print(tab, output).append(';'); } } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java index d2e12179284..dff0a74caed 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnImportReference.java @@ -40,7 +40,7 @@ public SelectionOnImportReference(char[][] tokens , long[] positions, int modifi super(tokens, positions, false, modifiers); } @Override -public StringBuffer print(int indent, StringBuffer output, boolean withOnDemand) { +public StringBuilder print(int indent, StringBuilder output, boolean withOnDemand) { printIndent(indent, output).append(""); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java index 867db743fa4..57a9ffe94d9 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnLocalName.java @@ -51,7 +51,7 @@ public void resolve(BlockScope scope) { } @Override - public StringBuffer printAsExpression(int indent, StringBuffer output) { + public StringBuilder printAsExpression(int indent, StringBuilder output) { printIndent(indent, output); output.append(" 0) output.append('.'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java index b9a5a5045ee..8a4df654cbb 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnNameOfMemberValuePair.java @@ -26,7 +26,7 @@ public SelectionOnNameOfMemberValuePair(char[] token, int sourceStart, int sourc } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { output.append(""); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java index ef874f0f3a5..6bd349c7a7f 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageReference.java @@ -40,7 +40,7 @@ public SelectionOnPackageReference(char[][] tokens , long[] positions) { super(tokens, positions, false, ClassFileConstants.AccDefault); } @Override -public StringBuffer print(int tab, StringBuffer output, boolean withOnDemand) { +public StringBuilder print(int tab, StringBuilder output, boolean withOnDemand) { printIndent(tab, output).append(" 0) output.append('.'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java index a3fd664ad6f..b690bfbbae5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnPackageVisibilityReference.java @@ -38,7 +38,7 @@ public SelectionOnPackageVisibilityReference(char[][] tokens, long[] positions) } @Override - public StringBuffer print(int indent, StringBuffer output) { + public StringBuilder print(int indent, StringBuilder output) { printIndent(indent, output).append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java index 998b39392a2..8af8a930442 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedTypeReference.java @@ -67,7 +67,7 @@ protected TypeBinding getTypeBinding(Scope scope) { throw new SelectionNodeFound(binding); } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java index aa772a936ea..f606f77fa0e 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleNameReference.java @@ -81,7 +81,7 @@ public TypeBinding resolveType(BlockScope scope) { throw new SelectionNodeFound(this.binding); } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { output.append("'); } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java index adca5ede29b..4b144294a92 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSingleTypeReference.java @@ -61,7 +61,7 @@ protected TypeBinding getTypeBinding(Scope scope) { throw new SelectionNodeFound(binding); } @Override -public StringBuffer printExpression(int indent, StringBuffer output) { +public StringBuilder printExpression(int indent, StringBuilder output) { return output.append("');//$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java index 4e835aa07c8..01640c2b485 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnSuperReference.java @@ -46,7 +46,7 @@ public SelectionOnSuperReference(int pos, int sourceEnd) { super(pos, sourceEnd); } @Override -public StringBuffer printExpression(int indent, StringBuffer output){ +public StringBuilder printExpression(int indent, StringBuilder output){ output.append("'); diff --git a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java index 9ddd1237106..ad177300ab5 100644 --- a/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java +++ b/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionParser.java @@ -1228,7 +1228,7 @@ public TypeBinding resolveType(BlockScope scope) { return null; } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return output; } }); @@ -1280,7 +1280,7 @@ public TypeBinding resolveType(BlockScope scope) { return null; } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return output; } }); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java index eb566f36810..141585a5ce5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java @@ -3420,7 +3420,7 @@ public final void setSourceRange(int startPosition, int length) { */ @Override public final String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); int p = buffer.length(); try { appendDebugString(buffer); @@ -3453,7 +3453,7 @@ final String standardToString() { * * @param buffer the string buffer to append to */ - void appendDebugString(StringBuffer buffer) { + void appendDebugString(StringBuilder buffer) { // print the subtree by default appendPrintString(buffer); } @@ -3464,7 +3464,7 @@ void appendDebugString(StringBuffer buffer) { * * @param buffer the string buffer to append to */ - final void appendPrintString(StringBuffer buffer) { + final void appendPrintString(StringBuilder buffer) { NaiveASTFlattener printer = new NaiveASTFlattener(); accept(printer); buffer.append(printer.getResult()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java index 786e83a644e..b3d1dd87ea0 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java @@ -303,7 +303,7 @@ public char charValue() { * @param value the character value */ public void setCharValue(char value) { - StringBuffer b = new StringBuffer(3); + StringBuilder b = new StringBuilder(3); b.append('\''); // opening delimiter Util.appendEscapedChar(b, value, false); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java index 18e5736fa3c..7bd8a78f50e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePairBinding.java @@ -35,7 +35,7 @@ class MemberValuePairBinding implements IMemberValuePairBinding { protected Object value = null; protected BindingResolver bindingResolver; - static void appendValue(Object value, StringBuffer buffer) { + static void appendValue(Object value, StringBuilder buffer) { if (value instanceof Object[]) { Object[] values = (Object[]) value; buffer.append('{'); @@ -245,7 +245,7 @@ public boolean isSynthetic() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append(getName()); buffer.append(" = "); //$NON-NLS-1$ appendValue(getValue(), buffer); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleQualifiedName.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleQualifiedName.java index e040b584fdd..993902badd1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleQualifiedName.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ModuleQualifiedName.java @@ -228,7 +228,7 @@ public void setName(Name name) { } @Override - void appendName(StringBuffer buffer) { + void appendName(StringBuilder buffer) { getModuleQualifier().appendName(buffer); buffer.append('/'); if (getName() != null) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java index eeb937b5dcb..805a38574b5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java @@ -103,7 +103,7 @@ public final String getFullyQualifiedName() { // avoid creating garbage for common case return ((SimpleName) this).getIdentifier(); } else { - StringBuffer buffer = new StringBuffer(50); + StringBuilder buffer = new StringBuilder(50); appendName(buffer); return new String(buffer); } @@ -116,5 +116,5 @@ public final String getFullyQualifiedName() { * @param buffer the buffer * @since 3.0 */ - abstract void appendName(StringBuffer buffer); + abstract void appendName(StringBuilder buffer); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java index 1f2ad27acca..8c5c8c4b5dc 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java @@ -245,7 +245,7 @@ public void setName(SimpleName name) { } @Override - void appendName(StringBuffer buffer) { + void appendName(StringBuilder buffer) { getQualifier().appendName(buffer); buffer.append('.'); getName().appendName(buffer); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java index 29acce24e41..d09dd867cd9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java @@ -198,7 +198,7 @@ public String getName() { brackets[i] = ']'; brackets[i - 1] = '['; } - StringBuffer buffer = new StringBuffer(getInternalName()); + StringBuilder buffer = new StringBuilder(getInternalName()); buffer.append(brackets); return String.valueOf(buffer); } @@ -264,7 +264,7 @@ public IPackageBinding getPackage() { public String getQualifiedName() { ReferenceBinding referenceBinding = getReferenceBinding(); if (referenceBinding != null) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); char[] brackets = new char[this.dimensions * 2]; for (int i = this.dimensions * 2 - 1; i >= 0; i -= 2) { brackets[i] = ']'; @@ -515,7 +515,7 @@ public IJavaElement getJavaElement() { @Override public String getKey() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("Recovered#"); //$NON-NLS-1$ if (this.innerTypeBinding != null) { buffer.append("innerTypeBinding") //$NON-NLS-1$ @@ -582,7 +582,7 @@ private String getTypeNameFrom(Type type) { return getTypeNameFrom(type); case ASTNode.PARAMETERIZED_TYPE : ParameterizedType parameterizedType = (ParameterizedType) type; - StringBuffer buffer = new StringBuffer(getTypeNameFrom(parameterizedType.getType())); + StringBuilder buffer = new StringBuilder(getTypeNameFrom(parameterizedType.getType())); ITypeBinding[] tArguments = getTypeArguments(); final int typeArgumentsLength = tArguments.length; if (typeArgumentsLength != 0) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredVariableBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredVariableBinding.java index 2997f84307f..e54da5ec718 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredVariableBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredVariableBinding.java @@ -103,7 +103,7 @@ public IJavaElement getJavaElement() { @Override public String getKey() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("Recovered#"); //$NON-NLS-1$ if (this.variableDeclaration != null) { buffer diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java index 66cc5c1c7a6..5e671e6f6e9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java @@ -357,7 +357,7 @@ public boolean isDeclaration() { } @Override - void appendName(StringBuffer buffer) { + void appendName(StringBuilder buffer) { buffer.append(getIdentifier()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java index fb7212264c2..1f42c3b4578 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java @@ -258,7 +258,7 @@ public void setLiteralValue(String value) { throw new IllegalArgumentException(); } int len = value.length(); - StringBuffer b = new StringBuffer(len + 2); + StringBuilder b = new StringBuilder(len + 2); b.append("\""); // opening delimiter //$NON-NLS-1$ for (int i = 0; i < len; i++) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java index 7b53aed9533..ac44095d159 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java @@ -157,7 +157,7 @@ public String getBinaryName() { } else if (this.binding.isTypeVariable()) { TypeVariableBinding typeVariableBinding = (TypeVariableBinding) this.binding; org.eclipse.jdt.internal.compiler.lookup.Binding declaring = typeVariableBinding.declaringElement; - StringBuffer binaryName = new StringBuffer(); + StringBuilder binaryName = new StringBuilder(); switch(declaring.kind()) { case org.eclipse.jdt.internal.compiler.lookup.Binding.METHOD : MethodBinding methodBinding = (MethodBinding) declaring; @@ -629,13 +629,13 @@ public int getModifiers() { @Override public String getName() { - StringBuffer buffer; + StringBuilder buffer; switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE: WildcardBinding wildcardBinding = (WildcardBinding) this.binding; - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append(TypeConstants.WILDCARD_NAME); if (wildcardBinding.bound != null) { switch(wildcardBinding.boundKind) { @@ -658,7 +658,7 @@ public String getName() { case Binding.PARAMETERIZED_TYPE : ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBinding) this.binding; - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append(parameterizedTypeBinding.sourceName()); ITypeBinding[] tArguments = getTypeArguments(); final int typeArgumentsLength = tArguments.length; @@ -688,7 +688,7 @@ public String getName() { brackets[i] = ']'; brackets[i - 1] = '['; } - buffer = new StringBuffer(elementType.getName()); + buffer = new StringBuilder(elementType.getName()); buffer.append(brackets); return String.valueOf(buffer); @@ -728,13 +728,13 @@ public IPackageBinding getPackage() { */ @Override public String getQualifiedName() { - StringBuffer buffer; + StringBuilder buffer; switch (this.binding.kind()) { case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE: WildcardBinding wildcardBinding = (WildcardBinding) this.binding; - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer.append(TypeConstants.WILDCARD_NAME); final ITypeBinding bound = getBound(); if (bound != null) { @@ -763,7 +763,7 @@ public String getQualifiedName() { brackets[i] = ']'; brackets[i - 1] = '['; } - buffer = new StringBuffer(elementType.getQualifiedName()); + buffer = new StringBuilder(elementType.getQualifiedName()); buffer.append(brackets); return String.valueOf(buffer); @@ -778,7 +778,7 @@ public String getQualifiedName() { if (this.binding.isLocalType()) { return NO_NAME; } - buffer = new StringBuffer(); + buffer = new StringBuilder(); if (isMember()) { buffer .append(getDeclaringClass().getQualifiedName()) @@ -822,7 +822,7 @@ public String getQualifiedName() { return new String(baseTypeBinding.simpleName); } if (isMember()) { - buffer = new StringBuffer(); + buffer = new StringBuilder(); buffer .append(getDeclaringClass().getQualifiedName()) .append('.'); @@ -830,7 +830,7 @@ public String getQualifiedName() { return String.valueOf(buffer); } PackageBinding packageBinding = this.binding.getPackage(); - buffer = new StringBuffer(); + buffer = new StringBuilder(); if (packageBinding != null && packageBinding.compoundName != CharOperation.NO_CHAR_CHAR) { buffer.append(CharOperation.concatWith(packageBinding.compoundName, '.')).append('.'); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java index 96d0497e714..eea831b9db0 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/NaiveASTFlattener.java @@ -95,7 +95,7 @@ public class NaiveASTFlattener extends ASTVisitor { * The string buffer into which the serialized representation of the AST is * written. */ - protected StringBuffer buffer; + protected StringBuilder buffer; private int indent = 0; @@ -103,7 +103,7 @@ public class NaiveASTFlattener extends ASTVisitor { * Creates a new AST printer. */ public NaiveASTFlattener() { - this.buffer = new StringBuffer(); + this.buffer = new StringBuilder(); } /** diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java index 148d3f744a3..addcc7d86db 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/SourceRangeVerifier.java @@ -30,7 +30,7 @@ public class SourceRangeVerifier extends ASTVisitor { public static boolean DEBUG = false; public static boolean DEBUG_THROW = false; - private StringBuffer bugs; + private StringBuilder bugs; /** * Verifies proper node nesting as specified in {@link ASTParser#setKind(int)}: @@ -44,7 +44,7 @@ public class SourceRangeVerifier extends ASTVisitor { * @return null if everything is OK; a list of errors otherwise */ public String process(ASTNode node) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); this.bugs = buffer; node.accept(this); this.bugs = null; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java index de6fea9091c..ac3e75126ad 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteAnalyzer.java @@ -1586,13 +1586,13 @@ private void rewriteModifiers(ASTNode parent, StructuralPropertyDescriptor prope if (startPos != nextStart) { int visibilityModifiers= addedModifiers & (Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED); if (visibilityModifiers != 0) { - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); ASTRewriteFlattener.printModifiers(visibilityModifiers, buf); doTextInsert(startPos, buf.toString(), editGroup); addedModifiers &= ~visibilityModifiers; } } - StringBuffer buf= new StringBuffer(); + StringBuilder buf= new StringBuilder(); ASTRewriteFlattener.printModifiers(addedModifiers, buf); doTextInsert(nextStart, buf.toString(), editGroup); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java index 4bed38386de..db237442f4b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFlattener.java @@ -104,12 +104,12 @@ public static String asString(ASTNode node, RewriteEventStore store) { return flattener.getResult(); } - protected StringBuffer result; + protected StringBuilder result; private final RewriteEventStore store; public ASTRewriteFlattener(RewriteEventStore store) { this.store= store; - this.result= new StringBuffer(); + this.result= new StringBuilder(); } /** @@ -134,7 +134,7 @@ public void reset() { * @param modifiers the modifiers * @param buf The StringBuffer to write the result to. */ - public static void printModifiers(int modifiers, StringBuffer buf) { + public static void printModifiers(int modifiers, StringBuilder buf) { if (Modifier.isPublic(modifiers)) { buf.append("public "); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java index 469ece42a7d..902f6daebcb 100644 --- a/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java +++ b/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetThisReference.java @@ -103,7 +103,7 @@ public boolean isTypeAccess(){ } @Override - public StringBuffer printExpression(int indent, StringBuffer output){ + public StringBuilder printExpression(int indent, StringBuilder output){ char[] declaringType = this.evaluationContext.declaringTypeName; output.append('('); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java index a2b76fb20d4..f663a5abfd8 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementParser.java @@ -1073,7 +1073,7 @@ public void traverse(ASTVisitor visitor, ClassScope scope) { } @Override - public StringBuffer printExpression(int indent, StringBuffer output) { + public StringBuilder printExpression(int indent, StringBuilder output) { return output.append(this.token); } @Override diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java index 226d1f299a9..67dec15bf33 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/AbstractModule.java @@ -70,7 +70,7 @@ public IModuleReference[] getRequiredModules() throws JavaModelException { return ModuleDescriptionInfo.NO_REQUIRES; } @Override - public void toStringContent(StringBuffer buffer, String lineDelimiter) throws JavaModelException { + public void toStringContent(StringBuilder buffer, String lineDelimiter) throws JavaModelException { buffer.append("automatic module "); //$NON-NLS-1$ buffer.append(this.name); } @@ -156,7 +156,7 @@ default String[] getRequiredModuleNames() throws JavaModelException { } default String toString(String lineDelimiter) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); try { toStringContent(buffer, lineDelimiter); } catch (JavaModelException e) { @@ -165,7 +165,7 @@ default String toString(String lineDelimiter) { } return buffer.toString(); } - default void toStringContent(StringBuffer buffer, String lineDelimiter) throws JavaModelException { + default void toStringContent(StringBuilder buffer, String lineDelimiter) throws JavaModelException { IPackageExport[] exports = getExportedPackages(); IModuleReference[] requires = getRequiredModules(); buffer.append("module "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Annotation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Annotation.java index 6fff025fbb5..912f0fb381c 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Annotation.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Annotation.java @@ -146,7 +146,7 @@ public int hashCode() { } @Override - protected void toStringName(StringBuffer buffer) { + protected void toStringName(StringBuilder buffer) { buffer.append('@'); buffer.append(getElementName()); } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryField.java index 551b5a3778c..19523e7ec9c 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryField.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryField.java @@ -113,7 +113,7 @@ public JavaElement resolved(Binding binding) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java index 398da258b09..d1669736808 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java @@ -215,7 +215,7 @@ public int getFlags() throws JavaModelException { * @see JavaElement#getHandleMemento(StringBuffer) */ @Override -protected void getHandleMemento(StringBuffer buff) { +protected void getHandleMemento(StringBuilder buff) { getParent().getHandleMemento(buff); char delimiter = getHandleMementoDelimiter(); buff.append(delimiter); @@ -692,7 +692,7 @@ public JavaElement resolved(Binding binding) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); @@ -713,10 +713,10 @@ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean s } } @Override -protected void toStringName(StringBuffer buffer) { +protected void toStringName(StringBuilder buffer) { toStringName(buffer, 0); } -protected void toStringName(StringBuffer buffer, int flags) { +protected void toStringName(StringBuilder buffer, int flags) { buffer.append(getElementName()); buffer.append('('); String[] parameters = getParameterTypes(); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java index 02053a1b075..7367f63a29d 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryModule.java @@ -116,7 +116,7 @@ public JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaM if (baseLocation == null) { return null; } - StringBuffer pathBuffer = new StringBuffer(baseLocation.toExternalForm()); + StringBuilder pathBuffer = new StringBuilder(baseLocation.toExternalForm()); if (!(pathBuffer.charAt(pathBuffer.length() - 1) == '/')) { pathBuffer.append('/'); @@ -132,7 +132,7 @@ public JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaM } @Override public String toString(String lineDelimiter) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); try { toStringContent(buffer, lineDelimiter); } catch (JavaModelException e) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryRecordComponent.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryRecordComponent.java index 4b8547a5643..f2c36db0138 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryRecordComponent.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryRecordComponent.java @@ -113,7 +113,7 @@ public JavaElement resolved(Binding binding) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java index 07ed1f29de3..90effd7ac4c 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java @@ -1014,7 +1014,7 @@ public String sourceFileName(IBinaryType info) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); @@ -1041,7 +1041,7 @@ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean s } } @Override -protected void toStringName(StringBuffer buffer) { +protected void toStringName(StringBuilder buffer) { if (getElementName().length() > 0) super.toStringName(buffer); else @@ -1067,7 +1067,7 @@ public JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaM if (baseLocation == null) { return null; } - StringBuffer pathBuffer = new StringBuffer(baseLocation.toExternalForm()); + StringBuilder pathBuffer = new StringBuilder(baseLocation.toExternalForm()); if (!(pathBuffer.charAt(pathBuffer.length() - 1) == '/')) { pathBuffer.append('/'); @@ -1076,7 +1076,7 @@ public JavadocContents getJavadocContents(IProgressMonitor monitor) throws JavaM String typeQualifiedName = null; if (isMember()) { IType currentType = this; - StringBuffer typeName = new StringBuffer(); + StringBuilder typeName = new StringBuilder(); while (currentType != null) { typeName.insert(0, currentType.getElementName()); currentType = currentType.getDeclaringType(); @@ -1104,7 +1104,7 @@ public boolean isLambda() { return false; } -private static void appendModulePath(IPackageFragment pack, StringBuffer buf) { +private static void appendModulePath(IPackageFragment pack, StringBuilder buf) { IModuleDescription moduleDescription= getModuleDescription(pack); if (moduleDescription != null) { String moduleName= moduleDescription.getElementName(); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java index af3bced0606..8affa9e045e 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileWorkingCopy.java @@ -123,7 +123,7 @@ protected IBuffer openBuffer(IProgressMonitor pm, Object info) throws JavaModelE } @Override -protected void toStringName(StringBuffer buffer) { +protected void toStringName(StringBuilder buffer) { buffer.append(this.classFile.getElementName()); } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java index ddef648afd2..77947611cea 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java @@ -503,7 +503,7 @@ private static IPath[] decodePatterns(NamedNodeMap nodeMap, String tag) { return null; } - private static void decodeUnknownNode(Node node, StringBuffer buffer, IJavaProject project) { + private static void decodeUnknownNode(Node node, StringBuilder buffer, IJavaProject project) { StringWriter writer = new StringWriter(); XMLWriter xmlWriter = new XMLWriter(writer, project, false/*don't print XML version*/); decodeUnknownNode(node, xmlWriter, true/*insert new line*/); @@ -803,7 +803,7 @@ public static IClasspathEntry elementDecode(Element element, IJavaProject projec if (node.getNodeType() != Node.ELEMENT_NODE) continue; if (unknownChildren == null) unknownChildren = new ArrayList(); - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); decodeUnknownNode(node, buffer, project); unknownChildren.add(buffer.toString()); } @@ -1118,7 +1118,7 @@ public static IPath resolveDotDot(IPath reference, IPath path) { */ private static void encodePatterns(IPath[] patterns, String tag, Map parameters) { if (patterns != null && patterns.length > 0) { - StringBuffer rule = new StringBuffer(10); + StringBuilder rule = new StringBuilder(10); for (int i = 0, max = patterns.length; i < max; i++){ if (i > 0) rule.append('|'); rule.append(patterns[i]); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java index cdaba9d994d..8856cbc86ff 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java @@ -1376,7 +1376,7 @@ public void save(IProgressMonitor pm, boolean force) throws JavaModelException { * Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { if (!isPrimary()) { buffer.append(tabString(tab)); buffer.append("[Working copy] "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.java index e727d850f2a..a4f6ef717b9 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ExternalPackageFragmentRoot.java @@ -138,7 +138,7 @@ protected boolean resourceExists(IResource underlyingResource) { } @Override - protected void toStringAncestors(StringBuffer buffer) { + protected void toStringAncestors(StringBuilder buffer) { // don't show project as it is irrelevant for external folders. } } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java index 554744ccb13..d3f780af496 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java @@ -103,7 +103,7 @@ public String readableName() { * @private Debugging purposes */ @Override -protected void toString(int tab, StringBuffer buffer) { +protected void toString(int tab, StringBuilder buffer) { Object info = JavaModelManager.getJavaModelManager().peekAtInfo(this); if (info == null || !(info instanceof JavaElementInfo)) return; IJavaElement[] children = ((JavaElementInfo)info).getChildren(); @@ -116,7 +116,7 @@ protected void toString(int tab, StringBuffer buffer) { * Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); buffer.append(""); //$NON-NLS-1$ if (info == null) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java index 64ebd1985f3..1317738d00b 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java @@ -65,11 +65,11 @@ public int getFlags() throws JavaModelException { return info.getModifiers(); } /** - * @see JavaElement#getHandleMemento(StringBuffer) + * @see JavaElement#getHandleMemento(StringBuilder) * For import declarations, the handle delimiter is associated to the import container already */ @Override -protected void getHandleMemento(StringBuffer buff) { +protected void getHandleMemento(StringBuilder buff) { getParent().getHandleMemento(buff); escapeMementoName(buff, getElementName()); if (this.occurrenceCount > 1) { @@ -116,7 +116,7 @@ public String readableName() { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); buffer.append("import "); //$NON-NLS-1$ toStringName(buffer); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java index 87aa535b61d..5a1fe178ae4 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java @@ -49,10 +49,10 @@ public int getElementType() { return INITIALIZER; } /** - * @see JavaElement#getHandleMemento(StringBuffer) + * @see JavaElement#getHandleMemento(StringBuilder) */ @Override -protected void getHandleMemento(StringBuffer buff) { +protected void getHandleMemento(StringBuilder buff) { getParent().getHandleMemento(buff); buff.append(getHandleMementoDelimiter()); buff.append(this.occurrenceCount); @@ -103,7 +103,7 @@ public JavaElement getPrimaryElement(boolean checkOwner) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { buffer.append(""); //$NON-NLS-1$ //$NON-NLS-2$ if (info == null) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java index 3242e830f04..5a735c615d8 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/LambdaExpression.java @@ -180,13 +180,13 @@ protected char getHandleMementoDelimiter() { } @Override - protected void getHandleMemento(StringBuffer buff) { + protected void getHandleMemento(StringBuilder buff) { getHandleMemento(buff, true, true); // lambda method and lambda expression cannot share the same memento - add a trailing discriminator. appendEscapedDelimiter(buff, getHandleMementoDelimiter()); } - protected void getHandleMemento(StringBuffer buff, boolean serializeParent, boolean serializeChild) { + protected void getHandleMemento(StringBuilder buff, boolean serializeParent, boolean serializeChild) { if (serializeParent) getParent().getHandleMemento(buff); appendEscapedDelimiter(buff, getHandleMementoDelimiter()); @@ -277,7 +277,7 @@ public boolean isAnonymous() { } @Override - public void toStringName(StringBuffer buffer) { + public void toStringName(StringBuilder buffer) { super.toStringName(buffer); buffer.append(" getCategories() { @Override public String toString() { - StringBuffer buffer = new StringBuffer(getClass().getName()); + StringBuilder buffer = new StringBuilder(getClass().getName()); toStringContent(buffer); return buffer.toString(); } - protected void toStringContent(StringBuffer buffer) { + protected void toStringContent(StringBuilder buffer) { buffer.append("\n"); //$NON-NLS-1$ if (this.isOpen()) buffer.append("open "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NamedMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NamedMember.java index cee115127f6..08fd5c2de5a 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NamedMember.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NamedMember.java @@ -45,7 +45,7 @@ public NamedMember(JavaElement parent, String name) { this.name = name; } - private void appendTypeParameters(StringBuffer buffer) throws JavaModelException { + private void appendTypeParameters(StringBuilder buffer) throws JavaModelException { ITypeParameter[] typeParameters = getTypeParameters(); int length = typeParameters.length; if (length == 0) return; @@ -207,7 +207,7 @@ public String getTypeQualifiedName(char enclosingTypeSeparator, boolean showPara switch (this.getParent().getElementType()) { case IJavaElement.COMPILATION_UNIT: if (showParameters) { - StringBuffer buffer = new StringBuffer(this.name); + StringBuilder buffer = new StringBuilder(this.name); appendTypeParameters(buffer); return buffer.toString(); } @@ -225,7 +225,7 @@ public String getTypeQualifiedName(char enclosingTypeSeparator, boolean showPara typeName = classFileName.substring(0, classFileName.lastIndexOf('.'))/*remove .class*/.replace('$', enclosingTypeSeparator); } if (showParameters) { - StringBuffer buffer = new StringBuffer(typeName); + StringBuilder buffer = new StringBuilder(typeName); appendTypeParameters(buffer); return buffer.toString(); } @@ -241,7 +241,7 @@ public String getTypeQualifiedName(char enclosingTypeSeparator, boolean showPara default: return null; } - StringBuffer buffer = new StringBuffer(declaringType.getTypeQualifiedName(enclosingTypeSeparator, showParameters)); + StringBuilder buffer = new StringBuilder(declaringType.getTypeQualifiedName(enclosingTypeSeparator, showParameters)); buffer.append(enclosingTypeSeparator); String simpleName = this.name.length() == 0 ? getOccurrenceCountSignature() : this.name; buffer.append(simpleName); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java index 8f7fb5cf051..59273eae4ec 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java @@ -69,7 +69,7 @@ public JavaElement getPrimaryElement(boolean checkOwner) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); buffer.append("package "); //$NON-NLS-1$ toStringName(buffer); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java index 0299277ec4c..118aba522be 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java @@ -536,7 +536,7 @@ public void rename(String newName, boolean force, IProgressMonitor monitor) thro * Debugging purposes */ @Override -protected void toStringChildren(int tab, StringBuffer buffer, Object info) { +protected void toStringChildren(int tab, StringBuilder buffer, Object info) { if (tab == 0) { super.toStringChildren(tab, buffer, info); } @@ -545,7 +545,7 @@ protected void toStringChildren(int tab, StringBuffer buffer, Object info) { * Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (this.names.length == 0) { buffer.append(""); //$NON-NLS-1$ @@ -575,7 +575,7 @@ public String getAttachedJavadoc(IProgressMonitor monitor) throws JavaModelExcep if (baseLocation == null) { return null; } - StringBuffer pathBuffer = new StringBuffer(baseLocation.toExternalForm()); + StringBuilder pathBuffer = new StringBuilder(baseLocation.toExternalForm()); if (!(pathBuffer.charAt(pathBuffer.length() - 1) == '/')) { pathBuffer.append('/'); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java index 1705f4b8e21..39b6c99487b 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java @@ -483,10 +483,10 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, return null; } /** - * @see JavaElement#getHandleMemento(StringBuffer) + * @see JavaElement#getHandleMemento(StringBuilder) */ @Override -protected void getHandleMemento(StringBuffer buff) { +protected void getHandleMemento(StringBuilder buff) { IPath path; IResource underlyingResource = getResource(); if (underlyingResource != null) { @@ -838,7 +838,7 @@ public void move( * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); IPath path = getPath(); if (isExternal()) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryField.java index 5a55f3e388d..24b7e0fa02a 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryField.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryField.java @@ -49,7 +49,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java index fb0f8fddb2d..2ed7ad1f0d5 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryMethod.java @@ -51,7 +51,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java index 033b7f667ae..6cc5a25ec9d 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedBinaryType.java @@ -56,7 +56,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.java index 051bb788075..44f49ef3e80 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedLambdaExpression.java @@ -50,7 +50,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceField.java index 4dbb5f7f2a1..bf493ce016f 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceField.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceField.java @@ -43,7 +43,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceMethod.java index 2f58e0a3e04..fe6de2a991f 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceMethod.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceMethod.java @@ -43,7 +43,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceType.java index 343fb0e2a69..b48d564c6ce 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceType.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ResolvedSourceType.java @@ -50,7 +50,7 @@ public boolean isResolved() { * @private Debugging purposes */ @Override - protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { + protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { super.toStringInfo(tab, buffer, info, showResolvedInfo); if (showResolvedInfo) { buffer.append(" {key="); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SimpleDelta.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SimpleDelta.java index 6216c352c0d..963f20688a9 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SimpleDelta.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SimpleDelta.java @@ -81,7 +81,7 @@ public void superTypes() { changed(IJavaElementDelta.F_SUPER_TYPES); } - protected void toDebugString(StringBuffer buffer) { + protected void toDebugString(StringBuilder buffer) { buffer.append("["); //$NON-NLS-1$ switch (getKind()) { case IJavaElementDelta.ADDED : @@ -102,7 +102,7 @@ protected void toDebugString(StringBuffer buffer) { buffer.append("}"); //$NON-NLS-1$ } - protected boolean toDebugString(StringBuffer buffer, int flags) { + protected boolean toDebugString(StringBuilder buffer, int flags) { boolean prev = false; if ((flags & IJavaElementDelta.F_MODIFIERS) != 0) { if (prev) @@ -121,7 +121,7 @@ protected boolean toDebugString(StringBuffer buffer, int flags) { @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); toDebugString(buffer); return buffer.toString(); } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java index f08b096168b..466f0bfd133 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java @@ -162,7 +162,7 @@ public JavaElement resolved(Binding binding) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java index dcf1dee27c3..f3f4a018d84 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java @@ -94,7 +94,7 @@ public static class LocalVariableElementKey { String name; public LocalVariableElementKey(IJavaElement method, String name) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer .append(method.getParent().getHandleIdentifier()) .append('#') @@ -146,7 +146,7 @@ public boolean equals(Object obj) { } @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append('(').append(this.parent).append('.').append(this.name).append(')'); return String.valueOf(buffer); } @@ -418,7 +418,7 @@ public String[] convertTypeNamesToSigs(char[][] typeNames) { // transforms signatures that contains a qualification into unqualified signatures // e.g. "QX<+QMap.Entry;>;" becomes "QX<+QEntry;>;" - StringBuffer simpleTypeSig = null; + StringBuilder simpleTypeSig = null; int start = 0; int dot = -1; int length = typeSig.length; @@ -437,7 +437,7 @@ public String[] convertTypeNamesToSigs(char[][] typeNames) { if (matchingEnd > 0 && matchingEnd+1 < length && typeSig[matchingEnd+1] == Signature.C_DOT) { // found Head.Tail -> discard everything except Tail if (simpleTypeSig == null) - simpleTypeSig = new StringBuffer().append(typeSig, 0, start); + simpleTypeSig = new StringBuilder().append(typeSig, 0, start); simpleTypeSig.append(Signature.C_UNRESOLVED); start = j = matchingEnd+2; break; @@ -446,7 +446,7 @@ public String[] convertTypeNamesToSigs(char[][] typeNames) { case Signature.C_NAME_END: if (dot > start) { if (simpleTypeSig == null) - simpleTypeSig = new StringBuffer().append(typeSig, 0, start); + simpleTypeSig = new StringBuilder().append(typeSig, 0, start); simpleTypeSig.append(Signature.C_UNRESOLVED); simpleTypeSig.append(typeSig, dot+1, j-dot-1); start = j; @@ -1422,7 +1422,7 @@ protected IJavaElement[] getUnqualifiedMethodHandle(IMethod method, boolean noDo String[] qualifiedParameterTypes = method.getParameterTypes(); String[] unqualifiedParameterTypes = new String[qualifiedParameterTypes.length]; for (int i = 0; i < qualifiedParameterTypes.length; i++) { - StringBuffer unqualifiedTypeSig = new StringBuffer(); + StringBuilder unqualifiedTypeSig = new StringBuilder(); getUnqualifiedTypeSignature(qualifiedParameterTypes[i], 0/*start*/, qualifiedParameterTypes[i].length(), unqualifiedTypeSig, noDollar); unqualifiedParameterTypes[i] = unqualifiedTypeSig.toString(); hasDollar |= unqualifiedParameterTypes[i].lastIndexOf('$') != -1; @@ -1438,7 +1438,7 @@ protected IJavaElement[] getUnqualifiedMethodHandle(IMethod method, boolean noDo return result; } - private int getUnqualifiedTypeSignature(String qualifiedTypeSig, int start, int length, StringBuffer unqualifiedTypeSig, boolean noDollar) { + private int getUnqualifiedTypeSignature(String qualifiedTypeSig, int start, int length, StringBuilder unqualifiedTypeSig, boolean noDollar) { char firstChar = qualifiedTypeSig.charAt(start); int end = start + 1; boolean sigStart = false; diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java index dcbfaa9b5d2..e071f8568ba 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java @@ -80,10 +80,10 @@ public String[] getExceptionTypes() throws JavaModelException { return CompilationUnitStructureRequestor.convertTypeNamesToSigs(exs); } /** - * @see JavaElement#getHandleMemento(StringBuffer) + * @see JavaElement#getHandleMemento(StringBuilder) */ @Override -protected void getHandleMemento(StringBuffer buff) { +protected void getHandleMemento(StringBuilder buff) { getParent().getHandleMemento(buff); char delimiter = getHandleMementoDelimiter(); buff.append(delimiter); @@ -301,7 +301,7 @@ public JavaElement resolved(Binding binding) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { toStringName(buffer); @@ -322,10 +322,10 @@ protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean s } } @Override -protected void toStringName(StringBuffer buffer) { +protected void toStringName(StringBuilder buffer) { toStringName(buffer, 0); } -protected void toStringName(StringBuffer buffer, int flags) { +protected void toStringName(StringBuilder buffer, int flags) { buffer.append(getElementName()); buffer.append('('); String[] parameters = getParameterTypes(); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceModule.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceModule.java index 2d870512937..56ee6bf81ff 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceModule.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceModule.java @@ -43,7 +43,7 @@ public String[] getCategories() throws JavaModelException { } @Override public String toString(String lineDelimiter) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); try { toStringContent(buffer, lineDelimiter); } catch (JavaModelException e) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java index e3ef685b112..da2a791463c 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java @@ -150,7 +150,7 @@ public IJavaElement getHandleFromMemento(String token, MementoTokenizer memento, return this; } @Override -protected void getHandleMemento(StringBuffer buff) { +protected void getHandleMemento(StringBuilder buff) { super.getHandleMemento(buff); if (this.occurrenceCount > 1) { buff.append(JEM_COUNT); @@ -288,7 +288,7 @@ public void rename(String newName, boolean force, IProgressMonitor monitor) thro getJavaModel().rename(elements, dests, renamings, force, monitor); } @Override -protected void toStringName(StringBuffer buffer) { +protected void toStringName(StringBuilder buffer) { super.toStringName(buffer); if (this.occurrenceCount > 1) { buffer.append("#"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java index 5a8c898365b..b2b483e11a2 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java @@ -961,7 +961,7 @@ public JavaElement resolved(Binding binding) { * @private Debugging purposes */ @Override -protected void toStringInfo(int tab, StringBuffer buffer, Object info, boolean showResolvedInfo) { +protected void toStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) { buffer.append(tabString(tab)); if (info == null) { if (isAnonymous()) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java index a42700c24e6..3eadb1eb20a 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java @@ -156,7 +156,7 @@ public ITypeRoot getTypeRoot() { } @Override - protected void toStringName(StringBuffer buffer) { + protected void toStringName(StringBuilder buffer) { buffer.append('<'); buffer.append(getElementName()); buffer.append('>'); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java index 9b6554162ca..e369be10922 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java @@ -150,7 +150,7 @@ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestrict } else { //System.out.println("Cannot accept compilation units inside the HierarchyResolver."); this.lookupEnvironment.problemReporter.abortDueToInternalError( - new StringBuffer(Messages.accept_cannot) + new StringBuilder(Messages.accept_cannot) .append(sourceUnit.getFileName()) .toString()); } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java index fb8074ee672..74a6bbc9809 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java @@ -1543,7 +1543,7 @@ boolean subtypesIncludeSupertypeOf(IType type) { */ @Override public String toString() { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append("Focus: "); //$NON-NLS-1$ if (this.focusType == null) { buffer.append("\n"); //$NON-NLS-1$ @@ -1587,7 +1587,7 @@ public String toString() { * beginning with the specified indentation level. * If ascendant, shows the super types, otherwise show the sub types. */ -private void toString(StringBuffer buffer, IJavaElement type, int indent, boolean ascendant) { +private void toString(StringBuilder buffer, IJavaElement type, int indent, boolean ascendant) { IType[] types= ascendant ? getSupertypes((IType) type) : getSubtypes((IType) type); IJavaElement[] sortedTypes = Util.sortCopy(types); for (int i= 0; i < sortedTypes.length; i++) { @@ -1595,7 +1595,7 @@ private void toString(StringBuffer buffer, IJavaElement type, int indent, boolea toString(buffer, sortedTypes[i], indent + 1, ascendant); } } -private void toString(StringBuffer buffer, IJavaElement type, int indent) { +private void toString(StringBuilder buffer, IJavaElement type, int indent) { for (int j= 0; j < indent; j++) { buffer.append(" "); //$NON-NLS-1$ } diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java index 9516889a9d0..f51938b8a6b 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java @@ -41,7 +41,7 @@ public class DefaultBytecodeVisitor implements IBytecodeVisitor { private static final int T_INT = 10; private static final int T_LONG = 11; - private final StringBuffer buffer; + private final StringBuilder buffer; private final String lineSeparator; private final int tabNumber; private final int digitNumberForPC; @@ -52,7 +52,7 @@ public class DefaultBytecodeVisitor implements IBytecodeVisitor { private final boolean isStatic; private int[] argumentSizes; - public DefaultBytecodeVisitor(ICodeAttribute codeAttribute, char[][] parameterNames, char[] methodDescriptor, boolean isStatic, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + public DefaultBytecodeVisitor(ICodeAttribute codeAttribute, char[][] parameterNames, char[] methodDescriptor, boolean isStatic, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { ILocalVariableAttribute localVariableAttribute = codeAttribute.getLocalVariableAttribute(); this.localVariableAttributeLength = localVariableAttribute == null ? 0 : localVariableAttribute.getLocalVariableTableLength(); if (this.localVariableAttributeLength != 0) { @@ -267,7 +267,7 @@ private String getLocalVariableName(int pc, int index, boolean showIndex) { final ILocalVariableTableEntry entry = this.localVariableTableEntries[i]; final int startPC = entry.getStartPC(); if (entry.getIndex() == index && (startPC <= nextPC) && ((startPC + entry.getLength()) > nextPC)) { - final StringBuffer stringBuffer = new StringBuffer(); + final StringBuilder stringBuffer = new StringBuilder(); if (showIndex) { stringBuffer.append(' ').append(index); } @@ -278,7 +278,7 @@ private String getLocalVariableName(int pc, int index, boolean showIndex) { if (this.parameterNames != null) { if (index == 0) { if (!this.isStatic) { - final StringBuffer stringBuffer = new StringBuffer(); + final StringBuilder stringBuffer = new StringBuilder(); stringBuffer.append(' ').append('[').append("this").append(']'); //$NON-NLS-1$ return String.valueOf(stringBuffer); } @@ -300,7 +300,7 @@ private String getLocalVariableName(int pc, int index, boolean showIndex) { } if (indexInParameterNames < this.parameterNames.length && this.parameterNames[indexInParameterNames] != null) { - final StringBuffer stringBuffer = new StringBuffer(); + final StringBuilder stringBuffer = new StringBuilder(); if (showIndex) { stringBuffer.append(' ').append(index); } @@ -309,7 +309,7 @@ private String getLocalVariableName(int pc, int index, boolean showIndex) { } } if (showIndex) { - final StringBuffer stringBuffer = new StringBuffer(); + final StringBuilder stringBuffer = new StringBuilder(); stringBuffer.append(' ').append(index); return String.valueOf(stringBuffer); } @@ -2107,7 +2107,7 @@ public void _ldc(int pc, int index, IConstantPoolEntry constantPoolEntry) { writeNewLine(); } - private StringBuffer appendConstantMethodType(StringBuffer s, String messageKind, int opcode, + private StringBuilder appendConstantMethodType(StringBuilder s, String messageKind, int opcode, int index, IConstantPoolEntry constantPoolEntry) { return s.append(Messages.bind(messageKind, new String[] { OpcodeStringValues.BYTECODE_NAMES[opcode], @@ -2116,7 +2116,7 @@ private StringBuffer appendConstantMethodType(StringBuffer s, String messageKind })); } - private StringBuffer appendConstantMethodHandle(StringBuffer s, String messageKind, int opcode, + private StringBuilder appendConstantMethodHandle(StringBuilder s, String messageKind, int opcode, int index, IConstantPoolEntry constantPoolEntry) { return s.append(Messages.bind(messageKind, new String[] { OpcodeStringValues.BYTECODE_NAMES[opcode], @@ -2125,7 +2125,7 @@ private StringBuffer appendConstantMethodHandle(StringBuffer s, String messageKi Integer.toString(((IConstantPoolEntry2) constantPoolEntry).getReferenceIndex()) })); } - private StringBuffer appendConstantDynamic(StringBuffer s, String messageKind, int opcode, + private StringBuilder appendConstantDynamic(StringBuilder s, String messageKind, int opcode, int index, IConstantPoolEntry entry) { return s.append(Messages.bind(messageKind, new String[] { OpcodeStringValues.BYTECODE_NAMES[opcode], @@ -2792,7 +2792,7 @@ private String returnConstantClassName(IConstantPoolEntry constantClass) { } switch(className[0]) { case '[' : - StringBuffer classNameBuffer = new StringBuffer(); + StringBuilder classNameBuffer = new StringBuilder(); Util.appendTypeSignature(className, 0, classNameBuffer, isCompact()); return classNameBuffer.toString(); default: diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java index 90b40051b92..45e4743a66d 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java @@ -34,7 +34,7 @@ public class Disassembler extends ClassFileBytesDisassembler { private static final char[] ANY_EXCEPTION = Messages.classfileformat_anyexceptionhandler.toCharArray(); private static final String VERSION_UNKNOWN = Messages.classfileformat_versionUnknown; - private boolean appendModifier(StringBuffer buffer, int accessFlags, int modifierConstant, String modifier, boolean firstModifier) { + private boolean appendModifier(StringBuilder buffer, int accessFlags, int modifierConstant, String modifier, boolean firstModifier) { if ((accessFlags & modifierConstant) != 0) { if (!firstModifier) { buffer.append(Messages.disassembler_space); @@ -47,11 +47,11 @@ private boolean appendModifier(StringBuffer buffer, int accessFlags, int modifie return firstModifier; } - private void decodeModifiers(StringBuffer buffer, int accessFlags, int[] checkBits) { + private void decodeModifiers(StringBuilder buffer, int accessFlags, int[] checkBits) { decodeModifiers(buffer, accessFlags, false, false, checkBits); } - private void decodeModifiers(StringBuffer buffer, int accessFlags, boolean printDefault, boolean asBridge, int[] checkBits) { + private void decodeModifiers(StringBuilder buffer, int accessFlags, boolean printDefault, boolean asBridge, int[] checkBits) { if (checkBits == null) return; boolean firstModifier = true; for (int i = 0, max = checkBits.length; i < max; i++) { @@ -113,7 +113,7 @@ private void decodeModifiers(StringBuffer buffer, int accessFlags, boolean print } } - private void decodeModifiersForField(StringBuffer buffer, int accessFlags) { + private void decodeModifiersForField(StringBuilder buffer, int accessFlags) { decodeModifiers(buffer, accessFlags, new int[] { IModifierConstants.ACC_PUBLIC, IModifierConstants.ACC_PROTECTED, @@ -126,7 +126,7 @@ private void decodeModifiersForField(StringBuffer buffer, int accessFlags) { }); } - private void decodeModifiersForFieldForWorkingCopy(StringBuffer buffer, int accessFlags) { + private void decodeModifiersForFieldForWorkingCopy(StringBuilder buffer, int accessFlags) { decodeModifiers(buffer, accessFlags, new int[] { IModifierConstants.ACC_PUBLIC, IModifierConstants.ACC_PROTECTED, @@ -138,7 +138,7 @@ private void decodeModifiersForFieldForWorkingCopy(StringBuffer buffer, int acce }); } - private final void decodeModifiersForInnerClasses(StringBuffer buffer, int accessFlags, boolean printDefault) { + private final void decodeModifiersForInnerClasses(StringBuilder buffer, int accessFlags, boolean printDefault) { decodeModifiers(buffer, accessFlags, printDefault, false, new int[] { IModifierConstants.ACC_PUBLIC, IModifierConstants.ACC_PROTECTED, @@ -149,7 +149,7 @@ private final void decodeModifiersForInnerClasses(StringBuffer buffer, int acces }); } - private final void decodeModifiersForMethod(StringBuffer buffer, int accessFlags) { + private final void decodeModifiersForMethod(StringBuilder buffer, int accessFlags) { decodeModifiers(buffer, accessFlags, false, true, new int[] { IModifierConstants.ACC_PUBLIC, IModifierConstants.ACC_PROTECTED, @@ -164,7 +164,7 @@ private final void decodeModifiersForMethod(StringBuffer buffer, int accessFlags }); } - private final void decodeModifiersForMethodParameters(StringBuffer buffer, int accessFlags) { + private final void decodeModifiersForMethodParameters(StringBuilder buffer, int accessFlags) { decodeModifiers(buffer, accessFlags, false, true, new int[] { IModifierConstants.ACC_FINAL, IModifierConstants.ACC_MANDATED, @@ -172,14 +172,14 @@ private final void decodeModifiersForMethodParameters(StringBuffer buffer, int a }); } - private final void decodeModifiersForType(StringBuffer buffer, int accessFlags) { + private final void decodeModifiersForType(StringBuilder buffer, int accessFlags) { decodeModifiers(buffer, accessFlags, new int[] { IModifierConstants.ACC_PUBLIC, IModifierConstants.ACC_ABSTRACT, IModifierConstants.ACC_FINAL, }); } - private final void decodeModifiersForModuleRequires(StringBuffer buffer, int accessFlags) { + private final void decodeModifiersForModuleRequires(StringBuilder buffer, int accessFlags) { int[] checkBits = new int[] { IModifierConstants.ACC_TRANSITIVE, IModifierConstants.ACC_STATIC_PHASE, @@ -199,7 +199,7 @@ private final void decodeModifiersForModuleRequires(StringBuffer buffer, int acc buffer.append(Messages.disassembler_space); } } - private final void decodeModifiersForModule(StringBuffer buffer, int accessFlags) { + private final void decodeModifiersForModule(StringBuilder buffer, int accessFlags) { appendModifier(buffer, accessFlags, IModifierConstants.ACC_OPEN, "open", true); //$NON-NLS-1$ buffer.append(Messages.disassembler_space); } @@ -208,7 +208,7 @@ public static String escapeString(String s) { } static String decodeStringValue(char[] chars) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, max = chars.length; i < max; i++) { char c = chars[i]; org.eclipse.jdt.internal.compiler.util.Util.appendEscapedChar(buffer, c, true); @@ -216,7 +216,7 @@ static String decodeStringValue(char[] chars) { return buffer.toString(); } - private static void escapeChar(StringBuffer buffer, char c) { + private static void escapeChar(StringBuilder buffer, char c) { org.eclipse.jdt.internal.compiler.util.Util.appendEscapedChar(buffer, c, false); } @@ -248,7 +248,7 @@ public String disassemble(byte[] classFileBytes, String lineSeparator, int mode) } } - private void disassemble(IAnnotation annotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IAnnotation annotation, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); final int typeIndex = annotation.getTypeIndex(); final char[] typeName = CharOperation.replaceOnCopy(annotation.getTypeName(), '/', '.'); @@ -265,7 +265,7 @@ private void disassemble(IAnnotation annotation, StringBuffer buffer, String lin buffer.append(Messages.disassembler_annotationentryend); } - private void disassemble(IExtendedAnnotation extendedAnnotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IExtendedAnnotation extendedAnnotation, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); final int typeIndex = extendedAnnotation.getTypeIndex(); final char[] typeName = CharOperation.replaceOnCopy(extendedAnnotation.getTypeName(), '/', '.'); @@ -299,7 +299,7 @@ private void disassemble(IExtendedAnnotation extendedAnnotation, StringBuffer bu buffer.append(Messages.disassembler_extendedannotationentryend); } - private void disassembleTypePathContents(int targetType, IExtendedAnnotation extendedAnnotation,StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleTypePathContents(int targetType, IExtendedAnnotation extendedAnnotation,StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { int[][] typepath = extendedAnnotation.getTypePath(); if (typepath.length != 0) { writeNewLine(buffer, lineSeparator, tabNumber + 2); @@ -309,7 +309,7 @@ private void disassembleTypePathContents(int targetType, IExtendedAnnotation ext })); } } - private void disassembleTargetTypeContents(boolean insideWildcard, int targetType, IExtendedAnnotation extendedAnnotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleTargetTypeContents(boolean insideWildcard, int targetType, IExtendedAnnotation extendedAnnotation, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { switch(targetType) { case IExtendedAnnotationConstants.CLASS_TYPE_PARAMETER : case IExtendedAnnotationConstants.METHOD_TYPE_PARAMETER : @@ -459,7 +459,7 @@ private String getTargetType(int targetType) { } - private void disassemble(IAnnotationComponent annotationComponent, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IAnnotationComponent annotationComponent, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append( Messages.bind(Messages.disassembler_annotationcomponent, @@ -470,7 +470,7 @@ private void disassemble(IAnnotationComponent annotationComponent, StringBuffer disassemble(annotationComponent.getComponentValue(), buffer, lineSeparator, tabNumber + 1, mode); } - private void disassemble(IAnnotationComponentValue annotationComponentValue, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IAnnotationComponentValue annotationComponentValue, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { switch(annotationComponentValue.getTag()) { case IAnnotationComponentValue.BYTE_TAG: case IAnnotationComponentValue.CHAR_TAG: @@ -494,7 +494,7 @@ private void disassemble(IAnnotationComponentValue annotationComponentValue, Str value = Double.toString(constantPoolEntry.getDoubleValue()); break; case IConstantPoolConstant.CONSTANT_Integer: - StringBuffer temp = new StringBuffer(); + StringBuilder temp = new StringBuilder(); switch(annotationComponentValue.getTag()) { case IAnnotationComponentValue.CHAR_TAG : temp.append('\''); @@ -560,7 +560,7 @@ private void disassemble(IAnnotationComponentValue annotationComponentValue, Str } } - private void disassemble(IAnnotationDefaultAttribute annotationDefaultAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IAnnotationDefaultAttribute annotationDefaultAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_annotationdefaultheader); IAnnotationComponentValue componentValue = annotationDefaultAttribute.getMemberValue(); @@ -568,7 +568,7 @@ private void disassemble(IAnnotationDefaultAttribute annotationDefaultAttribute, disassemble(componentValue, buffer, lineSeparator, tabNumber + 1, mode); } - private void disassemble(IClassFileAttribute classFileAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IClassFileAttribute classFileAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.bind(Messages.disassembler_genericattributeheader, new String[] { @@ -577,7 +577,7 @@ private void disassemble(IClassFileAttribute classFileAttribute, StringBuffer bu })); } - private void disassemble(IMethodParametersAttribute methodParametersAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IMethodParametersAttribute methodParametersAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { tabNumber += 2; writeNewLine(buffer, lineSeparator, tabNumber); buffer.append(Messages.disassembler_methodparametersheader); @@ -592,7 +592,7 @@ private void disassemble(IMethodParametersAttribute methodParametersAttribute, S } } - private void disassembleEnumConstructor(IClassFileReader classFileReader, char[] className, IMethodInfo methodInfo, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleEnumConstructor(IClassFileReader classFileReader, char[] className, IMethodInfo methodInfo, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber); final ICodeAttribute codeAttribute = methodInfo.getCodeAttribute(); IMethodParametersAttribute methodParametersAttribute = (IMethodParametersAttribute) Util.getAttribute(methodInfo, IAttributeNamesConstants.METHOD_PARAMETERS); @@ -674,7 +674,7 @@ private void disassembleEnumConstructor(IClassFileReader classFileReader, char[] /** * Disassemble a method info header */ - private void disassemble(IClassFileReader classFileReader, char[] className, IMethodInfo methodInfo, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IClassFileReader classFileReader, char[] className, IMethodInfo methodInfo, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber); final ICodeAttribute codeAttribute = methodInfo.getCodeAttribute(); final char[] methodDescriptor = methodInfo.getDescriptor(); @@ -789,7 +789,7 @@ private void disassemble(IClassFileReader classFileReader, char[] className, IMe } int insertionPosition = CharOperation.indexOf('(', methodHeader) + 1; int start = 0; - StringBuffer stringBuffer = new StringBuffer(); + StringBuilder stringBuffer = new StringBuilder(); stringBuffer.append(methodHeader, 0, insertionPosition); for (int i = 0; i < length; i++) { if (i > 0) { @@ -977,7 +977,7 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator final int accessFlags = classFileReader.getAccessFlags(); final boolean isEnum = (accessFlags & IModifierConstants.ACC_ENUM) != 0; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); ISourceAttribute sourceAttribute = classFileReader.getSourceFileAttribute(); IClassFileAttribute classFileAttribute = Util.getAttribute(classFileReader, IAttributeNamesConstants.SIGNATURE); ISignatureAttribute signatureAttribute = (ISignatureAttribute) classFileAttribute; @@ -1269,7 +1269,7 @@ public String disassemble(IClassFileReader classFileReader, String lineSeparator return buffer.toString(); } - private void disassembleModule(IModuleAttribute moduleAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassembleModule(IModuleAttribute moduleAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber); char[] moduleVersion = moduleAttribute.getModuleVersionValue(); if (moduleVersion == null) { @@ -1317,11 +1317,11 @@ private void disassembleModule(IModuleAttribute moduleAttribute, StringBuffer bu } } } - private void convertModuleNames(StringBuffer buffer, char[] name) { + private void convertModuleNames(StringBuilder buffer, char[] name) { buffer.append(CharOperation.replaceOnCopy(CharOperation.replaceOnCopy(name, '$','.'), '/','.')); } - private void disassembleModule(IModulePackagesAttribute modulePackagesAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassembleModule(IModulePackagesAttribute modulePackagesAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { if (modulePackagesAttribute == null) return; writeNewLine(buffer, lineSeparator, tabNumber); writeNewLine(buffer, lineSeparator, tabNumber); @@ -1334,7 +1334,7 @@ private void disassembleModule(IModulePackagesAttribute modulePackagesAttribute, writeNewLine(buffer, lineSeparator, 0); } - private void disassembleModule(IModuleMainClassAttribute moduleMainClassAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassembleModule(IModuleMainClassAttribute moduleMainClassAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { if (moduleMainClassAttribute == null) return; writeNewLine(buffer, lineSeparator, tabNumber); buffer.append(Messages.disassembler_modulemainclassattributeheader); @@ -1343,7 +1343,7 @@ private void disassembleModule(IModuleMainClassAttribute moduleMainClassAttribut writeNewLine(buffer, lineSeparator, 0); } - private void disassemble(IProvidesInfo iProvidesInfo, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(IProvidesInfo iProvidesInfo, StringBuilder buffer, String lineSeparator, int tabNumber) { buffer.append("provides"); //$NON-NLS-1$ buffer.append(Messages.disassembler_space); convertModuleNames(buffer, iProvidesInfo.getServiceName()); @@ -1364,7 +1364,7 @@ private void disassemble(IProvidesInfo iProvidesInfo, StringBuffer buffer, Strin buffer.append(';'); } - private void disassemble(INestHostAttribute nestHostAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(INestHostAttribute nestHostAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber); writeNewLine(buffer, lineSeparator, tabNumber); // additional line buffer.append(Messages.disassembler_nesthost); @@ -1374,7 +1374,7 @@ private void disassemble(INestHostAttribute nestHostAttribute, StringBuffer buff .append(" ")//$NON-NLS-1$ .append(nestHostAttribute.getNestHostName()); } - private void disassemble(IRecordAttribute recordAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRecordAttribute recordAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber); writeNewLine(buffer, lineSeparator, tabNumber); // additional line buffer.append(Messages.disassembler_record); @@ -1389,7 +1389,7 @@ private void disassemble(IRecordAttribute recordAttribute, StringBuffer buffer, disassemble(e, buffer, lineSeparator, tabNumber, mode); } } - private void disassemble(IComponentInfo componentInfo, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IComponentInfo componentInfo, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber); final char[] descriptor = componentInfo.getDescriptor(); final ISignatureAttribute signatureAttribute = (ISignatureAttribute) Util.getAttribute(componentInfo, IAttributeNamesConstants.SIGNATURE); @@ -1463,7 +1463,7 @@ private void disassemble(IComponentInfo componentInfo, StringBuffer buffer, Stri } } - private void disassemble(INestMembersAttribute nestMembersAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(INestMembersAttribute nestMembersAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber); writeNewLine(buffer, lineSeparator, tabNumber); // additional line buffer.append(Messages.disassembler_nestmembers); @@ -1489,7 +1489,7 @@ private void disassemble(INestMembersAttribute nestMembersAttribute, StringBuffe } } } - private void disassemble(IPermittedSubclassesAttribute permittedSubclassesAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(IPermittedSubclassesAttribute permittedSubclassesAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber); writeNewLine(buffer, lineSeparator, tabNumber); // additional line buffer.append(Messages.disassembler_permittedsubclasses); @@ -1515,7 +1515,7 @@ private void disassemble(IPermittedSubclassesAttribute permittedSubclassesAttrib } } } - private void disassemble(IPackageVisibilityInfo iPackageVisibilityInfo, StringBuffer buffer, String lineSeparator, + private void disassemble(IPackageVisibilityInfo iPackageVisibilityInfo, StringBuilder buffer, String lineSeparator, int tabNumber, boolean isExports) { buffer.append(isExports ? "exports" : "opens"); //$NON-NLS-1$ //$NON-NLS-2$ buffer.append(Messages.disassembler_space); @@ -1537,14 +1537,14 @@ private void disassemble(IPackageVisibilityInfo iPackageVisibilityInfo, StringBu buffer.append(';'); } - private void disassemble(IRequiresInfo iRequiresInfo, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(IRequiresInfo iRequiresInfo, StringBuilder buffer, String lineSeparator, int tabNumber) { buffer.append("requires "); //$NON-NLS-1$ decodeModifiersForModuleRequires(buffer, iRequiresInfo.getRequiresFlags()); buffer.append(iRequiresInfo.getRequiresModuleName()); buffer.append(';'); } - private void disassembleGenericSignature(int mode, StringBuffer buffer, final char[] signature) { + private void disassembleGenericSignature(int mode, StringBuilder buffer, final char[] signature) { CharOperation.replace(signature, '/', '.'); final char[][] typeParameters = Signature.getTypeParameters(signature); final int typeParametersLength = typeParameters.length; @@ -1592,7 +1592,7 @@ private boolean isVarArgs(IMethodInfo methodInfo) { // check the presence of the unspecified Varargs attribute return Util.getAttribute(methodInfo, AttributeNamesConstants.VarargsName) != null; } - private void disassemble(ICodeAttribute codeAttribute, char[][] parameterNames, char[] methodDescriptor, boolean isStatic, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(ICodeAttribute codeAttribute, char[][] parameterNames, char[] methodDescriptor, boolean isStatic, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber - 1); DefaultBytecodeVisitor visitor = new DefaultBytecodeVisitor(codeAttribute, parameterNames, methodDescriptor, isStatic, buffer, lineSeparator, tabNumber, mode); try { @@ -1777,7 +1777,7 @@ private void disassemble(ICodeAttribute codeAttribute, char[][] parameterNames, } } - private void disassemble(IStackMapTableAttribute attribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IStackMapTableAttribute attribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 3); int numberOfEntries = attribute.getNumberOfEntries(); final IStackMapFrame[] stackMapFrames = attribute.getStackMapFrame(); @@ -1865,7 +1865,7 @@ private void disassemble(IStackMapTableAttribute attribute, StringBuffer buffer, } } - private void disassemble(IStackMapAttribute attribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IStackMapAttribute attribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 3); int numberOfEntries = attribute.getNumberOfEntries(); final IStackMapFrame[] stackMapFrames = attribute.getStackMapFrame(); @@ -1980,7 +1980,7 @@ private String[] methodDescription(IConstantPoolEntry constantPoolEntry) { new String(constantPoolEntry.getMethodDescriptor())}; } - private void disassemble(IConstantPool constantPool, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(IConstantPool constantPool, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber); int length = constantPool.getConstantPoolCount(); buffer.append(Messages.disassembler_constantpoolheader); @@ -2173,7 +2173,7 @@ private String getReferenceKind(int referenceKind) { return Messages.bind(message, new String[] { Integer.toString(referenceKind) }); } - private void disassemble(IEnclosingMethodAttribute enclosingMethodAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(IEnclosingMethodAttribute enclosingMethodAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_enclosingmethodheader); buffer @@ -2192,7 +2192,7 @@ private void disassemble(IEnclosingMethodAttribute enclosingMethodAttribute, Str } } - private void disassembleEnumConstants(IFieldInfo fieldInfo, StringBuffer buffer, String lineSeparator, int tabNumber, char[][] argumentTypes, int mode) { + private void disassembleEnumConstants(IFieldInfo fieldInfo, StringBuilder buffer, String lineSeparator, int tabNumber, char[][] argumentTypes, int mode) { writeNewLine(buffer, lineSeparator, tabNumber); final IClassFileAttribute runtimeVisibleAnnotationsAttribute = Util.getAttribute(fieldInfo, IAttributeNamesConstants.RUNTIME_VISIBLE_ANNOTATIONS); final IClassFileAttribute runtimeInvisibleAnnotationsAttribute = Util.getAttribute(fieldInfo, IAttributeNamesConstants.RUNTIME_INVISIBLE_ANNOTATIONS); @@ -2245,7 +2245,7 @@ private void disassembleEnumConstants(IFieldInfo fieldInfo, StringBuffer buffer, /** * Disassemble a field info */ - private void disassemble(IFieldInfo fieldInfo, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IFieldInfo fieldInfo, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber); final char[] fieldDescriptor = fieldInfo.getDescriptor(); final ISignatureAttribute signatureAttribute = (ISignatureAttribute) Util.getAttribute(fieldInfo, IAttributeNamesConstants.SIGNATURE); @@ -2377,7 +2377,7 @@ private void disassemble(IFieldInfo fieldInfo, StringBuffer buffer, String lineS } } - private void disassemble(IInnerClassesAttribute innerClassesAttribute, StringBuffer buffer, String lineSeparator, int tabNumber) { + private void disassemble(IInnerClassesAttribute innerClassesAttribute, StringBuilder buffer, String lineSeparator, int tabNumber) { writeNewLine(buffer, lineSeparator, tabNumber); buffer.append(Messages.disassembler_innerattributesheader); writeNewLine(buffer, lineSeparator, tabNumber + 1); @@ -2440,7 +2440,7 @@ private void disassemble(IInnerClassesAttribute innerClassesAttribute, StringBuf } } - private void disassemble(IBootstrapMethodsAttribute bootstrapMethodsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, IConstantPool constantPool) { + private void disassemble(IBootstrapMethodsAttribute bootstrapMethodsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, IConstantPool constantPool) { writeNewLine(buffer, lineSeparator, tabNumber); buffer.append(Messages.disassembler_bootstrapmethodattributesheader); writeNewLine(buffer, lineSeparator, tabNumber + 1); @@ -2467,7 +2467,7 @@ private void disassemble(IBootstrapMethodsAttribute bootstrapMethodsAttribute, S } private String getArguments(int[] arguments, String[] argumentsName) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, max = arguments.length; i < max; i++) { buffer.append( Messages.bind( @@ -2481,7 +2481,7 @@ private String getArguments(int[] arguments, String[] argumentsName) { } return String.valueOf(buffer); } - private void disassemble(int index, IParameterAnnotation parameterAnnotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(int index, IParameterAnnotation parameterAnnotation, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { IAnnotation[] annotations = parameterAnnotation.getAnnotations(); writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append( @@ -2491,7 +2491,7 @@ private void disassemble(int index, IParameterAnnotation parameterAnnotation, St } } - private void disassemble(IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_runtimeinvisibleannotationsattributeheader); IAnnotation[] annotations = runtimeInvisibleAnnotationsAttribute.getAnnotations(); @@ -2500,7 +2500,7 @@ private void disassemble(IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleA } } - private void disassemble(IRuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRuntimeInvisibleParameterAnnotationsAttribute runtimeInvisibleParameterAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_runtimeinvisibleparameterannotationsattributeheader); IParameterAnnotation[] parameterAnnotations = runtimeInvisibleParameterAnnotationsAttribute.getParameterAnnotations(); @@ -2509,7 +2509,7 @@ private void disassemble(IRuntimeInvisibleParameterAnnotationsAttribute runtimeI } } - private void disassemble(IRuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRuntimeInvisibleTypeAnnotationsAttribute runtimeInvisibleTypeAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_runtimeinvisibletypeannotationsattributeheader); IExtendedAnnotation[] extendedAnnotations = runtimeInvisibleTypeAnnotationsAttribute.getExtendedAnnotations(); @@ -2518,7 +2518,7 @@ private void disassemble(IRuntimeInvisibleTypeAnnotationsAttribute runtimeInvisi } } - private void disassemble(IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_runtimevisibleannotationsattributeheader); IAnnotation[] annotations = runtimeVisibleAnnotationsAttribute.getAnnotations(); @@ -2527,7 +2527,7 @@ private void disassemble(IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnot } } - private void disassemble(IRuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRuntimeVisibleParameterAnnotationsAttribute runtimeVisibleParameterAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_runtimevisibleparameterannotationsattributeheader); IParameterAnnotation[] parameterAnnotations = runtimeVisibleParameterAnnotationsAttribute.getParameterAnnotations(); @@ -2536,7 +2536,7 @@ private void disassemble(IRuntimeVisibleParameterAnnotationsAttribute runtimeVis } } - private void disassemble(IRuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassemble(IRuntimeVisibleTypeAnnotationsAttribute runtimeVisibleTypeAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { writeNewLine(buffer, lineSeparator, tabNumber + 1); buffer.append(Messages.disassembler_runtimevisibletypeannotationsattributeheader); IExtendedAnnotation[] extendedAnnotations = runtimeVisibleTypeAnnotationsAttribute.getExtendedAnnotations(); @@ -2546,7 +2546,7 @@ private void disassemble(IRuntimeVisibleTypeAnnotationsAttribute runtimeVisibleT } private String disassemble(IVerificationTypeInfo[] infos, int mode) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append('{'); for (int i = 0, max = infos.length; i < max; i++) { if(i != 0) { @@ -2594,7 +2594,7 @@ private String disassemble(IVerificationTypeInfo[] infos, int mode) { return String.valueOf(buffer); } - private void disassembleAsModifier(IAnnotation annotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IAnnotation annotation, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { final char[] typeName = CharOperation.replaceOnCopy(annotation.getTypeName(), '/', '.'); buffer.append('@').append(returnClassName(Signature.toCharArray(typeName), '.', mode)); final IAnnotationComponent[] components = annotation.getComponents(); @@ -2612,12 +2612,12 @@ private void disassembleAsModifier(IAnnotation annotation, StringBuffer buffer, } } - private void disassembleAsModifier(IAnnotationComponent annotationComponent, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IAnnotationComponent annotationComponent, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { buffer.append(annotationComponent.getComponentName()).append('='); disassembleAsModifier(annotationComponent.getComponentValue(), buffer, lineSeparator, tabNumber + 1, mode); } - private void disassembleAsModifier(IAnnotationComponentValue annotationComponentValue, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IAnnotationComponentValue annotationComponentValue, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { switch(annotationComponentValue.getTag()) { case IAnnotationComponentValue.BYTE_TAG: case IAnnotationComponentValue.CHAR_TAG: @@ -2641,7 +2641,7 @@ private void disassembleAsModifier(IAnnotationComponentValue annotationComponent value = Double.toString(constantPoolEntry.getDoubleValue()); break; case IConstantPoolConstant.CONSTANT_Integer: - StringBuffer temp = new StringBuffer(); + StringBuilder temp = new StringBuilder(); switch(annotationComponentValue.getTag()) { case IAnnotationComponentValue.CHAR_TAG : temp.append('\''); @@ -2694,25 +2694,25 @@ private void disassembleAsModifier(IAnnotationComponentValue annotationComponent } } - private void disassembleAsModifier(IAnnotationDefaultAttribute annotationDefaultAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IAnnotationDefaultAttribute annotationDefaultAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { IAnnotationComponentValue componentValue = annotationDefaultAttribute.getMemberValue(); disassembleAsModifier(componentValue, buffer, lineSeparator, tabNumber + 1, mode); } - private void disassembleAsModifier(IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IRuntimeInvisibleAnnotationsAttribute runtimeInvisibleAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { IAnnotation[] annotations = runtimeInvisibleAnnotationsAttribute.getAnnotations(); for (int i = 0, max = annotations.length; i < max; i++) { disassembleAsModifier(annotations[i], buffer, lineSeparator, tabNumber + 1, mode); } } - private void disassembleAsModifier(IParameterAnnotation[] parameterAnnotations, StringBuffer buffer, int index, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IParameterAnnotation[] parameterAnnotations, StringBuilder buffer, int index, String lineSeparator, int tabNumber, int mode) { if (parameterAnnotations.length > index) { disassembleAsModifier(parameterAnnotations[index], buffer, lineSeparator, tabNumber + 1, mode); } } - private void disassembleAsModifier(IParameterAnnotation parameterAnnotation, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IParameterAnnotation parameterAnnotation, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { if (parameterAnnotation == null) return; IAnnotation[] annotations = parameterAnnotation.getAnnotations(); for (int i = 0, max = annotations.length; i < max; i++) { @@ -2723,7 +2723,7 @@ private void disassembleAsModifier(IParameterAnnotation parameterAnnotation, Str } } - private void disassembleAsModifier(IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { + private void disassembleAsModifier(IRuntimeVisibleAnnotationsAttribute runtimeVisibleAnnotationsAttribute, StringBuilder buffer, String lineSeparator, int tabNumber, int mode) { IAnnotation[] annotations = runtimeVisibleAnnotationsAttribute.getAnnotations(); for (int i = 0, max = annotations.length; i < max; i++) { if (i > 0) { @@ -2733,7 +2733,7 @@ private void disassembleAsModifier(IRuntimeVisibleAnnotationsAttribute runtimeVi } } - private void disassembleTypeMembers(IClassFileReader classFileReader, char[] className, StringBuffer buffer, String lineSeparator, int tabNumber, int mode, boolean isEnum) { + private void disassembleTypeMembers(IClassFileReader classFileReader, char[] className, StringBuilder buffer, String lineSeparator, int tabNumber, int mode, boolean isEnum) { IFieldInfo[] fields = classFileReader.getFieldInfos(); if (isEnum && checkMode(mode, WORKING_COPY)) { int index = 0; @@ -2821,14 +2821,14 @@ private char[][] getConstructorArgumentsForEnum(final IMethodInfo[] methods) { return null; } - private final void dumpTab(int tabNumber, StringBuffer buffer) { + private final void dumpTab(int tabNumber, StringBuilder buffer) { for (int i = 0; i < tabNumber; i++) { buffer.append(Messages.disassembler_indentation); } } private final String dumpNewLineWithTabs(String lineSeparator, int tabNumber) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); writeNewLine(buffer, lineSeparator, tabNumber); return String.valueOf(buffer); } @@ -2972,13 +2972,13 @@ private char[] returnClassName(char[] classInfoName, char separator, int mode) { return classInfoName; } - private void writeNewLine(StringBuffer buffer, String lineSeparator, int tabNumber) { + private void writeNewLine(StringBuilder buffer, String lineSeparator, int tabNumber) { buffer.append(lineSeparator); dumpTab(tabNumber, buffer); } private String toTypePathString(int[][] typepath) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); buffer.append('['); for (int i = 0, max = typepath.length; i < max; i++) { int[] typepathElement = typepath[i]; diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/KeyToSignature.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/KeyToSignature.java index d83a9e79424..d40bc5b4c51 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/KeyToSignature.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/KeyToSignature.java @@ -34,7 +34,7 @@ public class KeyToSignature extends BindingKeyParser { public static final int DECLARING_TYPE = 2; public static final int THROWN_EXCEPTIONS = 3; - public StringBuffer signature = new StringBuffer(); + public StringBuilder signature = new StringBuilder(); private final int kind; private boolean asBinarySignature = false; // '.' vs. '/' and '$' private ArrayList arguments = new ArrayList(); @@ -88,7 +88,7 @@ public void consumeCapture18ID(int id, int position) { @Override public void consumeLocalType(char[] uniqueKey) { - this.signature = new StringBuffer(); + this.signature = new StringBuilder(); // remove trailing semi-colon as it is added later in comsumeType() uniqueKey = CharOperation.subarray(uniqueKey, 0, uniqueKey.length-1); if (!this.asBinarySignature) @@ -104,7 +104,7 @@ public void consumeMethod(char[] selector, char[] methodSignature) { CharOperation.replace(methodSignature, '/', '.'); switch(this.kind) { case SIGNATURE: - this.signature = new StringBuffer(); + this.signature = new StringBuilder(); this.signature.append(methodSignature); break; case THROWN_EXCEPTIONS: @@ -141,7 +141,7 @@ public void consumeParameterizedGenericMethod() { char[][] typeParameterSigs = Signature.getTypeParameters(methodSignature); if (typeParameterSigs.length != typeParametersSize) return; - this.signature = new StringBuffer(); + this.signature = new StringBuilder(); // type parameters for (int i = 0; i < typeParametersSize; i++) @@ -319,7 +319,7 @@ public void consumeTypeParameter(char[] typeParameterName) { @Override public void consumeTypeVariable(char[] position, char[] typeVariableName) { - this.signature = new StringBuffer(); + this.signature = new StringBuilder(); this.signature.append('T'); this.signature.append(typeVariableName); this.signature.append(';'); @@ -337,7 +337,7 @@ public void consumeTypeWithCapture() { @Override public void consumeWildCard(int wildCardKind) { // don't put generic type in signature - this.signature = new StringBuffer(); + this.signature = new StringBuilder(); switch (wildCardKind) { case Wildcard.UNBOUND: this.signature.append('*'); diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java index 767668d63e1..3b48296fdd4 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/MementoTokenizer.java @@ -52,12 +52,12 @@ public boolean hasMoreTokens() { } public static String escape( String mementoName) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); escape(sb,mementoName); return sb.toString(); } - public static void escape(StringBuffer buffer, String mementoName) { + public static void escape(StringBuilder buffer, String mementoName) { for (int i = 0, length = mementoName.length(); i < length; i++) { char character = mementoName.charAt(i); switch (character) { diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/SimpleDocument.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/SimpleDocument.java index 2a94bab0ec9..eb372a3787b 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/SimpleDocument.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/SimpleDocument.java @@ -27,11 +27,11 @@ */ public class SimpleDocument implements IDocument { - private final StringBuffer buffer; + private final StringBuilder buffer; public SimpleDocument(String source) { - this.buffer = new StringBuffer(source); + this.buffer = new StringBuilder(source); } @Override diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java index e7b4a8aa9ab..9bf90641adf 100644 --- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java +++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java @@ -1042,7 +1042,7 @@ public static int getParameterCount(char[] sig) { * Put all the arguments in one String. */ public static String getProblemArgumentsForMarker(String[] arguments){ - StringBuffer args = new StringBuffer(10); + StringBuilder args = new StringBuilder(10); args.append(arguments.length); args.append(':'); @@ -1070,7 +1070,7 @@ public static String getProblemArgumentsForMarker(String[] arguments){ * @param argument the given argument * @param buffer the buffer in which the encoded argument is stored */ - private static void encodeArgument(String argument, StringBuffer buffer) { + private static void encodeArgument(String argument, StringBuilder buffer) { for (int i = 0, max = argument.length(); i < max; i++) { char charAt = argument.charAt(i); switch(charAt) { @@ -1116,7 +1116,7 @@ private static String[] decodeArgumentString(int length, String argumentsString) } String[] result = new String[length]; int count = 0; - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); for (int i = 0, max = argumentsString.length(); i < max; i++) { char current = argumentsString.charAt(i); switch(current) { @@ -1226,7 +1226,7 @@ public static char[] getResourceContentsAsCharArray(IFile file, String encoding) * Returns the signature of the given type. */ public static String getSignature(Type type) { - StringBuffer buffer = new StringBuffer(); + StringBuilder buffer = new StringBuilder(); getFullyQualifiedName(type, buffer); return Signature.createTypeSignature(buffer.toString(), false/*not resolved in source*/); } @@ -1287,7 +1287,7 @@ public static String getDeclaringTypeSignature(String key) { /* * Appends to the given buffer the fully qualified name (as it appears in the source) of the given type */ - private static void getFullyQualifiedName(Type type, StringBuffer buffer) { + private static void getFullyQualifiedName(Type type, StringBuilder buffer) { switch (type.getNodeType()) { case ASTNode.ARRAY_TYPE: ArrayType arrayType = (ArrayType) type; @@ -2495,7 +2495,7 @@ private static char[] toUnresolvedTypeSignature(char[] signature) { int length = signature.length; if (length <= 1) return signature; - StringBuffer buffer = new StringBuffer(length); + StringBuilder buffer = new StringBuilder(length); toUnresolvedTypeSignature(signature, 0, length, buffer); int bufferLength = buffer.length(); char[] result = new char[bufferLength]; @@ -2503,7 +2503,7 @@ private static char[] toUnresolvedTypeSignature(char[] signature) { return result; } - private static int toUnresolvedTypeSignature(char[] signature, int start, int length, StringBuffer buffer) { + private static int toUnresolvedTypeSignature(char[] signature, int start, int length, StringBuilder buffer) { if (signature[start] == Signature.C_RESOLVED) buffer.append(Signature.C_UNRESOLVED); else @@ -2529,7 +2529,7 @@ private static int toUnresolvedTypeSignature(char[] signature, int start, int le } return length; } - private static void appendArrayTypeSignature(char[] string, int start, StringBuffer buffer, boolean compact) { + private static void appendArrayTypeSignature(char[] string, int start, StringBuilder buffer, boolean compact) { int length = string.length; // need a minimum 2 char if (start >= length - 1) { @@ -2556,7 +2556,7 @@ private static void appendArrayTypeSignature(char[] string, int start, StringBuf buffer.append('[').append(']'); } } - private static void appendClassTypeSignature(char[] string, int start, StringBuffer buffer, boolean compact) { + private static void appendClassTypeSignature(char[] string, int start, StringBuilder buffer, boolean compact) { char c = string[start]; if (c != Signature.C_RESOLVED) { return; @@ -2593,7 +2593,7 @@ private static void appendClassTypeSignature(char[] string, int start, StringBuf p++; } } - static void appendTypeSignature(char[] string, int start, StringBuffer buffer, boolean compact) { + static void appendTypeSignature(char[] string, int start, StringBuilder buffer, boolean compact) { char c = string[start]; switch (c) { case Signature.C_ARRAY : @@ -2642,7 +2642,7 @@ public static String toString(char[] declaringClass, char[] methodName, char[] m return ""; //$NON-NLS-1$ } - StringBuffer buffer = new StringBuffer(methodSignature.length + 10); + StringBuilder buffer = new StringBuilder(methodSignature.length + 10); // decode declaring class name // it can be either an array signature or a type signature @@ -3044,7 +3044,7 @@ public static char[] toAnchor(int startingIndex, char[] methodSignature, char[] throw new IllegalArgumentException(String.valueOf(methodSignature)); } - StringBuffer buffer = new StringBuffer(methodSignature.length + 10); + StringBuilder buffer = new StringBuilder(methodSignature.length + 10); // selector if (methodName != null) { @@ -3071,7 +3071,7 @@ public static char[] toAnchor(int startingIndex, char[] methodSignature, char[] return result; } - private static int appendTypeSignatureForAnchor(char[] string, int start, StringBuffer buffer, boolean isVarArgs) { + private static int appendTypeSignatureForAnchor(char[] string, int start, StringBuilder buffer, boolean isVarArgs) { // need a minimum 1 char if (start >= string.length) { throw newIllegalArgumentException(string, start); @@ -3149,7 +3149,7 @@ private static int appendTypeSignatureForAnchor(char[] string, int start, String } } - private static int appendTypeArgumentSignatureForAnchor(char[] string, int start, StringBuffer buffer) { + private static int appendTypeArgumentSignatureForAnchor(char[] string, int start, StringBuilder buffer) { // need a minimum 1 char if (start >= string.length) { throw newIllegalArgumentException(string, start); @@ -3166,7 +3166,7 @@ private static int appendTypeArgumentSignatureForAnchor(char[] string, int start return appendTypeSignatureForAnchor(string, start, buffer, false); } } - private static int appendCaptureTypeSignatureForAnchor(char[] string, int start, StringBuffer buffer) { + private static int appendCaptureTypeSignatureForAnchor(char[] string, int start, StringBuilder buffer) { // need a minimum 2 char if (start >= string.length - 1) { throw newIllegalArgumentException(string, start); @@ -3177,7 +3177,7 @@ private static int appendCaptureTypeSignatureForAnchor(char[] string, int start, } return appendTypeArgumentSignatureForAnchor(string, start + 1, buffer); } - private static int appendArrayTypeSignatureForAnchor(char[] string, int start, StringBuffer buffer, boolean isVarArgs) { + private static int appendArrayTypeSignatureForAnchor(char[] string, int start, StringBuilder buffer, boolean isVarArgs) { int length = string.length; // need a minimum 2 char if (start >= length - 1) { @@ -3211,7 +3211,7 @@ private static int appendArrayTypeSignatureForAnchor(char[] string, int start, S } return e; } - private static int appendClassTypeSignatureForAnchor(char[] string, int start, StringBuffer buffer) { + private static int appendClassTypeSignatureForAnchor(char[] string, int start, StringBuilder buffer) { // need a minimum 3 chars "Lx;" if (start >= string.length - 2) { throw newIllegalArgumentException(string, start); diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java index 221e654664f..ed0ee67e661 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ConstructorPattern.java @@ -562,7 +562,7 @@ public EntryResult[] queryIn(Index index) throws IOException { return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { if (this.findDeclarations) { output.append(this.findReferences ? "ConstructorCombinedPattern: " //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java index d7bdb949227..b659dc08372 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/FieldPattern.java @@ -107,7 +107,7 @@ protected boolean mustResolve() { return super.mustResolve(); } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { if (this.findDeclarations) { output.append(this.findReferences ? "FieldCombinedPattern: " //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java index 2764cb8a5b6..250363fabff 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/JavaSearchPattern.java @@ -338,7 +338,7 @@ boolean matchDifferentTypeSuffixes(int typeSuffix, int patternSuffix) { return true; } - protected StringBuffer print(StringBuffer output) { + protected StringBuilder print(StringBuilder output) { output.append(", "); //$NON-NLS-1$ if (hasTypeArguments() && hasSignatures()) { output.append("signature:\""); //$NON-NLS-1$ @@ -453,7 +453,7 @@ void storeTypeSignaturesAndArguments(IType type) { } @Override public final String toString() { - return print(new StringBuffer(30)).toString(); + return print(new StringBuilder(30)).toString(); } @Override diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java index 01b6ff81ae7..e0a35be3f34 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/LocalVariablePattern.java @@ -78,7 +78,7 @@ public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchP } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { if (this.findDeclarations) { output.append(this.findReferences ? "LocalVarCombinedPattern: " //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java index b5a77f5f63f..1f892860281 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java @@ -179,7 +179,7 @@ public Object removeTrustedMatch(ASTNode node) { @Override public String toString() { // TODO (jerome) should show both tables - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); result.append("Exact matches:"); //$NON-NLS-1$ Object[] keyTable = this.matchingNodes.keyTable; Object[] valueTable = this.matchingNodes.valueTable; diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java index 30eb292a9da..9838124b50a 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodPattern.java @@ -363,7 +363,7 @@ else if (this.selector != null && this.selector[this.selector.length - 1] != '*' return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { if (this.findDeclarations) { output.append(this.findReferences ? "MethodCombinedPattern: " //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModulePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModulePattern.java index 2a12455d582..d6622cf3c46 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModulePattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ModulePattern.java @@ -131,7 +131,7 @@ protected boolean mustResolve() { return true; } @Override - protected StringBuffer print(StringBuffer output) { + protected StringBuilder print(StringBuilder output) { if (this.findDeclarations) { output.append(this.findReferences ? "ModuleCombinedPattern: " //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java index 0a8e246dd24..c175e5eaf05 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java @@ -168,7 +168,7 @@ public EntryResult[] queryIn(Index index) throws IOException { return allEntries; } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { switch (this.typeSuffix){ case CLASS_SUFFIX : output.append("MultiClassDeclarationPattern: "); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java index 64d495d8098..1e3773c1e7f 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageDeclarationPattern.java @@ -29,7 +29,7 @@ public EntryResult[] queryIn(Index index) { return null; } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { output.append("PackageDeclarationPattern: <"); //$NON-NLS-1$ if (this.pkgName != null) output.append(this.pkgName); diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java index bb42f3bf87e..de015561c20 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferencePattern.java @@ -77,7 +77,7 @@ protected void resetQuery() { this.currentSegment = this.segments.length - 1; } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { output.append("PackageReferencePattern: <"); //$NON-NLS-1$ if (this.pkgName != null) output.append(this.pkgName); diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java index 830319467c7..758e2c0beae 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java @@ -103,7 +103,7 @@ public boolean matchesDecodedKey(SearchPattern decodedPattern) { (this.qualification == null || this.packagePattern == null || this.packagePattern.matchesName(this.qualification, pattern.qualification)); } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { switch (this.typeSuffix){ case CLASS_SUFFIX : output.append("ClassDeclarationPattern: qualification<"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java index f1e553d5ffd..153c4a6624f 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SecondaryTypeDeclarationPattern.java @@ -37,7 +37,7 @@ public SearchPattern getBlankPattern() { return new SecondaryTypeDeclarationPattern(R_EXACT_MATCH | R_CASE_SENSITIVE); } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { output.append("Secondary"); //$NON-NLS-1$ return super.print(output); } diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java index e9adb39aa3a..7840bf86349 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/SuperTypeReferencePattern.java @@ -280,7 +280,7 @@ public EntryResult[] queryIn(Index index) throws IOException { return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { switch (this.superRefKind) { case ALL_SUPER_TYPES: output.append("SuperTypeReferencePattern: <"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java index 7fc2406888d..c7413174127 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java @@ -364,7 +364,7 @@ public EntryResult[] queryIn(Index index) throws IOException { return index.query(getIndexCategories(), key, matchRule); // match rule is irrelevant when the key is null } @Override -protected StringBuffer print(StringBuffer output) { +protected StringBuilder print(StringBuilder output) { switch (this.typeSuffix){ case CLASS_SUFFIX : output.append("ClassDeclarationPattern: pkg<"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java index b2c6ff08246..3d2423b474a 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeParameterPattern.java @@ -124,7 +124,7 @@ public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchP } @Override - protected StringBuffer print(StringBuffer output) { + protected StringBuilder print(StringBuilder output) { if (this.findDeclarations) { output.append(this.findReferences ? "TypeParamCombinedPattern: " //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java index 8022c6ba0b7..32f1bcf55e1 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferencePattern.java @@ -155,7 +155,7 @@ protected void resetQuery() { this.currentSegment = this.segments.length - 1; } @Override - protected StringBuffer print(StringBuffer output) { + protected StringBuilder print(StringBuilder output) { String patternClassName = getClass().getName(); output.append(patternClassName.substring(patternClassName.lastIndexOf('.')+1)); output.append(": qualification<"); //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java index c357533b928..9c855b6bfe9 100644 --- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java +++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java @@ -446,7 +446,7 @@ class ProgressJob extends Job { protected IStatus run(IProgressMonitor monitor) { IJob job = currentJob(); while (!monitor.isCanceled() && job != null) { - String taskName = new StringBuffer(Messages.jobmanager_indexing) + String taskName = new StringBuilder(Messages.jobmanager_indexing) .append(Messages.bind(Messages.jobmanager_filesToIndex, job.getJobFamily(), Integer.toString(awaitingJobsCount()))) .toString(); monitor.subTask(taskName);