From 6e67e1e78d658dd4cf62511905361f617b53f0d7 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 9 Jun 2020 21:09:45 +0200 Subject: [PATCH] Replace appendln with appendLine in project --- .../ManyImplicitReceiversBenchmark.kt | 22 ++-- .../PlusAssignOperatorDesugaringBenchmark.kt | 15 ++- .../kotlin/daemon/CompilerDaemonTest.kt | 30 ++--- .../integration/CompilerDaemonTest.kt | 30 ++--- .../fir/AbstractFirLoadCompiledKotlin.kt | 4 +- .../BuiltInsDeserializationForFirTestCase.kt | 4 +- .../AbstractFirOldFrontendLightClassesTest.kt | 2 +- .../context/AbstractBuilderConfigurator.kt | 12 +- ...atformIncompatibilityDiagnosticRenderer.kt | 6 +- .../jetbrains/kotlin/util/exceptionUtil.kt | 6 +- .../kotlin/incremental/testLogsParsingUtil.kt | 20 +-- .../kotlin/ir2cfg/util/ControlFlowRenderer.kt | 14 +- .../contracts/model/MutableContextInfo.kt | 4 +- .../kotlin/cfg/AbstractPseudoValueTest.kt | 2 +- .../AbstractAsmLikeInstructionListingTest.kt | 20 +-- .../jetbrains/kotlin/codegen/SMAPTestUtil.kt | 2 +- ...AbstractFirDiagnosticsWithLightTreeTest.kt | 8 +- .../AbstractFirOldFrontendDiagnosticsTest.kt | 4 +- .../jetbrains/kotlin/fir/TableRendering.kt | 4 +- .../kotlin/ir/AbstractIrCfgTestCase.kt | 14 +- ...ractEnhancedSignaturesResolvedCallsTest.kt | 8 +- .../calls/AbstractResolvedCallsTest.kt | 24 ++-- .../ServiceLoaderLiteTest.kt | 12 +- .../ServiceLoaderLiteTestWithClassLoader.kt | 2 +- .../kotlin/code/CodeConformanceTest.kt | 4 +- .../kotlin/codegen/JvmModuleProtoBufTest.kt | 6 +- .../integration/CompilerFileLimitTest.kt | 56 ++++---- .../AbstractMultiPlatformIntegrationTest.kt | 34 ++--- .../repl/AbstractReplInterpreterTest.kt | 2 +- .../CapturedTypeApproximationTest.kt | 8 +- .../kotlin/renderer/DescriptorRendererImpl.kt | 2 +- .../jetbrains/kotlin/types/checker/utils.kt | 2 +- .../resolve/ResolutionFacadeWithDebugInfo.kt | 22 ++-- .../PluginDeclarationProviderFactory.kt | 2 +- .../internal/KotlinDecompilerServiceImpl.kt | 2 +- .../ModulesEditorToolbarDecorator.kt | 4 +- .../test/AbstractAsyncStackTraceTest.kt | 6 +- .../test/AbstractCoroutineDumpTest.kt | 2 +- .../debugger/test/AbstractFileRankingTest.kt | 2 +- .../perf/PerformanceNativeProjectsTest.kt | 4 +- .../org/jetbrains/kotlin/idea/perf/Stats.kt | 4 +- ...tatefulTestGradleProjectRefreshCallback.kt | 16 +-- .../idea/KotlinDocumentationProvider.kt | 2 +- .../AbstractCompletionBenchmarkAction.kt | 4 +- .../AbstractCompletionBenchmarkAction.kt.192 | 4 +- .../benchmark/HighlightingBenchmarkAction.kt | 4 +- .../copy/JavaContextDeclarationRenderer.kt | 2 +- .../kotlin/idea/kdoc/KDocRenderer.kt | 2 +- ...nTypeAliasByExpansionShortNameIndexTest.kt | 8 +- .../kotlin/idea/perf/UltraLightChecker.kt | 4 +- .../jps/build/AbstractLookupTrackerTest.kt | 10 +- .../kotlin/jps/build/KotlinJpsBuildTest.kt | 8 +- .../jps/build/KotlinJpsBuildTest.kt.202 | 8 +- .../dependeciestxt/MppJpsIncTestsGenerator.kt | 22 ++-- .../js/resolve/diagnostics/jsRenderers.kt | 4 +- .../example/ExampleAnnotationProcessor.kt | 14 +- .../jetbrains/kotlin/tools/dukat/download.kt | 16 +-- .../jetbrains/kotlin/gradle/BaseGradleIT.kt | 16 +-- .../kotlin/gradle/KotlinGradlePluginIT.kt | 2 +- .../MppHighlightingTestDataWithGradleIT.kt | 12 +- .../kotlin/gradle/util/gradleRunningUtils.kt | 2 +- .../src/main/kotlin/processor/MyProcessor.kt | 4 +- .../org/jetbrains/kotlin/kotlinp/Kotlinp.kt | 8 +- .../org/jetbrains/kotlin/kotlinp/printers.kt | 122 +++++++++--------- .../kotlin/kotlinp/test/KotlinpTestUtils.kt | 4 +- .../kotlin/nj2k/printing/JKCommentPrinter.kt | 2 +- .../kotlin/kapt3/base/KaptOptions.kt | 38 +++--- .../test/AbstractKaptToolIntegrationTest.kt | 6 +- .../jetbrains/kotlin/kapt/cli/test/Section.kt | 6 +- .../jetbrains/kotlin/kapt3/Kapt3Extension.kt | 4 +- .../expressions/KotlinUSwitchExpression.kt | 12 +- .../tests/AlternativesRenderLogTest.kt | 2 +- .../tests/MultiplesRequiredTypesTest.kt | 2 +- .../common/kotlin/IndentedPrintingVisitor.kt | 2 +- .../uast/test/common/kotlin/TypesTestBase.kt | 2 +- .../uast/test/common/kotlin/ValuesTestBase.kt | 2 +- 76 files changed, 405 insertions(+), 402 deletions(-) diff --git a/benchmarks/src/org/jetbrains/kotlin/benchmarks/ManyImplicitReceiversBenchmark.kt b/benchmarks/src/org/jetbrains/kotlin/benchmarks/ManyImplicitReceiversBenchmark.kt index 9f6f339cd11..471245bc176 100644 --- a/benchmarks/src/org/jetbrains/kotlin/benchmarks/ManyImplicitReceiversBenchmark.kt +++ b/benchmarks/src/org/jetbrains/kotlin/benchmarks/ManyImplicitReceiversBenchmark.kt @@ -23,28 +23,28 @@ open class ManyImplicitReceiversBenchmark : AbstractSimpleFileBenchmark() { override fun buildText(): String { return buildString { - appendln("inline fun with(receiver: T, block: T.() -> R): R = block()") + appendLine("inline fun with(receiver: T, block: T.() -> R): R = block()") for (i in 1..size) { - appendln("interface A$i {") - appendln(" fun foo$i()") - appendln("}") - appendln() + appendLine("interface A$i {") + appendLine(" fun foo$i()") + appendLine("}") + appendLine() } - appendln() + appendLine() append("fun test(") append((1..size).joinToString(", ") { "a$it: A$it" }) - appendln(" {") + appendLine(" {") for (i in 1..size) { - appendln("with(a$i) {") + appendLine("with(a$i) {") } for (i in 1..size) { - appendln("foo$i()") + appendLine("foo$i()") } for (i in 1..size) { - appendln("}") + appendLine("}") } - appendln("}") + appendLine("}") } } } \ No newline at end of file diff --git a/benchmarks/src/org/jetbrains/kotlin/benchmarks/PlusAssignOperatorDesugaringBenchmark.kt b/benchmarks/src/org/jetbrains/kotlin/benchmarks/PlusAssignOperatorDesugaringBenchmark.kt index 64588ffd6f9..92b5f0ff2a8 100644 --- a/benchmarks/src/org/jetbrains/kotlin/benchmarks/PlusAssignOperatorDesugaringBenchmark.kt +++ b/benchmarks/src/org/jetbrains/kotlin/benchmarks/PlusAssignOperatorDesugaringBenchmark.kt @@ -22,7 +22,7 @@ open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark() } override fun buildText(): String = buildString { - appendln( + appendLine( """ class A { operator fun plus(other: (Int) -> T): A = this @@ -30,19 +30,20 @@ open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark() } """.trimIndent() ) - appendln("fun test() {") - appendln("var a = A()") + appendLine("fun test() {") + appendLine("var a = A()") for (i in 1..size) { - appendln("a += {") + appendLine("a += {") } for (i in 1..size) { - appendln( + appendLine( """ it.inc() 1 } - """.trimIndent()) + """.trimIndent() + ) } - appendln() + appendLine() } } \ No newline at end of file diff --git a/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt index 07e999bc58a..1970b291066 100644 --- a/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt +++ b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/CompilerDaemonTest.kt @@ -685,13 +685,13 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() { else -> "?" } val compiledPort: Int? = daemonInfo.trim().split(" ").last().toIntOrNull() - appendln("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}") + appendLine("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}") if (resultCodes[i] != 0 || electionLogs[i] == null) { - appendln("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---") + appendLine("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---") compiledPort?.let { port -> port2logs.find { it?.first == port } }?.second?.let { logFile -> - appendln("--- log file ${logFile.name}:\n${logFile.readText()}\n---") + appendLine("--- log file ${logFile.name}:\n${logFile.readText()}\n---") } - ?: appendln("--- log not found (port: $compiledPort)") + ?: appendLine("--- log not found (port: $compiledPort)") } } } @@ -917,20 +917,20 @@ internal fun generateLargeKotlinFile(size: Int): String { return buildString { append("package large\n\n") (0..size).forEach { - appendln("class Class$it") - appendln("{") - appendln("\tfun foo(): Long = $it") - appendln("}") - appendln("\n") + appendLine("class Class$it") + appendLine("{") + appendLine("\tfun foo(): Long = $it") + appendLine("}") + appendLine("\n") repeat(2000) { - appendln("// kotlin rules ... and stuff") + appendLine("// kotlin rules ... and stuff") } } - appendln("fun main(args: Array)") - appendln("{") - appendln("\tval result = Class5().foo() + Class$size().foo()") - appendln("\tprintln(result)") - appendln("}") + appendLine("fun main(args: Array)") + appendLine("{") + appendLine("\tval result = Class5().foo() + Class$size().foo()") + appendLine("\tprintln(result)") + appendLine("}") } } diff --git a/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt index 03724146a1a..0a38d52b6b0 100644 --- a/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt +++ b/compiler/daemon/daemon-tests/test/org/jetbrains/kotlin/daemon/experimental/integration/CompilerDaemonTest.kt @@ -980,13 +980,13 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() { else -> "?" } val compiledPort: Int? = daemonInfo.trim().split(" ").last().toIntOrNull() - appendln("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}") + appendLine("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}") if (resultCodes[i] != 0 || electionLogs[i] == null) { - appendln("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---") + appendLine("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---") compiledPort?.let { port -> port2logs.find { it?.first == port } }?.second?.let { logFile -> - appendln("--- log file ${logFile.name}:\n${logFile.readText()}\n---") + appendLine("--- log file ${logFile.name}:\n${logFile.readText()}\n---") } - ?: appendln("--- log not found (port: $compiledPort)") + ?: appendLine("--- log not found (port: $compiledPort)") } } } @@ -1371,20 +1371,20 @@ internal fun generateLargeKotlinFile(size: Int): String { return buildString { append("package large\n\n") (0..size).forEach { - appendln("class Class$it") - appendln("{") - appendln("\tfun foo(): Long = $it") - appendln("}") - appendln("\n") + appendLine("class Class$it") + appendLine("{") + appendLine("\tfun foo(): Long = $it") + appendLine("}") + appendLine("\n") repeat(2000) { - appendln("// kotlin rules ... and stuff") + appendLine("// kotlin rules ... and stuff") } } - appendln("fun main(args: Array)") - appendln("{") - appendln("\tval result = Class5().foo() + Class$size().foo()") - appendln("\tprintln(result)") - appendln("}") + appendLine("fun main(args: Array)") + appendLine("{") + appendLine("\tval result = Class5().foo() + Class$size().foo()") + appendLine("\tprintln(result)") + appendLine("}") } } diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/AbstractFirLoadCompiledKotlin.kt b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/AbstractFirLoadCompiledKotlin.kt index 6ab2a83fabf..945efdc9a13 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/AbstractFirLoadCompiledKotlin.kt +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/AbstractFirLoadCompiledKotlin.kt @@ -66,7 +66,7 @@ abstract class AbstractFirLoadCompiledKotlin : AbstractFirResolveWithSessionTest for (name in provider.getAllCallableNamesInPackage(packageFqName)) { for (symbol in provider.getTopLevelCallableSymbols(packageFqName, name)) { symbol.fir.accept(firRenderer) - builder.appendln() + builder.appendLine() } } @@ -75,7 +75,7 @@ abstract class AbstractFirLoadCompiledKotlin : AbstractFirResolveWithSessionTest provider.getClassLikeSymbolByFqName(ClassId.topLevel(packageFqName.child(name))) as FirClassSymbol? ?: continue classLikeSymbol.fir.accept(firRenderer) - builder.appendln() + builder.appendLine() } val testDataDirectoryPath = diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/BuiltInsDeserializationForFirTestCase.kt b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/BuiltInsDeserializationForFirTestCase.kt index 5e32578c678..dcc30965d7d 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/BuiltInsDeserializationForFirTestCase.kt +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/BuiltInsDeserializationForFirTestCase.kt @@ -42,7 +42,7 @@ class BuiltInsDeserializationForFirTestCase : AbstractFirResolveWithSessionTestC for (name in provider.getAllCallableNamesInPackage(packageFqName)) { for (symbol in provider.getTopLevelCallableSymbols(packageFqName, name)) { symbol.fir.accept(firRenderer) - builder.appendln() + builder.appendLine() } } @@ -51,7 +51,7 @@ class BuiltInsDeserializationForFirTestCase : AbstractFirResolveWithSessionTestC provider.getClassLikeSymbolByFqName(ClassId.topLevel(packageFqName.child(name))) as FirClassSymbol? ?: continue classLikeSymbol.fir.accept(firRenderer) - builder.appendln() + builder.appendLine() } diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/java/AbstractFirOldFrontendLightClassesTest.kt b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/java/AbstractFirOldFrontendLightClassesTest.kt index 081be1ab95b..bf04fc50a90 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/java/AbstractFirOldFrontendLightClassesTest.kt +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/java/AbstractFirOldFrontendLightClassesTest.kt @@ -44,7 +44,7 @@ abstract class AbstractFirOldFrontendLightClassesTest : AbstractFirOldFrontendDi ) psiClass.appendMirrorText(0, stringBuilder) - stringBuilder.appendln() + stringBuilder.appendLine() } val expectedPath = testDataFile.path.replace(".kt", ".txt") diff --git a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractBuilderConfigurator.kt b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractBuilderConfigurator.kt index 20f47ce40af..824400dbe6e 100644 --- a/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractBuilderConfigurator.kt +++ b/compiler/fir/tree/tree-generator/src/org/jetbrains/kotlin/fir/tree/generator/context/AbstractBuilderConfigurator.kt @@ -173,22 +173,22 @@ abstract class AbstractBuilderConfigurator(val firTr return if (type == null) { allImplementations.filter { it.kind?.hasLeafBuilder == true }.singleOrNull() ?: this@AbstractBuilderConfigurator.run { val message = buildString { - appendln("${this@extractImplementation} has multiple implementations:") + appendLine("${this@extractImplementation} has multiple implementations:") for (implementation in allImplementations) { - appendln(" - ${implementation.type}") + appendLine(" - ${implementation.type}") } - appendln("Please specify implementation is needed") + appendLine("Please specify implementation is needed") } throw IllegalArgumentException(message) } } else { allImplementations.firstOrNull { it.type == type } ?: this@AbstractBuilderConfigurator.run { val message = buildString { - appendln("${this@extractImplementation} has not implementation $type. Existing implementations:") + appendLine("${this@extractImplementation} has not implementation $type. Existing implementations:") for (implementation in allImplementations) { - appendln(" - ${implementation.type}") + appendLine(" - ${implementation.type}") } - appendln("Please specify implementation is needed") + appendLine("Please specify implementation is needed") } throw IllegalArgumentException(message) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt index c945527f268..fc870ef90f3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/PlatformIncompatibilityDiagnosticRenderer.kt @@ -64,11 +64,11 @@ class IncompatibleExpectedActualClassScopesRenderer( open class MultiplatformDiagnosticRenderingMode { open fun newLine(sb: StringBuilder) { - sb.appendln() + sb.appendLine() } open fun renderList(sb: StringBuilder, elements: List<() -> Unit>) { - sb.appendln() + sb.appendLine() for (element in elements) { element() } @@ -77,7 +77,7 @@ open class MultiplatformDiagnosticRenderingMode { open fun renderDescriptor(sb: StringBuilder, descriptor: DeclarationDescriptor, context: RenderingContext, indent: String) { sb.append(indent) sb.append(INDENTATION_UNIT) - sb.appendln(Renderers.COMPACT_WITH_MODIFIERS.render(descriptor, context)) + sb.appendLine(Renderers.COMPACT_WITH_MODIFIERS.render(descriptor, context)) } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt index 6c264bdca93..60fced5577a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/util/exceptionUtil.kt @@ -14,12 +14,12 @@ fun getExceptionMessage( location: String? ): String = ApplicationManager.getApplication().runReadAction { buildString { - append(subsystemName).append(" Internal error: ").appendln(message) + append(subsystemName).append(" Internal error: ").appendLine(message) if (location != null) { - append("File being compiled: ").appendln(location) + append("File being compiled: ").appendLine(location) } else { - appendln("File is unknown") + appendLine("File is unknown") } if (cause != null) { diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/testLogsParsingUtil.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/testLogsParsingUtil.kt index ce04ee61ef8..83b21c10382 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/testLogsParsingUtil.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/testLogsParsingUtil.kt @@ -104,20 +104,20 @@ fun dumpBuildLog(buildSteps: Iterable): String { for ((i, step) in buildSteps.withIndex()) { if (i > 0) { - sb.appendln() + sb.appendLine() } - sb.appendln("================ Step #${i + 1} =================") - sb.appendln() - sb.appendln(BEGIN_COMPILED_FILES) - step.compiledKotlinFiles.sorted().forEach { sb.appendln(it) } - step.compiledJavaFiles.sorted().forEach { sb.appendln(it) } - sb.appendln(END_COMPILED_FILES) - sb.appendln("------------------------------------------") + sb.appendLine("================ Step #${i + 1} =================") + sb.appendLine() + sb.appendLine(BEGIN_COMPILED_FILES) + step.compiledKotlinFiles.sorted().forEach { sb.appendLine(it) } + step.compiledJavaFiles.sorted().forEach { sb.appendLine(it) } + sb.appendLine(END_COMPILED_FILES) + sb.appendLine("------------------------------------------") if (!step.compileSucceeded) { - sb.appendln(BEGIN_ERRORS) - step.compileErrors.forEach { sb.appendln(it) } + sb.appendLine(BEGIN_ERRORS) + step.compileErrors.forEach { sb.appendLine(it) } } } diff --git a/compiler/ir/ir.ir2cfg/src/org/jetbrains/kotlin/ir2cfg/util/ControlFlowRenderer.kt b/compiler/ir/ir.ir2cfg/src/org/jetbrains/kotlin/ir2cfg/util/ControlFlowRenderer.kt index 973b6381b11..0fd026fed1e 100644 --- a/compiler/ir/ir.ir2cfg/src/org/jetbrains/kotlin/ir2cfg/util/ControlFlowRenderer.kt +++ b/compiler/ir/ir.ir2cfg/src/org/jetbrains/kotlin/ir2cfg/util/ControlFlowRenderer.kt @@ -33,7 +33,7 @@ fun BasicBlock.dump(builder: StringBuilder = StringBuilder(), indent: String = " builder.append(indent) builder.append(String.format("%3d ", index + 1)) val dump = element.cfgDump() - builder.appendln(dump.lines().first()) + builder.appendLine(dump.lines().first()) } return builder.toString() } @@ -41,7 +41,7 @@ fun BasicBlock.dump(builder: StringBuilder = StringBuilder(), indent: String = " fun BlockConnector.dump(builder: StringBuilder = StringBuilder(), indent: String = ""): String { builder.append(indent) val dump = element.cfgDump() - builder.appendln(dump.lines().first()) + builder.appendLine(dump.lines().first()) return builder.toString() } @@ -56,21 +56,21 @@ fun ControlFlowGraph.dump(): String { } val builder = StringBuilder() for ((index, block) in blocks.withIndex()) { - builder.appendln("BB $index") + builder.appendLine("BB $index") val incoming = block.incoming if (incoming != null) { - builder.appendln(incoming.previousBlocks.joinToString(prefix = "INCOMING <- BB ") { blockIndex[it].toString() }) + builder.appendLine(incoming.previousBlocks.joinToString(prefix = "INCOMING <- BB ") { blockIndex[it].toString() }) incoming.dump(builder, " ") } - builder.appendln("CONTENT") + builder.appendLine("CONTENT") block.dump(builder, " ") val outgoing = block.outgoing if (outgoing != null) { if (outgoing.nextBlocks.isEmpty()) { - builder.appendln("OUTGOING -> NONE") + builder.appendLine("OUTGOING -> NONE") } else { - builder.appendln(outgoing.nextBlocks.joinToString(prefix = "OUTGOING -> BB ") { blockIndex[it].toString() }) + builder.appendLine(outgoing.nextBlocks.joinToString(prefix = "OUTGOING -> BB ") { blockIndex[it].toString() }) } outgoing.dump(builder, " ") } diff --git a/compiler/resolution/src/org/jetbrains/kotlin/contracts/model/MutableContextInfo.kt b/compiler/resolution/src/org/jetbrains/kotlin/contracts/model/MutableContextInfo.kt index 22cbb213ca3..562651fe153 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/contracts/model/MutableContextInfo.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/contracts/model/MutableContextInfo.kt @@ -115,13 +115,13 @@ class MutableContextInfo private constructor( this.entries.filter { it.value.isNotEmpty() }.forEach { (key, value) -> append(key.toString()) append(" $separator ") - appendln(value.toString()) + appendLine(value.toString()) } } append("Fired effects: ") append(info.firedEffects.joinToString(separator = ", ")) - appendln("") + appendLine("") subtypes.printMapEntriesWithSeparator("is") diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/cfg/AbstractPseudoValueTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/cfg/AbstractPseudoValueTest.kt index cfc5e52eded..8e5fa2ad3b7 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/cfg/AbstractPseudoValueTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/cfg/AbstractPseudoValueTest.kt @@ -91,7 +91,7 @@ abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() { "%1$-${valueColumnWidth}s".format(valueDecl(value)) + " " + "%1$-${valueDescColumnWidth}s".format(description) - out.appendln(line.trimEnd()) + out.appendLine(line.trimEnd()) } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt index 073bb6b346e..97b621b9689 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractAsmLikeInstructionListingTest.kt @@ -74,12 +74,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { append(" : " + superTypes.joinToString()) } - appendln(" {") + appendLine(" {") fields.joinTo(this, LINE_SEPARATOR.repeat(2)) { renderField(it, showTypeAnnotations).withMargin() } if (fields.isNotEmpty()) { - appendln().appendln() + appendLine().appendLine() } methods.joinTo(this, LINE_SEPARATOR.repeat(2)) { @@ -87,7 +87,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { renderMethod(it, showBytecode, showLocalVariables, showTypeAnnotations).withMargin() } - appendln().append("}") + appendLine().append("}") } } @@ -147,7 +147,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { val actualShowLocalVariables = showLocalVariables && method.localVariables?.takeIf { it.isNotEmpty() } != null if (actualShowBytecode || actualShowLocalVariables) { - appendln(" {") + appendLine(" {") if (actualShowLocalVariables) { val localVariableTable = buildLocalVariableTable(method) @@ -158,12 +158,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { if (actualShowBytecode) { if (actualShowLocalVariables) { - appendln().appendln() + appendLine().appendLine() } append(renderBytecodeInstructions(method.instructions).trimEnd().withMargin()) } - appendln().append("}") + appendLine().append("}") method.visibleTypeAnnotations } @@ -188,7 +188,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { return buildString { append("Local variables:") for (variable in localVariables) { - appendln().append((variable.index.toString() + " " + variable.name + ": " + variable.desc).withMargin()) + appendLine().append((variable.index.toString() + " " + variable.name + ": " + variable.desc).withMargin()) } } } @@ -205,12 +205,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { private fun StringBuilder.renderInstruction(node: AbstractInsnNode, labelMappings: LabelMappings) { if (node is LabelNode) { - appendln("LABEL (L" + labelMappings[node.label] + ")") + appendLine("LABEL (L" + labelMappings[node.label] + ")") return } if (node is LineNumberNode) { - appendln("LINENUMBER (" + node.line + ")") + appendLine("LINENUMBER (" + node.line + ")") return } @@ -227,7 +227,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() { is LdcInsnNode -> append(" (" + node.cst + ")") } - appendln() + appendLine() } private fun String.withMargin(margin: String = " "): String { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/SMAPTestUtil.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/SMAPTestUtil.kt index 74921b05daf..9d84969bb37 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/SMAPTestUtil.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/SMAPTestUtil.kt @@ -53,7 +53,7 @@ object SMAPTestUtil { StringReader(file.content).forEachLine { line -> // Strip comments if (!line.startsWith("//")) { - appendln(line.trim()) + appendLine(line.trim()) } } }.trim() diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt index b06b67b49dc..29727196db5 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirDiagnosticsWithLightTreeTest.kt @@ -79,15 +79,15 @@ abstract class AbstractFirDiagnosticsWithLightTreeTest : AbstractFirDiagnosticsT } if (wasExpected.isNotEmpty()) { - appendln("Some diagnostics was expected:") + appendLine("Some diagnostics was expected:") wasExpected.forEach { - appendln(it.errorMessage()) + appendLine(it.errorMessage()) } } if (isActual.isNotEmpty()) { - appendln("Some new diagnostics:") + appendLine("Some new diagnostics:") isActual.forEach { - appendln(it.errorMessage()) + appendLine(it.errorMessage()) } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt index 8b82542fa11..6062753eab8 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt @@ -63,9 +63,9 @@ abstract class AbstractFirOldFrontendDiagnosticsTest : AbstractFirDiagnosticsTes private fun checkFailureFile(failure: FirRuntimeException, failureFile: File) { val failureMessage = buildString { - appendln(failure.message) + appendLine(failure.message) append("Cause: ") - appendln(failure.cause) + appendLine(failure.cause) } KotlinTestUtils.assertEqualsToFile(failureFile, failureMessage) } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/TableRendering.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/TableRendering.kt index eb944c073a6..ae74bab52df 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/TableRendering.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/TableRendering.kt @@ -80,7 +80,7 @@ class RTableContext { out.append(HLINE.repeat(size)) } out.append(postfix) - out.appendln() + out.appendLine() } appendHLine(CORNER_LU, TOP_T, CORNER_RU) @@ -93,7 +93,7 @@ class RTableContext { out.append(VLINE) out.append(" ") } - out.appendln() + out.appendLine() } is Row.Separator -> { appendHLine(LEFT_T, CROSS, RIGHT_T) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrCfgTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrCfgTestCase.kt index d0b90626f4e..9c686703196 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrCfgTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrCfgTestCase.kt @@ -31,10 +31,10 @@ abstract class AbstractIrCfgTestCase : AbstractIrGeneratorTestCase() { val builder = StringBuilder() for (declaration in this.declarations) { if (declaration is IrFunction) { - builder.appendln("// FUN: ${declaration.name}") + builder.appendLine("// FUN: ${declaration.name}") val cfg = FunctionGenerator(declaration).generate() - builder.appendln(cfg.dump()) - builder.appendln("// END FUN: ${declaration.name}") + builder.appendLine(cfg.dump()) + builder.appendLine("// END FUN: ${declaration.name}") } } return builder.toString() @@ -43,10 +43,10 @@ abstract class AbstractIrCfgTestCase : AbstractIrGeneratorTestCase() { private fun IrModuleFragment.cfgDump(): String { val builder = StringBuilder() for (file in this.files) { - builder.appendln("// FILE: ${file.path}") - builder.appendln(file.cfgDump()) - builder.appendln("// END FILE: ${file.path}") - builder.appendln() + builder.appendLine("// FILE: ${file.path}") + builder.appendLine(file.cfgDump()) + builder.appendLine("// END FILE: ${file.path}") + builder.appendLine() } return builder.toString() } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractEnhancedSignaturesResolvedCallsTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractEnhancedSignaturesResolvedCallsTest.kt index 2819096d57b..524bd36dafa 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractEnhancedSignaturesResolvedCallsTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractEnhancedSignaturesResolvedCallsTest.kt @@ -40,13 +40,13 @@ abstract class AbstractEnhancedSignaturesResolvedCallsTest : AbstractResolvedCal return buildString { lines.forEachIndexed { lineIndex, line -> - appendln(line) + appendLine(line) callsByLine[lineIndex]?.let { calls -> val indent = line.takeWhile(Char::isWhitespace) + " " calls.forEach { resolvedCall -> - appendln("$indent// ${resolvedCall?.status}") - appendln("$indent// ORIGINAL: ${resolvedCall?.run { resultingDescriptor!!.original.getText() }}") - appendln("$indent// SUBSTITUTED: ${resolvedCall?.run { resultingDescriptor!!.getText() }}") + appendLine("$indent// ${resolvedCall?.status}") + appendLine("$indent// ORIGINAL: ${resolvedCall?.run { resultingDescriptor!!.original.getText() }}") + appendLine("$indent// SUBSTITUTED: ${resolvedCall?.run { resultingDescriptor!!.getText() }}") } } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractResolvedCallsTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractResolvedCallsTest.kt index 7362a55650c..d7e70600959 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractResolvedCallsTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/resolve/calls/AbstractResolvedCallsTest.kt @@ -131,30 +131,30 @@ internal fun DeclarationDescriptor.getText(): String = when (this) { internal fun ResolvedCall<*>.renderToText(): String { return buildString { - appendln("Resolved call:") - appendln() + appendLine("Resolved call:") + appendLine() if (candidateDescriptor != resultingDescriptor) { - appendln("Candidate descriptor: ${candidateDescriptor!!.getText()}") + appendLine("Candidate descriptor: ${candidateDescriptor!!.getText()}") } - appendln("Resulting descriptor: ${resultingDescriptor!!.getText()}") - appendln() + appendLine("Resulting descriptor: ${resultingDescriptor!!.getText()}") + appendLine() - appendln("Explicit receiver kind = ${explicitReceiverKind}") - appendln("Dispatch receiver = ${dispatchReceiver.getText()}") - appendln("Extension receiver = ${extensionReceiver.getText()}") + appendLine("Explicit receiver kind = ${explicitReceiverKind}") + appendLine("Dispatch receiver = ${dispatchReceiver.getText()}") + appendLine("Extension receiver = ${extensionReceiver.getText()}") val valueArguments = call.valueArguments if (!valueArguments.isEmpty()) { - appendln() - appendln("Value arguments mapping:") - appendln() + appendLine() + appendLine("Value arguments mapping:") + appendLine() for (valueArgument in valueArguments) { val argumentText = valueArgument!!.getText() val argumentMappingText = getArgumentMapping(valueArgument).getText() - appendln("$argumentMappingText $argumentText") + appendLine("$argumentMappingText $argumentText") } } } diff --git a/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTest.kt index f6c87f1bbba..e7fd6a58e96 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTest.kt @@ -32,7 +32,7 @@ class ServiceLoaderLiteTest : AbstractServiceLoaderLiteTest() { } fun testSeveralProcessors() { - val processorsContent = buildString { appendln("test.Foo").appendln("test.Bar") } + val processorsContent = buildString { appendLine("test.Foo").appendLine("test.Bar") } applyForDirAndJar("test", processors(processorsContent)) { file -> val impls = ServiceLoaderLite.findImplementations(Processor::class.java, listOf(file)) @@ -98,11 +98,11 @@ class ServiceLoaderLiteTest : AbstractServiceLoaderLiteTest() { fun testCommentsAndWhitespaces() { val processorsContent = buildString { - appendln(" test.Foo #comment") - appendln("#comment2") - appendln().appendln() - appendln("test.Bar #anotherComemnt") - appendln("test.Zoo ") + appendLine(" test.Foo #comment") + appendLine("#comment2") + appendLine().appendLine() + appendLine("test.Bar #anotherComemnt") + appendLine("test.Zoo ") } applyForDirAndJar("test", processors(processorsContent)) { file -> diff --git a/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTestWithClassLoader.kt b/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTestWithClassLoader.kt index 2e798b58fdb..6d5978d676b 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTestWithClassLoader.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/serviceLoaderLite/ServiceLoaderLiteTestWithClassLoader.kt @@ -127,7 +127,7 @@ class ServiceLoaderLiteTestWithClassLoader : AbstractServiceLoaderLiteTest() { private inline fun impls(vararg impls: KClass): Entry { val content = buildString { for (impl in impls) { - appendln(impl.java.name) + appendLine(impl.java.name) } } return Entry("META-INF/services/" + Intf::class.java.name, content) diff --git a/compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt b/compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt index a27dd1a5a77..92707496fc8 100644 --- a/compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/code/CodeConformanceTest.kt @@ -206,8 +206,8 @@ class CodeConformanceTest : TestCase() { for (test in tests) { if (test.result.isNotEmpty()) { append(test.message.format(test.result.size, test.result.joinToString("\n"))) - appendln() - appendln() + appendLine() + appendLine() } } }) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt index e1901876002..edeb43ee2da 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt @@ -55,10 +55,10 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() { ) val result = buildString { for (annotationClassId in mapping.moduleData.annotations) { - appendln("@$annotationClassId") + appendLine("@$annotationClassId") } for ((fqName, packageParts) in mapping.packageFqName2Parts) { - appendln(fqName) + appendLine(fqName) for (part in packageParts.parts) { append(" ") append(part) @@ -68,7 +68,7 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() { append(facadeName) append(")") } - appendln() + appendLine() } } } diff --git a/compiler/tests/org/jetbrains/kotlin/integration/CompilerFileLimitTest.kt b/compiler/tests/org/jetbrains/kotlin/integration/CompilerFileLimitTest.kt index e0ab8ef20e2..c826714a839 100644 --- a/compiler/tests/org/jetbrains/kotlin/integration/CompilerFileLimitTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/integration/CompilerFileLimitTest.kt @@ -38,20 +38,20 @@ class CompilerFileLimitTest : CompilerSmokeTestBase() { return buildString { append("package large\n\n") (0..size).forEach { - appendln("class Class$it") - appendln("{") - appendln("\tfun foo(): Long = $it") - appendln("}") - appendln("\n") + appendLine("class Class$it") + appendLine("{") + appendLine("\tfun foo(): Long = $it") + appendLine("}") + appendLine("\n") repeat(2000) { - appendln("// kotlin rules ... and stuff") + appendLine("// kotlin rules ... and stuff") } } - appendln("fun main()") - appendln("{") - appendln("\tval result = Class5().foo() + Class$size().foo()") - appendln("\tprintln(result)") - appendln("}") + appendLine("fun main()") + appendLine("{") + appendLine("\tval result = Class5().foo() + Class$size().foo()") + appendLine("\tprintln(result)") + appendLine("}") } } @@ -81,33 +81,33 @@ class CompilerFileLimitTest : CompilerSmokeTestBase() { return buildString { append("package usesLarge\n\n") append("import large.Large\n\n") - appendln("fun main()") - appendln("{") - appendln("\tval result = Large.Class0().foo() + Large.Class$size().foo()") - appendln("\tprintln(result)") - appendln("}") + appendLine("fun main()") + appendLine("{") + appendLine("\tval result = Large.Class0().foo() + Large.Class$size().foo()") + appendLine("\tprintln(result)") + appendLine("}") } } private fun generateLargeJavaFile(size: Int): String { return buildString { append("package large;\n\n") - appendln("public class Large") - appendln("{") + appendLine("public class Large") + appendLine("{") (0..size).forEach { - appendln("\tpublic static class Class$it") - appendln("\t{") - appendln("\t\tpublic long foo()") - appendln("\t\t{") - appendln("\t\t\t return $it;") - appendln("\t\t}") - appendln("\t}") - appendln("\n") + appendLine("\tpublic static class Class$it") + appendLine("\t{") + appendLine("\t\tpublic long foo()") + appendLine("\t\t{") + appendLine("\t\t\t return $it;") + appendLine("\t\t}") + appendLine("\t}") + appendLine("\n") repeat(2000) { - appendln("// kotlin rules ... and stuff") + appendLine("// kotlin rules ... and stuff") } } - appendln("}") + appendLine("}") } } diff --git a/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt b/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt index 6069bda6bee..5f364118145 100644 --- a/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/multiplatform/AbstractMultiPlatformIntegrationTest.kt @@ -54,31 +54,31 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() { val jvm2Dest = File(tmpdir, "jvm2").absolutePath.takeIf { jvm2Src != null } val result = buildString { - appendln("-- Common --") - appendln(K2MetadataCompiler().compile(commonSrc, null, "-d", commonDest, *optionalStdlibCommon)) + appendLine("-- Common --") + appendLine(K2MetadataCompiler().compile(commonSrc, null, "-d", commonDest, *optionalStdlibCommon)) if (jvmSrc != null) { - appendln() - appendln("-- JVM --") - appendln(K2JVMCompiler().compile(jvmSrc, commonSrc, "-d", jvmDest!!)) + appendLine() + appendLine("-- JVM --") + appendLine(K2JVMCompiler().compile(jvmSrc, commonSrc, "-d", jvmDest!!)) } if (jsSrc != null) { - appendln() - appendln("-- JS --") - appendln(K2JSCompiler().compile(jsSrc, commonSrc, "-output", jsDest!!)) + appendLine() + appendLine("-- JS --") + appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-output", jsDest!!)) } if (common2Src != null) { - appendln() - appendln("-- Common (2) --") - appendln(K2MetadataCompiler().compile(common2Src, null, "-d", common2Dest!!, "-cp", commonDest, *optionalStdlibCommon)) + appendLine() + appendLine("-- Common (2) --") + appendLine(K2MetadataCompiler().compile(common2Src, null, "-d", common2Dest!!, "-cp", commonDest, *optionalStdlibCommon)) } if (jvm2Src != null) { - appendln() - appendln("-- JVM (2) --") - appendln( + appendLine() + appendLine("-- JVM (2) --") + appendLine( K2JVMCompiler().compile( jvm2Src, common2Src, "-d", jvm2Dest!!, "-cp", listOfNotNull(commonDest, common2Dest, jvmDest).joinToString(File.pathSeparator) @@ -110,9 +110,9 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() { "-Xmulti-platform" + mainArguments + loadExtraArguments(listOfNotNull(sources, commonSources)) ) - appendln("Exit code: $exitCode") - appendln("Output:") - appendln(output) + appendLine("Exit code: $exitCode") + appendLine("Output:") + appendLine(output) }.trimTrailingWhitespacesAndAddNewlineAtEOF().trimEnd('\r', '\n') private fun loadExtraArguments(sources: List): List = sources.flatMap { source -> diff --git a/compiler/tests/org/jetbrains/kotlin/repl/AbstractReplInterpreterTest.kt b/compiler/tests/org/jetbrains/kotlin/repl/AbstractReplInterpreterTest.kt index 574436cf934..a30fb5109ce 100644 --- a/compiler/tests/org/jetbrains/kotlin/repl/AbstractReplInterpreterTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/repl/AbstractReplInterpreterTest.kt @@ -74,7 +74,7 @@ abstract class AbstractReplInterpreterTest : KtUsefulTestCase() { val value = StringBuilder() while (lines.isNotEmpty() && !START_PATTERN.matcher(lines.peek()!!).matches()) { - value.appendln(lines.poll()!!) + value.appendLine(lines.poll()!!) } result.add(OneLine(code, value.toString())) diff --git a/compiler/tests/org/jetbrains/kotlin/resolve/typeApproximation/CapturedTypeApproximationTest.kt b/compiler/tests/org/jetbrains/kotlin/resolve/typeApproximation/CapturedTypeApproximationTest.kt index 389c74f5b2a..deff8df2965 100644 --- a/compiler/tests/org/jetbrains/kotlin/resolve/typeApproximation/CapturedTypeApproximationTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/resolve/typeApproximation/CapturedTypeApproximationTest.kt @@ -97,10 +97,10 @@ class CapturedTypeApproximationTest : KotlinTestWithEnvironment() { val typeParameters = functionFoo.typeParameters val type = functionFoo.returnType - appendln(testType) + appendLine(testType) if (bindingContext.diagnostics.noSuppression().any { it.severity == Severity.ERROR }) { - appendln(" compiler error\n") + appendLine(" compiler error\n") continue } @@ -119,9 +119,9 @@ class CapturedTypeApproximationTest : KotlinTestWithEnvironment() { if (testSubstitution.size > 1) append("${typeParameter.name} = ") append("${testSubstitution[typeParameter]}. ") } - appendln("lower: $lower; upper: $upper; substitution: $substitution") + appendLine("lower: $lower; upper: $upper; substitution: $substitution") } - if (testTypes.lastIndex != index) appendln() + if (testTypes.lastIndex != index) appendLine() } } diff --git a/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt b/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt index e6629fc3f1c..876678571e9 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt @@ -415,7 +415,7 @@ internal class DescriptorRendererImpl( ) { append(renderAnnotation(annotation, target)) if (eachAnnotationOnNewLine) { - appendln() + appendLine() } else { append(" ") } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt index 3cf0c4a5a74..9980aa91fe0 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/utils.kt @@ -86,7 +86,7 @@ fun findCorrespondingSupertype( private fun KotlinType.approximate() = approximateCapturedTypes(this).upper private fun TypeConstructor.debugInfo() = buildString { - operator fun String.unaryPlus() = appendln(this) + operator fun String.unaryPlus() = appendLine(this) + "type: ${this@debugInfo}" + "hashCode: ${this@debugInfo.hashCode()}" diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt index 72fb9d37f44..6ee44477709 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/ResolutionFacadeWithDebugInfo.kt @@ -120,7 +120,7 @@ private class KotlinIdeaResolutionException( init { withAttachment("info.txt", buildString { append(resolvingWhat.description()) - appendln("---------------------------------------------") + appendLine("---------------------------------------------") append(creationPlace.description()) }) for (element in resolvingWhat.elements.withIndex()) { @@ -137,15 +137,15 @@ private class CreationPlace( private val platform: TargetPlatform? ) { fun description() = buildString { - appendln("Resolver created for:") + appendLine("Resolver created for:") for (element in elements) { appendElement(element) } if (moduleInfo != null) { - appendln("Provided module info: $moduleInfo") + appendLine("Provided module info: $moduleInfo") } if (platform != null) { - appendln("Provided platform: $platform") + appendLine("Provided platform: $platform") } } } @@ -161,22 +161,22 @@ private class ResolvingWhat( fun description(): String { return buildString { - appendln("Failed performing task:") + appendLine("Failed performing task:") if (serviceClass != null) { - appendln("Getting service: ${serviceClass.name}") + appendLine("Getting service: ${serviceClass.name}") } else { append("Analyzing code") if (bodyResolveMode != null) { append(" in BodyResolveMode.$bodyResolveMode") } - appendln() + appendLine() } - appendln("Elements:") + appendLine("Elements:") for (element in elements) { appendElement(element) } if (moduleDescriptor != null) { - appendln("Provided module descriptor for module ${moduleDescriptor.getCapability(ModuleInfo.Capability)}") + appendLine("Provided module descriptor for module ${moduleDescriptor.getCapability(ModuleInfo.Capability)}") } } } @@ -184,10 +184,10 @@ private class ResolvingWhat( private fun StringBuilder.appendElement(element: PsiElement) { fun info(key: String, value: String?) { - appendln(" $key = $value") + appendLine(" $key = $value") } - appendln("Element of type: ${element.javaClass.simpleName}:") + appendLine("Element of type: ${element.javaClass.simpleName}:") if (element is PsiNamedElement) { info("name", element.name) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/resolve/PluginDeclarationProviderFactory.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/resolve/PluginDeclarationProviderFactory.kt index c9d201e03b8..7f6ff82087e 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/resolve/PluginDeclarationProviderFactory.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/stubindex/resolve/PluginDeclarationProviderFactory.kt @@ -175,7 +175,7 @@ class PluginDeclarationProviderFactory( append(it.name) append(" isPhysical=${it.isPhysical}") append(" modStamp=${it.modificationStamp}") - appendln() + appendLine() } } } diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinDecompilerServiceImpl.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinDecompilerServiceImpl.kt index 0600f6daef2..5577e65d184 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinDecompilerServiceImpl.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinDecompilerServiceImpl.kt @@ -100,7 +100,7 @@ class KotlinDecompilerServiceImpl : KotlinDecompilerService { decompiledText.values.singleOrNull()?.let { return it } return buildString { for ((filename, content) in decompiledText) { - appendln("// $filename") + appendLine("// $filename") append(content) } } diff --git a/idea/idea-new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/wizard/ui/secondStep/modulesEditor/ModulesEditorToolbarDecorator.kt b/idea/idea-new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/wizard/ui/secondStep/modulesEditor/ModulesEditorToolbarDecorator.kt index ae7cd273394..f6cf88d4538 100644 --- a/idea/idea-new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/wizard/ui/secondStep/modulesEditor/ModulesEditorToolbarDecorator.kt +++ b/idea/idea-new-project-wizard/src/org/jetbrains/kotlin/tools/projectWizard/wizard/ui/secondStep/modulesEditor/ModulesEditorToolbarDecorator.kt @@ -79,9 +79,9 @@ class ModulesEditorToolbarDecorator( buildString { val moduleName = selectedModule?.name!! if (tree.selectedSettingItem.safeAs()?.kind != ModuleKind.target) { - appendln(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.module", moduleName)) + appendLine(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.module", moduleName)) } else { - appendln(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.target", moduleName)) + appendLine(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.target", moduleName)) } }, KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.question", moduleKindText), diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt index 140929f393b..6fd934404b2 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractAsyncStackTraceTest.kt @@ -59,9 +59,9 @@ abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithSteppin } private fun renderAsyncStackTrace(trace: List) = buildString { - appendln("Async stack trace:") + appendLine("Async stack trace:") for (item in trace) { - append(MARGIN).appendln(item.toString()) + append(MARGIN).appendLine(item.toString()) val declaredFields = listDeclaredFields(item.javaClass) @Suppress("UNCHECKED_CAST") @@ -77,7 +77,7 @@ abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithSteppin val name = descriptor.calcValueName() val value = descriptor.calcValue(evaluationContext) - append(MARGIN).append(MARGIN).append(name).append(" = ").appendln(value) + append(MARGIN).append(MARGIN).append(name).append(" = ").appendLine(value) } } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt index 9953f4111a1..f472463d65c 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractCoroutineDumpTest.kt @@ -52,7 +52,7 @@ abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping( private fun stringDump(infoData: List) = buildString { infoData.forEach { - appendln("\"${it.key.name}\", state: ${it.key.state}") + appendLine("\"${it.key.name}\", state: ${it.key.state}") } } diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt index 675dd1a695f..8dab9588b3a 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/AbstractFileRankingTest.kt @@ -117,7 +117,7 @@ abstract class AbstractFileRankingTest : LowLevelDebuggerTestBase() { if (problems.isNotEmpty()) { throw AssertionError(buildString { - appendln("There were association errors:").appendln() + appendLine("There were association errors:").appendLine() problems.joinTo(this, "\n\n") }) } diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceNativeProjectsTest.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceNativeProjectsTest.kt index 575df0db361..8ff5cbd25c2 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceNativeProjectsTest.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/PerformanceNativeProjectsTest.kt @@ -258,9 +258,9 @@ class PerformanceNativeProjectsTest : AbstractPerformanceProjectsTest() { buildString { originalKtFileContents.forEachIndexed { index, line -> if (index == packageLineIndex) { - appendln(line.replace("perfTestPackage1", "perfTestPackage$n")) + appendLine(line.replace("perfTestPackage1", "perfTestPackage$n")) } else { - appendln(line) + appendLine(line) } } } diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt index 8fda74788b7..184abdbf817 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/perf/Stats.kt @@ -36,7 +36,7 @@ class Stats( init { statsOutput = statsFile.bufferedWriter() - statsOutput.appendln(header.joinToString()) + statsOutput.appendLine(header.joinToString()) PerformanceCounter.setTimeCounterEnabled(true) } @@ -110,7 +110,7 @@ class Stats( private fun append(values: Array) { require(values.size == header.size) { "Expected ${header.size} values, actual ${values.size} values" } with(statsOutput) { - appendln(values.joinToString { it.toString() }) + appendLine(values.joinToString { it.toString() }) flush() } } diff --git a/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/StatefulTestGradleProjectRefreshCallback.kt b/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/StatefulTestGradleProjectRefreshCallback.kt index 21c06df42ea..bf2989d3059 100644 --- a/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/StatefulTestGradleProjectRefreshCallback.kt +++ b/idea/performanceTests/test/org/jetbrains/kotlin/idea/testFramework/StatefulTestGradleProjectRefreshCallback.kt @@ -52,20 +52,20 @@ class StatefulTestGradleProjectRefreshCallback( val error = error ?: return val failure = buildString { - appendln("Gradle import failed for ${project.name} at $projectPath") + appendLine("Gradle import failed for ${project.name} at $projectPath") project.guessProjectDir() - append("=".repeat(40)).appendln(" Error message:") - appendln(error.message.trimEnd()) + append("=".repeat(40)).appendLine(" Error message:") + appendLine(error.message.trimEnd()) - append("=".repeat(40)).appendln(" Error details:") - appendln(error.details?.trimEnd().orEmpty()) + append("=".repeat(40)).appendLine(" Error details:") + appendLine(error.details?.trimEnd().orEmpty()) - append("=".repeat(40)).appendln(" Gradle process output:") - appendln(GradleProcessOutputInterceptor.getInstance()?.getOutput()?.trimEnd() ?: "") + append("=".repeat(40)).appendLine(" Gradle process output:") + appendLine(GradleProcessOutputInterceptor.getInstance()?.getOutput()?.trimEnd() ?: "") - appendln("=".repeat(40)) + appendLine("=".repeat(40)) } fail(failure) diff --git a/idea/src/org/jetbrains/kotlin/idea/KotlinDocumentationProvider.kt b/idea/src/org/jetbrains/kotlin/idea/KotlinDocumentationProvider.kt index 20989a756fd..f768b194e22 100644 --- a/idea/src/org/jetbrains/kotlin/idea/KotlinDocumentationProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/KotlinDocumentationProvider.kt @@ -120,7 +120,7 @@ class WrapValueParameterHandler(val base: DescriptorRenderer.ValueParametersHand override fun appendAfterValueParameters(parameterCount: Int, builder: StringBuilder) { if (parameterCount > 0) { - builder.appendln() + builder.appendLine() } base.appendAfterValueParameters(parameterCount, builder) } diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt index a5dc42e3130..53c60e549c1 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt @@ -202,13 +202,13 @@ internal abstract class AbstractCompletionBenchmarkScenario( if (result == JFileChooser.APPROVE_OPTION) { val file = jfc.selectedFile file.writeText(buildString { - appendln("n, file, lines, ff, full") + appendLine("n, file, lines, ff, full") var i = 0 allResults.forEach { append(i++) append(", ") it.toCSV(this) - appendln() + appendLine() } }) } diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt.192 b/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt.192 index 0085c89e740..0f268611981 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt.192 +++ b/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/AbstractCompletionBenchmarkAction.kt.192 @@ -204,13 +204,13 @@ internal abstract class AbstractCompletionBenchmarkScenario( if (result == JFileChooser.APPROVE_OPTION) { val file = jfc.selectedFile file.writeText(buildString { - appendln("n, file, lines, ff, full") + appendLine("n, file, lines, ff, full") var i = 0 allResults.forEach { append(i++) append(", ") it.toCSV(this) - appendln() + appendLine() } }) } diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/HighlightingBenchmarkAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/HighlightingBenchmarkAction.kt index e8255f92e42..54e3618c354 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/HighlightingBenchmarkAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/actions/internal/benchmark/HighlightingBenchmarkAction.kt @@ -205,13 +205,13 @@ class HighlightingBenchmarkAction : AnAction() { if (result == JFileChooser.APPROVE_OPTION) { val file = jfc.selectedFile file.writeText(buildString { - appendln("n, file, lines, status, time") + appendLine("n, file, lines, status, time") var i = 0 allResults.forEach { append(i++) append(", ") it.toCSV(this) - appendln() + appendLine() } }) } diff --git a/idea/src/org/jetbrains/kotlin/idea/conversion/copy/JavaContextDeclarationRenderer.kt b/idea/src/org/jetbrains/kotlin/idea/conversion/copy/JavaContextDeclarationRenderer.kt index a27d9ee6e8e..01c5111edfb 100644 --- a/idea/src/org/jetbrains/kotlin/idea/conversion/copy/JavaContextDeclarationRenderer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/conversion/copy/JavaContextDeclarationRenderer.kt @@ -64,7 +64,7 @@ class JavaContextDeclarationRenderer { buildString { for (member in this@render) { renderJavaDeclaration(member) - appendln() + appendLine() } } diff --git a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt index ceb64ae13a4..5ecd21b5c9e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt @@ -227,7 +227,7 @@ object KDocRenderer { sb.append("<$tag>") processChildren() sb.append("") - if (newline) sb.appendln() + if (newline) sb.appendLine() } val nodeType = node.type diff --git a/idea/tests/org/jetbrains/kotlin/idea/index/AbstractKotlinTypeAliasByExpansionShortNameIndexTest.kt b/idea/tests/org/jetbrains/kotlin/idea/index/AbstractKotlinTypeAliasByExpansionShortNameIndexTest.kt index 5e1b934714e..084aecd9834 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/index/AbstractKotlinTypeAliasByExpansionShortNameIndexTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/index/AbstractKotlinTypeAliasByExpansionShortNameIndexTest.kt @@ -51,12 +51,12 @@ abstract class AbstractKotlinTypeAliasByExpansionShortNameIndexTest : KotlinLigh val result = index.get(key, project, scope) if (value !in result.map { it.name }) { Assert.fail(buildString { - appendln("Record $record not found in index") - appendln("Index contents:") + appendLine("Record $record not found in index") + appendLine("Index contents:") index.getAllKeys(project).asSequence().forEach { - appendln("KEY: $it") + appendLine("KEY: $it") index.get(it, project, scope).forEach { - appendln(" ${it.name}") + appendLine(" ${it.name}") } } }) diff --git a/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt b/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt index 41aa54341b2..52de3198a1e 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/perf/UltraLightChecker.kt @@ -251,7 +251,7 @@ object UltraLightChecker { val initializingClass = initializingClass ?: return name return buildString { - appendln("$name {") + appendLine("$name {") append(initializingClass.renderMembers()) append("}") } @@ -272,7 +272,7 @@ object UltraLightChecker { append(typeParameters.renderTypeParams()) append(extendsList.renderRefList("extends")) append(implementsList.renderRefList("implements")) - appendln(" {") + appendLine(" {") if (isEnum) { append( diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt index f93d80e40c8..395fda619cc 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/AbstractLookupTrackerTest.kt @@ -212,12 +212,12 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() { fun doTest(path: String) { val sb = StringBuilder() fun StringBuilder.indentln(string: String) { - appendln(" $string") + appendLine(" $string") } fun CompilerOutput.logOutput(stepName: String) { - sb.appendln("==== $stepName ====") + sb.appendLine("==== $stepName ====") - sb.appendln("Compiling files:") + sb.appendLine("Compiling files:") for (compiledFile in compiledFiles.sortedBy { it.canonicalPath }) { val lookupsFromFile = lookups[compiledFile] val lookupStatus = when { @@ -229,10 +229,10 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() { sb.indentln("$relativePath$lookupStatus") } - sb.appendln("Exit code: $exitCode") + sb.appendLine("Exit code: $exitCode") errors.forEach(sb::indentln) - sb.appendln() + sb.appendLine() } val testDir = File(path) diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt index 0ca88f64b0f..e78ecb115c4 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt @@ -716,12 +716,12 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { for (i in 0..classCount) { val code = buildString { - appendln("package foo") - appendln("class Foo$i {") + appendLine("package foo") + appendLine("class Foo$i {") for (j in 0..methodCount) { - appendln(" fun get${j*j}(): Int = square($j)") + appendLine(" fun get${j*j}(): Int = square($j)") } - appendln("}") + appendLine("}") } File(srcDir, "Foo$i.kt").writeText(code) diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.202 b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.202 index 3ac350767d3..3e158535610 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.202 +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.202 @@ -716,12 +716,12 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { for (i in 0..classCount) { val code = buildString { - appendln("package foo") - appendln("class Foo$i {") + appendLine("package foo") + appendLine("class Foo$i {") for (j in 0..methodCount) { - appendln(" fun get${j*j}(): Int = square($j)") + appendLine(" fun get${j*j}(): Int = square($j)") } - appendln("}") + appendLine("}") } File(srcDir, "Foo$i.kt").writeText(code) diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/MppJpsIncTestsGenerator.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/MppJpsIncTestsGenerator.kt index 1da2abcca6a..36700d219e4 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/MppJpsIncTestsGenerator.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/dependeciestxt/MppJpsIncTestsGenerator.kt @@ -343,9 +343,9 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes serviceKtFile(module, fileNameSuffix).setFileContent(buildString { if (settings.generatePlatformDependent) - appendln("expect fun ${module.platformDependentFunName}(): String") + appendLine("expect fun ${module.platformDependentFunName}(): String") - appendln("fun ${module.platformIndependentFunName}() = \"common$fileNameSuffix\"") + appendLine("fun ${module.platformIndependentFunName}() = \"common$fileNameSuffix\"") appendTestFun(module, settings) }) @@ -364,14 +364,14 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes serviceKtFile(module, fileNameSuffix).setFileContent(buildString { if (settings.generatePlatformDependent) { for (expectedBy in settings.generateActualDeclarationsFor) { - appendln( + appendLine( "actual fun ${expectedBy.platformDependentFunName}(): String" + " = \"${module.name}$fileNameSuffix\"" ) } } - appendln( + appendLine( "fun ${module.platformOnlyFunName}()" + " = \"${module.name}$fileNameSuffix\"" ) @@ -398,29 +398,29 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes module: ModulesTxt.Module, settings: ModuleContentSettings ) { - appendln() - appendln("fun Test${module.serviceName}() {") + appendLine() + appendLine("fun Test${module.serviceName}() {") val thisAndDependencies = mutableSetOf(module) module.collectDependenciesRecursivelyTo(thisAndDependencies) thisAndDependencies.forEach { thisOrDependent -> if (thisOrDependent.isCommonModule) { - appendln(" ${thisOrDependent.platformIndependentFunName}()") + appendLine(" ${thisOrDependent.platformIndependentFunName}()") if (settings.generatePlatformDependent) { - appendln(" ${thisOrDependent.platformDependentFunName}()") + appendLine(" ${thisOrDependent.platformDependentFunName}()") } } else { // platform module - appendln(" ${thisOrDependent.platformOnlyFunName}()") + appendLine(" ${thisOrDependent.platformOnlyFunName}()") if (thisOrDependent.isJvmModule && thisOrDependent.contentsSettings.generateJavaFile) { - appendln(" ${thisOrDependent.javaClassName}().doStuff()") + appendLine(" ${thisOrDependent.javaClassName}().doStuff()") } } } - appendln("}") + appendLine("}") } private fun ModulesTxt.Module.collectDependenciesRecursivelyTo( diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/jsRenderers.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/jsRenderers.kt index a5ccf2401ac..c768e61cd7c 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/jsRenderers.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/jsRenderers.kt @@ -82,7 +82,7 @@ fun String.underlineAsText(from: Int, to: Int): String { if (isEndOfLine(c.toInt())) { if (lineWasMarked) { - lines.appendln(marks.toString().trimEnd()) + lines.appendLine(marks.toString().trimEnd()) lineWasMarked = false } @@ -91,7 +91,7 @@ fun String.underlineAsText(from: Int, to: Int): String { } if (lineWasMarked) { - lines.appendln() + lines.appendLine() lines.append(marks.toString()) } diff --git a/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotationProcessor.kt b/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotationProcessor.kt index 5f4d9fc56f2..cd1975f0d6e 100644 --- a/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotationProcessor.kt +++ b/libraries/examples/annotation-processor-example/src/main/kotlin/example/ExampleAnnotationProcessor.kt @@ -51,15 +51,17 @@ class ExampleAnnotationProcessor : AbstractProcessor() { val simpleName = element.simpleName.toString() val generatedJavaClassName = generatedFilePrefix.capitalize() + simpleName.capitalize() + generatedFileSuffix - filer.createSourceFile(packageName + '.' + generatedJavaClassName).openWriter().use { with(it) { - appendln("package $packageName;") - appendln("public final class $generatedJavaClassName {}") - }} + filer.createSourceFile(packageName + '.' + generatedJavaClassName).openWriter().use { + with(it) { + appendLine("package $packageName;") + appendLine("public final class $generatedJavaClassName {}") + } + } if (generateKotlinCode && kotlinGenerated != null && element.kind == ElementKind.CLASS) { File(kotlinGenerated, "$simpleName.kt").writer().buffered().use { - it.appendln("package $packageName") - it.appendln("fun $simpleName.customToString() = \"$generatedJavaClassName: \" + toString()") + it.appendLine("package $packageName") + it.appendLine("fun $simpleName.customToString() = \"$generatedJavaClassName: \" + toString()") } } } diff --git a/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt b/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt index 7542ab1a286..5e363df3754 100644 --- a/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt +++ b/libraries/tools/dukat/src/main/kotlin/org/jetbrains/kotlin/tools/dukat/download.kt @@ -33,26 +33,26 @@ fun main(args: Array) { val pkg = e.value.first().second File(dir, fileName).bufferedWriter().use { w -> - w.appendln("package $pkg;") - w.appendln() - w.appendln() + w.appendLine("package $pkg;") + w.appendLine() + w.appendLine() e.value.forEach { (url) -> println("Loading $url...") - w.appendln("// Downloaded from $url") + w.appendLine("// Downloaded from $url") val content = fetch(url) if (content != null) { if (url.endsWith(".idl")) { - w.appendln(content) + w.appendLine(content) } else { extractIDLText(content, w) } } } - w.appendln() + w.appendLine() } } } @@ -69,9 +69,9 @@ private fun fetch(url: String): String? { private fun Appendable.append(element: Element) { val text = element.text() - appendln(text) + appendLine(text) if (!text.trimEnd().endsWith(";")) { - appendln(";") + appendLine(";") } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BaseGradleIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BaseGradleIT.kt index bb636fdaeea..66220f7a349 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BaseGradleIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/BaseGradleIT.kt @@ -354,11 +354,11 @@ abstract class BaseGradleIT { val errors = "(?m)^.*\\[ERROR] \\[\\S+] (.*)$".toRegex().findAll(output) val errorMessage = buildString { - appendln("Gradle build failed") - appendln() + appendLine("Gradle build failed") + appendLine() if (errors.any()) { - appendln("Possible errors:") - errors.forEach { match -> appendln(match.groupValues[1]) } + appendLine("Possible errors:") + errors.forEach { match -> appendLine(match.groupValues[1]) } } } fail(errorMessage) @@ -669,10 +669,10 @@ Finished executing task ':$taskName'| } val xmlString = buildString { - appendln("") - appendln("") + appendLine("") + appendLine("") files.forEach { - appendln( + appendLine( it.readText() .trimTrailingWhitespaces() .replace(projectDir.absolutePath, "/\$PROJECT_DIR$") @@ -680,7 +680,7 @@ Finished executing task ':$taskName'| .replace("\n", "") ) } - appendln("") + appendLine("") } val doc = SAXBuilder().build(xmlString.reader()) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index b800a0bdba7..5fafc46ceec 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -70,7 +70,7 @@ class KotlinGradleIT : BaseGradleIT() { wd1.deleteRecursively() if (wd1.exists()) { val files = buildString { - wd1.walk().forEach { appendln(" " + it.relativeTo(wd1).path) } + wd1.walk().forEach { appendLine(" " + it.relativeTo(wd1).path) } } error("Some files in $wd1 were not removed:\n$files") } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppHighlightingTestDataWithGradleIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppHighlightingTestDataWithGradleIT.kt index 4e1a28a9fa1..f3a894ee58c 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppHighlightingTestDataWithGradleIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/MppHighlightingTestDataWithGradleIT.kt @@ -52,11 +52,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() { // create Gradle Kotlin source sets for project roots: val scriptCustomization = buildString { - appendln() - appendln("kotlin {\n sourceSets {") + appendLine() + appendLine("kotlin {\n sourceSets {") sourceRoots.forEach { sourceRoot -> if (sourceRoot.kotlinSourceSetName != "commonMain") { - appendln( + appendLine( """ create("${sourceRoot.kotlinSourceSetName}") { | dependsOn(getByName("commonMain")) | listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach { @@ -67,7 +67,7 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() { """.trimMargin() ) } else { - appendln(" // commonMain source set used for common module") + appendLine(" // commonMain source set used for common module") } } @@ -76,11 +76,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() { sourceRoot.dependencies.forEach { dependency -> sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot -> val depSourceSet = depSourceRoot.kotlinSourceSetName - appendln(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""") + appendLine(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""") } } } - appendln(" }\n}") + appendLine(" }\n}") } gradleBuildScript().appendText("\n" + scriptCustomization) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/gradleRunningUtils.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/gradleRunningUtils.kt index 51b1c09c9ad..690782aea84 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/gradleRunningUtils.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/gradleRunningUtils.kt @@ -39,7 +39,7 @@ fun runProcess( if (options?.forceOutputToStdout ?: false) { println(it) } - sb.appendln(it) + sb.appendLine(it) } val exitCode = process.waitFor() diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kapt2/autoService/processor/src/main/kotlin/processor/MyProcessor.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kapt2/autoService/processor/src/main/kotlin/processor/MyProcessor.kt index 48d7f8bd669..d674947ed83 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kapt2/autoService/processor/src/main/kotlin/processor/MyProcessor.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kapt2/autoService/processor/src/main/kotlin/processor/MyProcessor.kt @@ -20,8 +20,8 @@ class MyProcessor() : AbstractProcessor() { fileCreated = true val file = processingEnv.filer.createSourceFile("Check") file.openWriter().use { - it.appendln("// $annotations") - it.appendln("public class Check {}") + it.appendLine("// $annotations") + it.appendLine("public class Check {}") } return true } diff --git a/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt b/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt index 4a863f116ec..138f8fb4b9c 100644 --- a/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt +++ b/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/Kotlinp.kt @@ -17,12 +17,12 @@ class Kotlinp(private val settings: KotlinpSettings) { is KotlinClassMetadata.FileFacade -> FileFacadePrinter(settings).print(classFile) is KotlinClassMetadata.SyntheticClass -> { if (classFile.isLambda) LambdaPrinter(settings).print(classFile) - else buildString { appendln("synthetic class") } + else buildString { appendLine("synthetic class") } } is KotlinClassMetadata.MultiFileClassFacade -> MultiFileClassFacadePrinter().print(classFile) is KotlinClassMetadata.MultiFileClassPart -> MultiFileClassPartPrinter(settings).print(classFile) - is KotlinClassMetadata.Unknown -> buildString { appendln("unknown file (k=${classFile.header.kind})") } - null -> buildString { appendln("unsupported file") } + is KotlinClassMetadata.Unknown -> buildString { appendLine("unknown file (k=${classFile.header.kind})") } + null -> buildString { appendLine("unsupported file") } } internal fun readClassFile(file: File): KotlinClassMetadata? { @@ -36,7 +36,7 @@ class Kotlinp(private val settings: KotlinpSettings) { internal fun renderModuleFile(metadata: KotlinModuleMetadata?): String = if (metadata != null) ModuleFilePrinter(settings).print(metadata) - else buildString { appendln("unsupported file") } + else buildString { appendLine("unsupported file") } internal fun readModuleFile(file: File): KotlinModuleMetadata? = KotlinModuleMetadata.read(file.readBytes()) diff --git a/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/printers.kt b/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/printers.kt index a9faa7b0db8..807ca0894a5 100644 --- a/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/printers.kt +++ b/libraries/tools/kotlinp/src/org/jetbrains/kotlin/kotlinp/printers.kt @@ -57,15 +57,15 @@ private fun visitFunction(settings: KotlinpSettings, sb: StringBuilder, flags: F } override fun visitEnd() { - sb.appendln() + sb.appendLine() if (lambdaClassOriginName != null) { - sb.appendln(" // lambda class origin: $lambdaClassOriginName") + sb.appendLine(" // lambda class origin: $lambdaClassOriginName") } for (versionRequirement in versionRequirements) { - sb.appendln(" // $versionRequirement") + sb.appendLine(" // $versionRequirement") } if (jvmSignature != null) { - sb.appendln(" // signature: $jvmSignature") + sb.appendLine(" // signature: $jvmSignature") } sb.append(" ") sb.appendFlags(flags, FUNCTION_FLAGS_MAP) @@ -82,9 +82,9 @@ private fun visitFunction(settings: KotlinpSettings, sb: StringBuilder, flags: F if (returnType != null) { sb.append(": ").append(returnType) } - sb.appendln() + sb.appendLine() if (contract != null) { - sb.appendln(" $contract") + sb.appendLine(" $contract") } } } @@ -141,24 +141,24 @@ private fun visitProperty( } override fun visitEnd() { - sb.appendln() + sb.appendLine() for (versionRequirement in versionRequirements) { - sb.appendln(" // $versionRequirement") + sb.appendLine(" // $versionRequirement") } if (jvmFieldSignature != null) { - sb.appendln(" // field: $jvmFieldSignature") + sb.appendLine(" // field: $jvmFieldSignature") } if (jvmGetterSignature != null) { - sb.appendln(" // getter: $jvmGetterSignature") + sb.appendLine(" // getter: $jvmGetterSignature") } if (jvmSetterSignature != null) { - sb.appendln(" // setter: $jvmSetterSignature") + sb.appendLine(" // setter: $jvmSetterSignature") } if (jvmSyntheticMethodForAnnotationsSignature != null) { - sb.appendln(" // synthetic method for annotations: $jvmSyntheticMethodForAnnotationsSignature") + sb.appendLine(" // synthetic method for annotations: $jvmSyntheticMethodForAnnotationsSignature") } if (isMovedFromInterfaceCompanion) { - sb.appendln(" // is moved from interface companion") + sb.appendLine(" // is moved from interface companion") } sb.append(" ") sb.appendFlags(flags, PROPERTY_FLAGS_MAP) @@ -177,11 +177,11 @@ private fun visitProperty( if (Flag.Property.HAS_CONSTANT(flags)) { sb.append(" /* = ... */") } - sb.appendln() + sb.appendLine() if (Flag.Property.HAS_GETTER(flags)) { sb.append(" ") sb.appendFlags(getterFlags, PROPERTY_ACCESSOR_FLAGS_MAP) - sb.appendln("get") + sb.appendLine("get") } if (Flag.Property.HAS_SETTER(flags)) { sb.append(" ") @@ -190,7 +190,7 @@ private fun visitProperty( if (setterParameter != null) { sb.append("(").append(setterParameter).append(")") } - sb.appendln() + sb.appendLine() } } } @@ -217,18 +217,18 @@ private fun visitConstructor(sb: StringBuilder, flags: Flags): KmConstructorVisi } override fun visitEnd() { - sb.appendln() + sb.appendLine() for (versionRequirement in versionRequirements) { - sb.appendln(" // $versionRequirement") + sb.appendLine(" // $versionRequirement") } if (jvmSignature != null) { - sb.appendln(" // signature: $jvmSignature") + sb.appendLine(" // signature: $jvmSignature") } sb.append(" ") sb.appendFlags(flags, CONSTRUCTOR_FLAGS_MAP) sb.append("constructor(") params.joinTo(sb) - sb.appendln(")") + sb.appendLine(")") } } @@ -257,12 +257,12 @@ private fun visitTypeAlias(settings: KotlinpSettings, sb: StringBuilder, flags: printVersionRequirement { versionRequirements.add(it) } override fun visitEnd() { - sb.appendln() + sb.appendLine() for (versionRequirement in versionRequirements) { - sb.appendln(" // $versionRequirement") + sb.appendLine(" // $versionRequirement") } for (annotation in annotations) { - sb.append(" ").append("@").append(renderAnnotation(annotation)).appendln() + sb.append(" ").append("@").append(renderAnnotation(annotation)).appendLine() } sb.append(" ") sb.appendFlags(flags, VISIBILITY_FLAGS_MAP) @@ -276,7 +276,7 @@ private fun visitTypeAlias(settings: KotlinpSettings, sb: StringBuilder, flags: if (expandedType != null) { sb.append(" /* = ").append(expandedType).append(" */") } - sb.appendln() + sb.appendLine() } } @@ -537,12 +537,12 @@ private fun StringBuilder.appendDeclarationContainerExtensions( moduleName: String? ) { for ((i, sb) in localDelegatedProperties.withIndex()) { - appendln() - appendln(" // local delegated property #$i") + appendLine() + appendLine(" // local delegated property #$i") for (line in sb.lineSequence()) { if (line.isBlank()) continue // Comment all uncommented lines to not make it look like these properties are declared here - appendln( + appendLine( if (line.startsWith(" ") && !line.startsWith(" //")) line.replaceFirst(" ", " // ") else line ) @@ -550,8 +550,8 @@ private fun StringBuilder.appendDeclarationContainerExtensions( } if (settings.isVerbose && moduleName != null) { - appendln() - appendln(" // module name: $moduleName") + appendLine() + appendLine(" // module name: $moduleName") } } @@ -564,9 +564,9 @@ private fun printContract(output: (String) -> Unit): KmContractVisitor = override fun visitEnd() { output(buildString { - appendln("contract {") + appendLine("contract {") for (effect in effects) { - appendln(" $effect") + appendLine(" $effect") } append(" }") }) @@ -705,10 +705,10 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab override fun visitEnd() { if (anonymousObjectOriginName != null) { - result.appendln("// anonymous object origin: $anonymousObjectOriginName") + result.appendLine("// anonymous object origin: $anonymousObjectOriginName") } for (versionRequirement in versionRequirements) { - result.appendln("// $versionRequirement") + result.appendLine("// $versionRequirement") } result.appendFlags(flags!!, CLASS_FLAGS_MAP) result.append(name) @@ -719,9 +719,9 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab result.append(" : ") supertypes.joinTo(result) } - result.appendln(" {") + result.appendLine(" {") result.append(sb) - result.appendln("}") + result.appendLine("}") } override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? = @@ -743,23 +743,23 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab visitTypeAlias(settings, sb, flags, name) override fun visitCompanionObject(name: String) { - sb.appendln() - sb.appendln(" // companion object: $name") + sb.appendLine() + sb.appendLine(" // companion object: $name") } override fun visitNestedClass(name: String) { - sb.appendln() - sb.appendln(" // nested class: $name") + sb.appendLine() + sb.appendLine(" // nested class: $name") } override fun visitEnumEntry(name: String) { - sb.appendln() - sb.appendln(" $name,") + sb.appendLine() + sb.appendLine(" $name,") } override fun visitSealedSubclass(name: ClassName) { - sb.appendln() - sb.appendln(" // sealed subclass: $name") + sb.appendLine() + sb.appendLine(" // sealed subclass: $name") } override fun visitVersionRequirement(): KmVersionRequirementVisitor? = @@ -799,11 +799,11 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab abstract class PackagePrinter(private val settings: KotlinpSettings) : KmPackageVisitor() { internal val sb = StringBuilder().apply { - appendln("package {") + appendLine("package {") } override fun visitEnd() { - sb.appendln("}") + sb.appendLine("}") } override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = @@ -843,14 +843,14 @@ class FileFacadePrinter(settings: KotlinpSettings) : PackagePrinter(settings), A class LambdaPrinter(private val settings: KotlinpSettings) : KmLambdaVisitor(), AbstractPrinter { private val sb = StringBuilder().apply { - appendln("lambda {") + appendLine("lambda {") } override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? = visitFunction(settings, sb, flags, name) override fun visitEnd() { - sb.appendln("}") + sb.appendLine("}") } override fun print(klass: KotlinClassMetadata.SyntheticClass): String { @@ -863,7 +863,7 @@ class MultiFileClassPartPrinter( settings: KotlinpSettings ) : PackagePrinter(settings), AbstractPrinter { override fun print(klass: KotlinClassMetadata.MultiFileClassPart): String { - sb.appendln(" // facade: ${klass.facadeClassName}") + sb.appendLine(" // facade: ${klass.facadeClassName}") klass.accept(this) return sb.toString() } @@ -872,11 +872,11 @@ class MultiFileClassPartPrinter( class MultiFileClassFacadePrinter : AbstractPrinter { override fun print(klass: KotlinClassMetadata.MultiFileClassFacade): String = buildString { - appendln("multi-file class {") + appendLine("multi-file class {") for (part in klass.partClassNames) { - appendln(" // $part") + appendLine(" // $part") } - appendln("}") + appendLine("}") } } @@ -884,19 +884,19 @@ class ModuleFilePrinter(private val settings: KotlinpSettings) : KmModuleVisitor private val optionalAnnotations = mutableListOf() private val sb = StringBuilder().apply { - appendln("module {") + appendLine("module {") } override fun visitPackageParts(fqName: String, fileFacades: List, multiFileClassParts: Map) { val presentableFqName = if (fqName.isEmpty()) "" else fqName - sb.appendln(" package $presentableFqName {") + sb.appendLine(" package $presentableFqName {") for (fileFacade in fileFacades) { - sb.appendln(" $fileFacade") + sb.appendLine(" $fileFacade") } for ((multiFileClassPart, facade) in multiFileClassParts) { - sb.appendln(" $multiFileClassPart ($facade)") + sb.appendLine(" $multiFileClassPart ($facade)") } - sb.appendln(" }") + sb.appendLine(" }") } override fun visitAnnotation(annotation: KmAnnotation) { @@ -908,14 +908,14 @@ class ModuleFilePrinter(private val settings: KotlinpSettings) : KmModuleVisitor override fun visitEnd() { if (optionalAnnotations.isNotEmpty()) { - sb.appendln() - sb.appendln(" // Optional annotations") - sb.appendln() + sb.appendLine() + sb.appendLine(" // Optional annotations") + sb.appendLine() for (element in optionalAnnotations) { - sb.appendln(" " + element.result.toString().replace("\n", "\n ").trimEnd()) + sb.appendLine(" " + element.result.toString().replace("\n", "\n ").trimEnd()) } } - sb.appendln("}") + sb.appendLine("}") } fun print(metadata: KotlinModuleMetadata): String { diff --git a/libraries/tools/kotlinp/test/org/jetbrains/kotlin/kotlinp/test/KotlinpTestUtils.kt b/libraries/tools/kotlinp/test/org/jetbrains/kotlin/kotlinp/test/KotlinpTestUtils.kt index dd4fb7bb9ce..1ed8c5975af 100644 --- a/libraries/tools/kotlinp/test/org/jetbrains/kotlin/kotlinp/test/KotlinpTestUtils.kt +++ b/libraries/tools/kotlinp/test/org/jetbrains/kotlin/kotlinp/test/KotlinpTestUtils.kt @@ -87,8 +87,8 @@ private fun compile(file: File, disposable: Disposable, tmpdir: File, forEachOut } private fun StringBuilder.appendFileName(file: File) { - appendln("// ${file.invariantSeparatorsPath}") - appendln("// ------------------------------------------") + appendLine("// ${file.invariantSeparatorsPath}") + appendLine("// ------------------------------------------") } // Reads the class file and writes it back with *Writer visitors. diff --git a/nj2k/src/org/jetbrains/kotlin/nj2k/printing/JKCommentPrinter.kt b/nj2k/src/org/jetbrains/kotlin/nj2k/printing/JKCommentPrinter.kt index 5bc45c1278b..78db40de2fc 100644 --- a/nj2k/src/org/jetbrains/kotlin/nj2k/printing/JKCommentPrinter.kt +++ b/nj2k/src/org/jetbrains/kotlin/nj2k/printing/JKCommentPrinter.kt @@ -34,7 +34,7 @@ internal class JKCommentPrinter(val printer: JKPrinter) { for (comment in this@createText) { if (comment.shouldBeDropped()) continue val text = comment.createText() ?: continue - if (needNewLine && comment.indent?.let { StringUtil.containsLineBreak(it) } != true) appendln() + if (needNewLine && comment.indent?.let { StringUtil.containsLineBreak(it) } != true) appendLine() append(comment.indent ?: ' ') append(text) needNewLine = text.startsWith("//") || '\n' in text diff --git a/plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/KaptOptions.kt b/plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/KaptOptions.kt index 8eccac04602..12f308e50cb 100644 --- a/plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/KaptOptions.kt +++ b/plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/KaptOptions.kt @@ -169,29 +169,29 @@ fun KaptOptions.collectJavaSourceFiles(sourcesToReprocess: SourcesToReprocess = fun KaptOptions.logString(additionalInfo: String = "") = buildString { val additionalInfoRendered = if (additionalInfo.isEmpty()) "" else " ($additionalInfo)" - appendln("Kapt3 is enabled$additionalInfoRendered.") + appendLine("Kapt3 is enabled$additionalInfoRendered.") - appendln("Annotation processing mode: ${mode.stringValue}") - appendln("Memory leak detection mode: ${detectMemoryLeaks.stringValue}") - KaptFlag.values().forEach { appendln(it.description + ": " + this@logString[it]) } + appendLine("Annotation processing mode: ${mode.stringValue}") + appendLine("Memory leak detection mode: ${detectMemoryLeaks.stringValue}") + KaptFlag.values().forEach { appendLine(it.description + ": " + this@logString[it]) } - appendln("Project base dir: $projectBaseDir") - appendln("Compile classpath: " + compileClasspath.joinToString()) - appendln("Java source roots: " + javaSourceRoots.joinToString()) + appendLine("Project base dir: $projectBaseDir") + appendLine("Compile classpath: " + compileClasspath.joinToString()) + appendLine("Java source roots: " + javaSourceRoots.joinToString()) - appendln("Sources output directory: $sourcesOutputDir") - appendln("Class files output directory: $classesOutputDir") - appendln("Stubs output directory: $stubsOutputDir") - appendln("Incremental data output directory: $incrementalDataOutputDir") + appendLine("Sources output directory: $sourcesOutputDir") + appendLine("Class files output directory: $classesOutputDir") + appendLine("Stubs output directory: $stubsOutputDir") + appendLine("Incremental data output directory: $incrementalDataOutputDir") - appendln("Annotation processing classpath: " + processingClasspath.joinToString()) - appendln("Annotation processors: " + processors.joinToString()) + appendLine("Annotation processing classpath: " + processingClasspath.joinToString()) + appendLine("Annotation processors: " + processors.joinToString()) - appendln("AP options: $processingOptions") - appendln("Javac options: $javacOptions") + appendLine("AP options: $processingOptions") + appendLine("Javac options: $javacOptions") - appendln("[incremental apt] Changed files: $changedFiles") - appendln("[incremental apt] Compiled sources directories: ${compiledSources.joinToString()}") - appendln("[incremental apt] Cache directory for incremental compilation: $incrementalCache") - appendln("[incremental apt] Changed classpath names: ${classpathChanges.joinToString()}") + appendLine("[incremental apt] Changed files: $changedFiles") + appendLine("[incremental apt] Compiled sources directories: ${compiledSources.joinToString()}") + appendLine("[incremental apt] Cache directory for incremental compilation: $incrementalCache") + appendLine("[incremental apt] Changed classpath names: ${classpathChanges.joinToString()}") } \ No newline at end of file diff --git a/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/AbstractKaptToolIntegrationTest.kt b/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/AbstractKaptToolIntegrationTest.kt index 783f9cbf99c..78ac71494fd 100644 --- a/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/AbstractKaptToolIntegrationTest.kt +++ b/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/AbstractKaptToolIntegrationTest.kt @@ -96,8 +96,8 @@ abstract class AbstractKaptToolIntegrationTest : TestCaseWithTmpdir() { if (!process.waitFor(2, TimeUnit.MINUTES)) err("Process is still alive") if (process.exitValue() != 0) { throw GotResult(buildString { - append("Return code: ").appendln(process.exitValue()).appendln() - appendln(outputFile.readText()) + append("Return code: ").appendLine(process.exitValue()).appendLine() + appendLine(outputFile.readText()) }) } } @@ -117,6 +117,6 @@ private val Section.args get() = readArgumentsFromArgFile(preprocessPathSeparato private fun preprocessPathSeparators(text: String): String = buildString { for (line in text.lineSequence()) { val transformed = if (line.startsWith("-cp ")) line.replace(':', File.pathSeparatorChar) else line - appendln(transformed) + appendLine(transformed) } } \ No newline at end of file diff --git a/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/Section.kt b/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/Section.kt index 025a77833f9..618b1b732c5 100644 --- a/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/Section.kt +++ b/plugins/kapt3/kapt3-cli/test/org/jetbrains/kotlin/kapt/cli/test/Section.kt @@ -33,7 +33,7 @@ class Section(val name: String, val content: String) { saveCurrent() currentName = line.drop(2) } else { - currentContent.appendln(line) + currentContent.appendLine(line) } } @@ -45,8 +45,8 @@ class Section(val name: String, val content: String) { fun List
.render(): String = buildString { for (section in this@render) { - append(SECTION_INDICATOR).appendln(section.name) - appendln(section.content).appendln() + append(SECTION_INDICATOR).appendLine(section.name) + appendLine(section.content).appendLine() } }.trim() diff --git a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt index b238db06ba5..1c005ddbb03 100644 --- a/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt +++ b/plugins/kapt3/kapt3-compiler/src/org/jetbrains/kotlin/kapt3/Kapt3Extension.kt @@ -240,8 +240,8 @@ abstract class AbstractKapt3Extension( for (leak in leaks) { logger.warn(buildString { - appendln("Memory leak detected!") - appendln("Location: '${leak.className}', static field '${leak.fieldName}'") + appendLine("Memory leak detected!") + appendLine("Location: '${leak.className}', static field '${leak.fieldName}'") append(leak.description) }) } diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSwitchExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSwitchExpression.kt index 13936e2e6d2..680cc34e674 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSwitchExpression.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSwitchExpression.kt @@ -42,9 +42,9 @@ class KotlinUSwitchExpression( override fun asRenderString() = buildString { val expr = expression?.let { "(" + it.asRenderString() + ") " } ?: "" - appendln("switch $expr {") - appendln(body.asRenderString()) - appendln("}") + appendLine("switch $expr {") + appendLine(body.asRenderString()) + appendLine("}") } override val switchIdentifier: UIdentifier @@ -62,9 +62,9 @@ class KotlinUSwitchEntry( override val body: UExpressionList by lz { object : KotlinUExpressionList(sourcePsi, KotlinSpecialExpressionKinds.WHEN_ENTRY, this@KotlinUSwitchEntry) { override fun asRenderString() = buildString { - appendln("{") - expressions.forEach { appendln(it.asRenderString().withMargin) } - appendln("}") + appendLine("{") + expressions.forEach { appendLine(it.asRenderString().withMargin) } + appendLine("}") } }.apply KotlinUExpressionList@{ val exprPsi = this@KotlinUSwitchEntry.sourcePsi.expression diff --git a/plugins/uast-kotlin/tests/AlternativesRenderLogTest.kt b/plugins/uast-kotlin/tests/AlternativesRenderLogTest.kt index bd6d033aba8..5d3a8fd6c9b 100644 --- a/plugins/uast-kotlin/tests/AlternativesRenderLogTest.kt +++ b/plugins/uast-kotlin/tests/AlternativesRenderLogTest.kt @@ -43,7 +43,7 @@ class AlternativesRenderLogTest : AbstractKotlinUastTest() { builder.append(" ".repeat(level)) builder.append("[${uElement.size}]:") builder.append(uElement.joinToString(", ", "[", "]") { it.asLogString() }) - builder.appendln() + builder.appendLine() } if (uElement.any()) level++ element.acceptChildren(this) diff --git a/plugins/uast-kotlin/tests/MultiplesRequiredTypesTest.kt b/plugins/uast-kotlin/tests/MultiplesRequiredTypesTest.kt index 45a9351ec7e..d7ba441c765 100644 --- a/plugins/uast-kotlin/tests/MultiplesRequiredTypesTest.kt +++ b/plugins/uast-kotlin/tests/MultiplesRequiredTypesTest.kt @@ -37,7 +37,7 @@ class MultiplesRequiredTypesTest : AbstractKotlinUastTest() { if (uElement != null) { builder.append(" ".repeat(level)) builder.append(uElement.asLogString()) - builder.appendln() + builder.appendLine() } if (uElement != null) level++ element.acceptChildren(this) diff --git a/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/IndentedPrintingVisitor.kt b/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/IndentedPrintingVisitor.kt index b6d0bfb1521..aa7f38a03b1 100644 --- a/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/IndentedPrintingVisitor.kt +++ b/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/IndentedPrintingVisitor.kt @@ -23,7 +23,7 @@ abstract class IndentedPrintingVisitor(val shouldIndent: (PsiElement) -> Boolean if (charSequence != null) { builder.append(" ".repeat(level)) builder.append(charSequence) - builder.appendln() + builder.appendLine() } val shouldIndent = shouldIndent(element) diff --git a/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/TypesTestBase.kt b/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/TypesTestBase.kt index 6b7e1bbc2dd..4895c621969 100644 --- a/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/TypesTestBase.kt +++ b/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/TypesTestBase.kt @@ -47,7 +47,7 @@ interface TypesTestBase { val value = node.getExpressionType() value?.let { builder.append(" : ").append(it) } } - builder.appendln() + builder.appendLine() level++ return false } diff --git a/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/ValuesTestBase.kt b/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/ValuesTestBase.kt index cfb10fc3643..9f73243603a 100644 --- a/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/ValuesTestBase.kt +++ b/plugins/uast-kotlin/tests/org/jetbrains/uast/test/common/kotlin/ValuesTestBase.kt @@ -54,7 +54,7 @@ interface ValuesTestBase { val value = evaluationContext.valueOf(node) builder.append(" = ").append(value) } - builder.appendln() + builder.appendLine() level++ return false }