From 137526799672980114b796d001d012e5e7d4597d Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 17 Feb 2017 15:26:07 +0300 Subject: [PATCH] Cleanup: apply redundant curly braces in string template inspection --- .../jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt | 2 +- .../src/org/jetbrains/kotlin/daemon/common/DaemonParams.kt | 6 +++--- .../src/org/jetbrains/kotlin/daemon/KotlinCompileDaemon.kt | 2 +- .../load/java/lazy/descriptors/LazyJavaClassMemberScope.kt | 2 +- .../kotlin/load/kotlin/reflect/ReflectKotlinClassFinder.kt | 2 +- .../jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt | 2 +- .../maven/inspections/KotlinMavenPluginPhaseInspection.kt | 2 +- .../kotlin/idea/coverage/KotlinCoverageExtension.kt | 2 +- .../ReplaceMathMethodsWithKotlinNativeMethodsIntention.kt | 2 +- idea/src/org/jetbrains/kotlin/idea/kdoc/KDocRenderer.kt | 4 ++-- .../jetbrains/kotlin/js/resolve/diagnostics/jsRenderers.kt | 4 ++-- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt index f3bc88c9cd4..d464794794e 100644 --- a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt +++ b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt @@ -211,7 +211,7 @@ object KotlinCompilerClient { val unrecognized = it.trimQuotes().split(",").filterExtractProps(opts.mappers, "") if (unrecognized.any()) throw IllegalArgumentException( - "Unrecognized client options passed via property ${COMPILE_DAEMON_OPTIONS_PROPERTY}: " + unrecognized.joinToString(" ") + + "Unrecognized client options passed via property $COMPILE_DAEMON_OPTIONS_PROPERTY: " + unrecognized.joinToString(" ") + "\nSupported options: " + opts.mappers.joinToString(", ", transform = { it.names.first() })) } return opts diff --git a/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/DaemonParams.kt b/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/DaemonParams.kt index 9e811ce780a..cafa467206d 100644 --- a/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/DaemonParams.kt +++ b/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/DaemonParams.kt @@ -277,8 +277,8 @@ fun configureDaemonJVMOptions(opts: DaemonJVMOptions, opts.jvmParams.addAll(additionalParams) if (inheritAdditionalProperties) { - System.getProperty(COMPILE_DAEMON_LOG_PATH_PROPERTY)?.let { opts.jvmParams.add("D${COMPILE_DAEMON_LOG_PATH_PROPERTY}=\"$it\"") } - System.getProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY)?.let { opts.jvmParams.add("D${KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY}") } + System.getProperty(COMPILE_DAEMON_LOG_PATH_PROPERTY)?.let { opts.jvmParams.add("D$COMPILE_DAEMON_LOG_PATH_PROPERTY=\"$it\"") } + System.getProperty(KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY)?.let { opts.jvmParams.add("D$KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY") } } return opts } @@ -299,7 +299,7 @@ fun configureDaemonOptions(opts: DaemonOptions): DaemonOptions { val unrecognized = it.trimQuotes().split(",").filterExtractProps(opts.mappers, "") if (unrecognized.any()) throw IllegalArgumentException( - "Unrecognized daemon options passed via property ${COMPILE_DAEMON_OPTIONS_PROPERTY}: " + unrecognized.joinToString(" ") + + "Unrecognized daemon options passed via property $COMPILE_DAEMON_OPTIONS_PROPERTY: " + unrecognized.joinToString(" ") + "\nSupported options: " + opts.mappers.joinToString(", ", transform = { it.names.first() })) } System.getProperty(COMPILE_DAEMON_VERBOSE_REPORT_PROPERTY)?.let { opts.verbose = true } diff --git a/compiler/daemon/src/org/jetbrains/kotlin/daemon/KotlinCompileDaemon.kt b/compiler/daemon/src/org/jetbrains/kotlin/daemon/KotlinCompileDaemon.kt index c9c28e4bea8..404c6baa8d1 100644 --- a/compiler/daemon/src/org/jetbrains/kotlin/daemon/KotlinCompileDaemon.kt +++ b/compiler/daemon/src/org/jetbrains/kotlin/daemon/KotlinCompileDaemon.kt @@ -66,7 +66,7 @@ object KotlinCompileDaemon { "java.util.logging.FileHandler.limit = ${if (fileIsGiven) 0 else (1 shl 20)}\n" + // if file is provided - disabled, else - 1Mb "java.util.logging.FileHandler.count = ${if (fileIsGiven) 1 else 3}\n" + "java.util.logging.FileHandler.append = $fileIsGiven\n" + - "java.util.logging.FileHandler.pattern = ${if (fileIsGiven) logPath else (logPath + File.separator + "${COMPILE_DAEMON_DEFAULT_FILES_PREFIX}.$logTime.%u%g.log")}\n" + + "java.util.logging.FileHandler.pattern = ${if (fileIsGiven) logPath else (logPath + File.separator + "$COMPILE_DAEMON_DEFAULT_FILES_PREFIX.$logTime.%u%g.log")}\n" + "java.util.logging.SimpleFormatter.format = %1\$tF %1\$tT.%1\$tL [%3\$s] %4\$s: %5\$s%n\n" LogManager.getLogManager().readConfiguration(cfg.byteInputStream()) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt index 47472a81c11..6f1ba83c234 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt @@ -447,7 +447,7 @@ class LazyJavaClassMemberScope( null assert(setterMethod?.let { it.modality == getterMethod.modality } ?: true) { - "Different accessors modalities when creating overrides for $overriddenProperty in ${ownerDescriptor}" + + "Different accessors modalities when creating overrides for $overriddenProperty in $ownerDescriptor" + "for getter is ${getterMethod.modality}, but for setter is ${setterMethod?.modality}" } diff --git a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClassFinder.kt b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClassFinder.kt index 6ee203e276f..46556c41a2a 100644 --- a/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClassFinder.kt +++ b/core/descriptors.runtime/src/org/jetbrains/kotlin/load/kotlin/reflect/ReflectKotlinClassFinder.kt @@ -48,5 +48,5 @@ class ReflectKotlinClassFinder(private val classLoader: ClassLoader) : KotlinCla private fun ClassId.toRuntimeFqName(): String { val className = relativeClassName.asString().replace('.', '$') - return if (packageFqName.isRoot) className else "${packageFqName}.$className" + return if (packageFqName.isRoot) className else "$packageFqName.$className" } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt index 7dd08424f1f..9cbff6eada6 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/getModuleInfo.kt @@ -56,7 +56,7 @@ private fun PsiElement.getModuleInfo(onFailure: (String) -> IdeaModuleInfo?): Id val doNotAnalyze = containingJetFile?.doNotAnalyze if (doNotAnalyze != null) { return onFailure( - "Should not analyze element: ${text} in file ${containingJetFile?.name ?: " "}\n$doNotAnalyze" + "Should not analyze element: $text in file ${containingJetFile?.name ?: " "}\n$doNotAnalyze" ) } diff --git a/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/inspections/KotlinMavenPluginPhaseInspection.kt b/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/inspections/KotlinMavenPluginPhaseInspection.kt index 5a7ec8ff22f..3e9fff11ec1 100644 --- a/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/inspections/KotlinMavenPluginPhaseInspection.kt +++ b/idea/idea-maven/src/org/jetbrains/kotlin/idea/maven/inspections/KotlinMavenPluginPhaseInspection.kt @@ -125,7 +125,7 @@ class KotlinMavenPluginPhaseInspection : DomElementsInspection
${title}:
") + to.append("
$title:
") tags.forEach { to.append("
${it.getSubjectName()} - ${markdownToHtml(it.getContent().trimStart())}
") } @@ -150,7 +150,7 @@ object KDocRenderer { private fun renderTag(tag: KDocTag?, title: String, to: StringBuilder) { if (tag != null) { - to.append("
${title}:
") + to.append("
$title:
") to.append("
${markdownToHtml(tag.getContent())}
") to.append("
\n") } 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 edf40981acc..80c5e7c29f5 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 @@ -44,7 +44,7 @@ object JsCallDataTextRenderer : JsCallDataRenderer() { override fun format(data: JsCallDataWithCode): String { val codeRange = data.codeRange val code = data.code.underlineAsText(codeRange.startOffset, codeRange.endOffset) - return "${data.message} in code:\n${code}" + return "${data.message} in code:\n$code" } } @@ -52,7 +52,7 @@ object JsCallDataHtmlRenderer : JsCallDataRenderer() { override fun format(data: JsCallDataWithCode): String { val codeRange = data.codeRange val code = data.code.underlineAsHtml(codeRange.startOffset, codeRange.endOffset) - return "${data.message} in code:
${code}
" + return "${data.message} in code:
$code
" } }