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
@@ -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)
}
@@ -175,7 +175,7 @@ class PluginDeclarationProviderFactory(
append(it.name)
append(" isPhysical=${it.isPhysical}")
append(" modStamp=${it.modificationStamp}")
appendln()
appendLine()
}
}
}
@@ -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)
}
}
@@ -79,9 +79,9 @@ class ModulesEditorToolbarDecorator(
buildString {
val moduleName = selectedModule?.name!!
if (tree.selectedSettingItem.safeAs<Module>()?.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),
@@ -59,9 +59,9 @@ abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithSteppin
}
private fun renderAsyncStackTrace(trace: List<StackFrameItem>) = 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)
}
}
}
@@ -52,7 +52,7 @@ abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping(
private fun stringDump(infoData: List<CoroutineInfoData>) = buildString {
infoData.forEach {
appendln("\"${it.key.name}\", state: ${it.key.state}")
appendLine("\"${it.key.name}\", state: ${it.key.state}")
}
}
@@ -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")
})
}
@@ -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)
}
}
}
@@ -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<Any>) {
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()
}
}
@@ -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() ?: "<interceptor not installed>")
append("=".repeat(40)).appendLine(" Gradle process output:")
appendLine(GradleProcessOutputInterceptor.getInstance()?.getOutput()?.trimEnd() ?: "<interceptor not installed>")
appendln("=".repeat(40))
appendLine("=".repeat(40))
}
fail(failure)
@@ -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)
}
@@ -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()
}
})
}
@@ -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()
}
})
}
@@ -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()
}
})
}
@@ -64,7 +64,7 @@ class JavaContextDeclarationRenderer {
buildString {
for (member in this@render) {
renderJavaDeclaration(member)
appendln()
appendLine()
}
}
@@ -227,7 +227,7 @@ object KDocRenderer {
sb.append("<$tag>")
processChildren()
sb.append("</$tag>")
if (newline) sb.appendln()
if (newline) sb.appendLine()
}
val nodeType = node.type
@@ -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}")
}
}
})
@@ -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(