Replace appendln with appendLine in project

This commit is contained in:
Alexander Udalov
2020-06-09 21:09:45 +02:00
parent d1c88798df
commit 6e67e1e78d
76 changed files with 405 additions and 402 deletions
@@ -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())
}
}
@@ -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 {
@@ -53,7 +53,7 @@ object SMAPTestUtil {
StringReader(file.content).forEachLine { line ->
// Strip comments
if (!line.startsWith("//")) {
appendln(line.trim())
appendLine(line.trim())
}
}
}.trim()
@@ -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())
}
}
@@ -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)
}
@@ -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)
@@ -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()
}
@@ -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() }}")
}
}
}
@@ -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")
}
}
}