Cleanup: apply redundant string template inspection

This commit is contained in:
Mikhail Glukhikh
2016-08-03 10:04:16 +03:00
parent 10ea2883f7
commit e37800d056
6 changed files with 9 additions and 9 deletions
@@ -55,7 +55,7 @@ class ModulesDependenciesTest : TestCase() {
TestCase.assertTrue("Number of modules have dependencies to module $COMPILER_TESTS_MODULE_NAME. Such dependencies can cause multiple " + TestCase.assertTrue("Number of modules have dependencies to module $COMPILER_TESTS_MODULE_NAME. Such dependencies can cause multiple " +
"tests execution on teamcity when running configuration with 'Search tests across module dependencies' enabled:\n" + "tests execution on teamcity when running configuration with 'Search tests across module dependencies' enabled:\n" +
"${badModulesList.joinToString(separator = "\n")}", badModulesList.joinToString(separator = "\n"),
badModulesList.isEmpty()) badModulesList.isEmpty())
} }
@@ -249,7 +249,7 @@ abstract class AbstractWriteSignatureTest : TestCaseWithTmpdir() {
companion object { companion object {
fun formatSignature(header: String, jvmSignature: String?, genericSignature: String): String { fun formatSignature(header: String, jvmSignature: String?, genericSignature: String): String {
return listOf( return listOf(
"$header", header,
jvmSignature?.let { "jvm signature: $it" }, jvmSignature?.let { "jvm signature: $it" },
"generic signature: $genericSignature" "generic signature: $genericSignature"
).filterNotNull().joinToString("\n") { "// $it" } ).filterNotNull().joinToString("\n") { "// $it" }
@@ -40,7 +40,7 @@ fun main(args: Array<String>) {
println("prefix=$versionPrefix incrementPart=$incrementPart result=$result filePath=$filePath") println("prefix=$versionPrefix incrementPart=$incrementPart result=$result filePath=$filePath")
File("$filePath").writeText("$result") File(filePath).writeText(result)
} }
main(args) main(args)
@@ -54,7 +54,7 @@ class KotlinSuppressIntentionAction private constructor(
when (suppressAt) { when (suppressAt) {
is KtModifierListOwner -> is KtModifierListOwner ->
suppressAt.addAnnotation(KotlinBuiltIns.FQ_NAMES.suppress.toSafe(), suppressAt.addAnnotation(KotlinBuiltIns.FQ_NAMES.suppress.toSafe(),
"$id", id,
whiteSpaceText = if (kind.newLineNeeded) "\n" else " ", whiteSpaceText = if (kind.newLineNeeded) "\n" else " ",
addToExistingAnnotation = { entry -> addToExistingAnnotation = { entry ->
addArgumentToSuppressAnnotation(entry, id) addArgumentToSuppressAnnotation(entry, id)
@@ -51,11 +51,11 @@ class CommandExecutor(private val runner: KotlinConsoleRunner) {
val processInputOS = processHandler.processInput ?: return logError(javaClass, "<p>Broken process stream</p>") val processInputOS = processHandler.processInput ?: return logError(javaClass, "<p>Broken process stream</p>")
val charset = (processHandler as? BaseOSProcessHandler)?.charset ?: Charsets.UTF_8 val charset = (processHandler as? BaseOSProcessHandler)?.charset ?: Charsets.UTF_8
val xmlRes = "$XML_PREAMBLE" + val xmlRes = XML_PREAMBLE +
"<input>" + "<input>" +
"${StringUtil.escapeXml( StringUtil.escapeXml(
StringUtil.replace(command, SOURCE_CHARS, XML_REPLACEMENTS) StringUtil.replace(command, SOURCE_CHARS, XML_REPLACEMENTS)
)}" + ) +
"</input>" "</input>"
val bytes = ("$xmlRes\n").toByteArray(charset) val bytes = ("$xmlRes\n").toByteArray(charset)
@@ -76,13 +76,13 @@ fun KtElement.renderTrimmed(): String {
} }
override fun visitPrefixExpression(expression: KtPrefixExpression) { override fun visitPrefixExpression(expression: KtPrefixExpression) {
builder.append("${expression.operationReference.getReferencedName()}") builder.append(expression.operationReference.getReferencedName())
expression.baseExpression?.accept(this) expression.baseExpression?.accept(this)
} }
override fun visitPostfixExpression(expression: KtPostfixExpression) { override fun visitPostfixExpression(expression: KtPostfixExpression) {
expression.baseExpression?.accept(this) expression.baseExpression?.accept(this)
builder.append("${expression.operationReference.getReferencedName()}") builder.append(expression.operationReference.getReferencedName())
} }
override fun visitBinaryExpression(expression: KtBinaryExpression) { override fun visitBinaryExpression(expression: KtBinaryExpression) {