Replace deprecated join with joinToString
This commit is contained in:
@@ -52,7 +52,7 @@ public class Kotlin2JsTask : KotlinCompilerBaseTask() {
|
||||
// TODO: write test
|
||||
library?.let {
|
||||
args.add("-library-files")
|
||||
args.add(it.list().map { File(it).canonicalPath }.join(separator = ","))
|
||||
args.add(it.list().joinToString(separator = ",") { File(it).canonicalPath })
|
||||
}
|
||||
|
||||
outputPrefix?.let {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask() {
|
||||
|
||||
compileClasspath?.let {
|
||||
args.add("-classpath")
|
||||
args.add(it.list().join(pathSeparator))
|
||||
args.add(it.list().joinToString(pathSeparator))
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ public class SMAPBuilder(val source: String,
|
||||
return null;
|
||||
}
|
||||
|
||||
val fileIds = "*F" + realMappings.mapIndexed { id, file -> "\n${file.toSMAPFile(id + 1)}" }.join("")
|
||||
val lineMappings = "*L" + realMappings.map { it.toSMAPMapping() }.join("")
|
||||
val fileIds = "*F" + realMappings.mapIndexed { id, file -> "\n${file.toSMAPFile(id + 1)}" }.joinToString("")
|
||||
val lineMappings = "*L" + realMappings.joinToString("") { it.toSMAPMapping() }
|
||||
|
||||
return "$header\n$fileIds\n$lineMappings\n*E\n"
|
||||
}
|
||||
@@ -58,9 +58,7 @@ public class SMAPBuilder(val source: String,
|
||||
|
||||
//TODO inline
|
||||
fun FileMapping.toSMAPMapping(): String {
|
||||
return lineMappings.map {
|
||||
"\n${it.toSMAP(id)}"
|
||||
}.join("")
|
||||
return lineMappings.joinToString("") { "\n${it.toSMAP(id)}" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -283,12 +283,12 @@ private object DebugTextBuildingVisitor : KtVisitor<String, Unit>() {
|
||||
|
||||
fun renderChildren(element: KtElementImplStub<*>, separator: String, prefix: String = "", postfix: String = ""): String? {
|
||||
val childrenTexts = element.getStub()?.getChildrenStubs()?.map { (it?.getPsi() as? KtElement)?.getDebugText() }
|
||||
return childrenTexts?.filterNotNull()?.join(separator, prefix, postfix) ?: element.getText()
|
||||
return childrenTexts?.filterNotNull()?.joinToString(separator, prefix, postfix) ?: element.getText()
|
||||
}
|
||||
|
||||
fun render(element: KtElementImplStub<*>, vararg relevantChildren: KtElement?): String? {
|
||||
if (element.getStub() == null) return element.getText()
|
||||
return relevantChildren.filterNotNull().map { it.getDebugText() }.join("", "", "")
|
||||
return relevantChildren.filterNotNull().map { it.getDebugText() }.joinToString("", "", "")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ public abstract class KtCodeFragment(
|
||||
}
|
||||
|
||||
override fun importsToString(): String {
|
||||
return myImports.join(IMPORT_SEPARATOR)
|
||||
return myImports.joinToString(IMPORT_SEPARATOR)
|
||||
}
|
||||
|
||||
override fun addImportsFromString(imports: String?) {
|
||||
@@ -110,7 +110,7 @@ public abstract class KtCodeFragment(
|
||||
}
|
||||
|
||||
public fun importsAsImportList(): KtImportList? {
|
||||
return KtPsiFactory(this).createFile(myImports.join("\n")).getImportList()
|
||||
return KtPsiFactory(this).createFile(myImports.joinToString("\n")).getImportList()
|
||||
}
|
||||
|
||||
override fun setVisibilityChecker(checker: JavaCodeFragment.VisibilityChecker?) { }
|
||||
|
||||
@@ -36,7 +36,7 @@ public open class KotlinStubBaseImpl<T : KtElementImplStub<*>>(parent: StubEleme
|
||||
if (propertiesValues.isEmpty()) {
|
||||
return ""
|
||||
}
|
||||
return propertiesValues.join(separator = ", ", prefix = "[", postfix = "]")
|
||||
return propertiesValues.joinToString(separator = ", ", prefix = "[", postfix = "]")
|
||||
}
|
||||
|
||||
private fun renderPropertyValues(stubInterface: Class<out Any?>): List<String> {
|
||||
|
||||
@@ -67,7 +67,7 @@ class LazyOperationsLog(
|
||||
return groupedByOwner.map {
|
||||
val (owner, records) = it
|
||||
renderOwner(owner, records)
|
||||
}.sortedBy(stringSanitizer).join("\n").renumberObjects()
|
||||
}.sortedBy(stringSanitizer).joinToString("\n").renumberObjects()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -112,7 +112,7 @@ class LazyOperationsLog(
|
||||
sb.append(data.field?.getName() ?: "in ${data.lambdaCreatedIn.getDeclarationName()}")
|
||||
|
||||
if (!data.arguments.isEmpty()) {
|
||||
sb.append(data.arguments.map { render(it) }.join(", ", "(", ")"))
|
||||
data.arguments.joinTo(sb, ", ", "(", ")") { render(it) }
|
||||
}
|
||||
|
||||
sb.append(" = ${render(data.result)}")
|
||||
@@ -176,10 +176,8 @@ class LazyOperationsLog(
|
||||
sb.append("[empty]")
|
||||
}
|
||||
else {
|
||||
val size = o.size()
|
||||
sb.append("[$size] { ").append(o.take(3).map { render(it) }.join(", "))
|
||||
if (o.size() > 3) sb.append(", ...")
|
||||
sb.append(" }")
|
||||
sb.append("[${o.size}] ")
|
||||
o.joinTo(sb, ", ", prefix = "{", postfix = "}", limit = 3) { render(it) }
|
||||
}
|
||||
}
|
||||
o is KotlinTypeImpl -> {
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.codegen;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Lists;
|
||||
import kotlin.StringsKt;
|
||||
import org.jetbrains.kotlin.utils.StringsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.analyzer.AnalysisResult;
|
||||
@@ -128,7 +128,7 @@ public class CodegenTestUtil {
|
||||
classpath.addAll(additionalClasspath);
|
||||
|
||||
List<String> options = new ArrayList<String>(Arrays.asList(
|
||||
"-classpath", StringsKt.join(classpath, File.pathSeparator, "", "", -1, ""),
|
||||
"-classpath", StringsKt.join(classpath, File.pathSeparator),
|
||||
"-d", javaClassesTempDirectory.getPath()
|
||||
));
|
||||
options.addAll(additionalOptions);
|
||||
|
||||
@@ -67,7 +67,7 @@ public interface AbstractSMAPBaseTest {
|
||||
val compiledData = extractSMAPFromClasses(outputFiles).groupBy {
|
||||
it.sourceFile
|
||||
}.map {
|
||||
val smap = it.getValue().map { replaceHash(it.smap) }.filterNotNull().join("\n")
|
||||
val smap = it.getValue().map { replaceHash(it.smap) }.filterNotNull().joinToString("\n")
|
||||
SMAPAndFile(if (smap.isNotEmpty()) smap else null, it.key)
|
||||
}.toMap { it.sourceFile }
|
||||
|
||||
@@ -85,7 +85,7 @@ public interface AbstractSMAPBaseTest {
|
||||
|
||||
val files = data.substring(fileSectionStart, lineSection).split("\n")
|
||||
|
||||
val cleaned = files.join("\n")
|
||||
val cleaned = files.joinToString("\n")
|
||||
|
||||
return data.substring(0, fileSectionStart) + cleaned + data.substring(lineSection)
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public abstract class AbstractWriteSignatureTest : TestCaseWithTmpdir() {
|
||||
methodExpectations.filterNotTo(uncheckedExpectations) { it.isChecked() }
|
||||
fieldExpectations.filterNotTo(uncheckedExpectations) { it.isChecked() }
|
||||
Assert.assertTrue(
|
||||
"Unchecked expectations (${uncheckedExpectations.size()} total):\n " + uncheckedExpectations.join("\n "),
|
||||
"Unchecked expectations (${uncheckedExpectations.size()} total):\n " + uncheckedExpectations.joinToString("\n "),
|
||||
uncheckedExpectations.isEmpty())
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -110,10 +110,10 @@ abstract public class AbstractConstraintSystemTest() : KotlinLiteFixture() {
|
||||
val parameterType = testDeclarations.getType(it.getName().asString())
|
||||
val resultType = resultingSubstitutor.substitute(parameterType, Variance.INVARIANT)
|
||||
"${it.getName()}=${resultType?.let { DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(it) }}"
|
||||
}.join("\n", prefix = "result:\n")
|
||||
}.joinToString("\n", prefix = "result:\n")
|
||||
|
||||
val boundsFile = File(filePath.replace("constraints", "bounds"))
|
||||
KotlinTestUtils.assertEqualsToFile(boundsFile, "${constraintsFileText.join("\n")}\n\n$resultingStatus\n\n$result")
|
||||
KotlinTestUtils.assertEqualsToFile(boundsFile, "${constraintsFileText.joinToString("\n")}\n\n$resultingStatus\n\n$result")
|
||||
}
|
||||
|
||||
class MyConstraint(val kind: MyConstraintKind, val firstType: String, val secondType: String)
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public object RawTypeCapabilities : TypeCapabilities {
|
||||
|
||||
if (!upperArgs.isNotEmpty()) return null
|
||||
|
||||
val newArgs = lowerArgs.map { "(raw) $it" }.join(", ")
|
||||
val newArgs = lowerArgs.map { "(raw) $it" }.joinToString(", ")
|
||||
val newUpper =
|
||||
if (lowerArgs.zip(upperArgs).all { onlyOutDiffers(it.first, it.second) })
|
||||
upperRendered.replaceArgs(newArgs)
|
||||
|
||||
@@ -17,4 +17,4 @@
|
||||
package org.jetbrains.kotlin.utils
|
||||
|
||||
// Needed for Java interop: otherwise you need to specify all the optional parameters to join, i.e. prefix, postfix, limit, truncated
|
||||
fun Iterable<Any>.join(separator: String) = joinToString(separator)
|
||||
fun join(collection: Iterable<Any>, separator: String) = collection.joinToString(separator)
|
||||
|
||||
@@ -238,7 +238,7 @@ class GenerateProtoBufCompare {
|
||||
val allFields = fields + extFields
|
||||
|
||||
p.println("public enum class ${className}Kind {")
|
||||
p.println(allFields.map { " " + it.enumName }.join(",\n "))
|
||||
p.println(allFields.joinToString(",\n ") { " " + it.enumName })
|
||||
p.println("}")
|
||||
|
||||
p.println()
|
||||
@@ -440,5 +440,5 @@ class GenerateProtoBufCompare {
|
||||
}
|
||||
|
||||
private val String.javaName: String
|
||||
get() = this.split("_").map { it.capitalize() }.join("").decapitalize()
|
||||
get() = this.split("_").joinToString("") { it.capitalize() }.decapitalize()
|
||||
}
|
||||
+3
-3
@@ -329,9 +329,9 @@ class TestDataBuilder() {
|
||||
}
|
||||
|
||||
if (isCreatingFromScratch) {
|
||||
shouldBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_BE_ESCAPED.join("\n")}")
|
||||
shouldNotBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_NOT_BE_ESCAPED.join("\n")}")
|
||||
casesFile.writeText("$PREAMBLE_MESSAGE\n${cases.join("\n")}")
|
||||
shouldBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_BE_ESCAPED.joinToString("\n")}")
|
||||
shouldNotBeEscapedFile.writeText("$PREAMBLE_MESSAGE\n${SHOULD_NOT_BE_ESCAPED.joinToString("\n")}")
|
||||
casesFile.writeText("$PREAMBLE_MESSAGE\n${cases.joinToString("\n")}")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ private object DeclarationKindDetector : KtVisitor<AnnotationHostKind?, Unit?>()
|
||||
override fun visitProperty(d: KtProperty, data: Unit?) = detect(d, d.getValOrVarKeyword().getText()!!)
|
||||
|
||||
override fun visitMultiDeclaration(d: KtMultiDeclaration, data: Unit?) = detect(d, d.getValOrVarKeyword()?.getText() ?: "val",
|
||||
name = d.getEntries().map { it.getName()!! }.join(", ", "(", ")"))
|
||||
name = d.getEntries().map { it.getName()!! }.joinToString(", ", "(", ")"))
|
||||
|
||||
override fun visitTypeParameter(d: KtTypeParameter, data: Unit?) = detect(d, "type parameter", newLineNeeded = false)
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ fun <D : CallableDescriptor> renderResolvedCall(resolvedCall: ResolvedCall<D>):
|
||||
|
||||
append("<br/>$indent<i>where</i> ")
|
||||
if (!notInferredTypeParameters.isEmpty()) {
|
||||
append(notInferredTypeParameters.map { typeParameter -> renderError(typeParameter.getName()) }.join())
|
||||
append(notInferredTypeParameters.map { typeParameter -> renderError(typeParameter.getName()) }.joinToString())
|
||||
append("<i> cannot be inferred</i>")
|
||||
if (!inferredTypeParameters.isEmpty()) {
|
||||
append("; ")
|
||||
@@ -88,8 +88,8 @@ fun <D : CallableDescriptor> renderResolvedCall(resolvedCall: ResolvedCall<D>):
|
||||
val typeParameterToTypeArgumentMap = resolvedCall.getTypeArguments()
|
||||
if (!inferredTypeParameters.isEmpty()) {
|
||||
append(inferredTypeParameters.map { typeParameter ->
|
||||
"${typeParameter.getName()} = ${htmlRenderer.renderType(typeParameterToTypeArgumentMap[typeParameter]!!)}"
|
||||
}.join())
|
||||
"${typeParameter.getName()} = ${htmlRenderer.renderType(typeParameterToTypeArgumentMap[typeParameter]!!)}"
|
||||
}.joinToString())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ fun <D : CallableDescriptor> renderResolvedCall(resolvedCall: ResolvedCall<D>):
|
||||
append(htmlRenderer.renderType(receiverParameter.getType())).append(".")
|
||||
}
|
||||
append(resultingDescriptor.getName()).append("(")
|
||||
append(resultingDescriptor.getValueParameters().map { parameter -> renderParameter(parameter) }.join())
|
||||
append(resultingDescriptor.getValueParameters().map { parameter -> renderParameter(parameter) }.joinToString())
|
||||
append(if (resolvedCall.hasUnmappedArguments()) renderError(")") else ")")
|
||||
|
||||
if (!resolvedCall.getCandidateDescriptor().getTypeParameters().isEmpty()) {
|
||||
|
||||
+2
-2
@@ -63,9 +63,9 @@ class ParameterNameAndTypeCompletion(
|
||||
val nameSuggestionPrefixes = if (prefix.isEmpty() || prefix[0].isUpperCase())
|
||||
emptyList()
|
||||
else
|
||||
prefixWords.indices.map { index -> if (index == 0) prefix else prefixWords.drop(index).join("") }
|
||||
prefixWords.indices.map { index -> if (index == 0) prefix else prefixWords.drop(index).joinToString("") }
|
||||
|
||||
userPrefixes = nameSuggestionPrefixes.indices.map { prefixWords.take(it).join("") }
|
||||
userPrefixes = nameSuggestionPrefixes.indices.map { prefixWords.take(it).joinToString("") }
|
||||
classNamePrefixMatchers = nameSuggestionPrefixes.map { CamelHumpMatcher(it.capitalize(), false) }
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ConsoleErrorRenderer(private val messages: List<SeverityDetails>) :
|
||||
|
||||
override fun getTooltipText(): String {
|
||||
val htmlTooltips = messages map { "<b>${msgType(it.severity)}</b> ${it.description}" }
|
||||
return "<html>${htmlTooltips.join("<hr size=1 noshade>")}</html>"
|
||||
return "<html>${htmlTooltips.joinToString("<hr size=1 noshade>")}</html>"
|
||||
}
|
||||
|
||||
override fun getIcon() = ReplIcons.COMPILER_ERROR
|
||||
|
||||
@@ -124,7 +124,7 @@ public class KotlinCoverageExtension(): JavaCoverageEngineExtension() {
|
||||
if (existingClassFiles.isEmpty()) {
|
||||
return null
|
||||
}
|
||||
LOG.debug("Classfiles: [${existingClassFiles.map { it.getName() }.join()}]")
|
||||
LOG.debug("Classfiles: [${existingClassFiles.map { it.getName() }.joinToString()}]")
|
||||
return existingClassFiles.map {
|
||||
val relativePath = VfsUtilCore.getRelativePath(it, outputRoot!!)!!
|
||||
StringUtil.trimEnd(relativePath, ".class").replace("/", ".")
|
||||
@@ -159,7 +159,7 @@ public class KotlinCoverageExtension(): JavaCoverageEngineExtension() {
|
||||
if (packageOutputDir == null) return listOf()
|
||||
|
||||
val prefixes = collectClassFilePrefixes(file)
|
||||
LOG.debug("Classfile prefixes: [${prefixes.join(", ")}]")
|
||||
LOG.debug("Classfile prefixes: [${prefixes.joinToString(", ")}]")
|
||||
return packageOutputDir.getChildren().filter {
|
||||
file -> prefixes.any {
|
||||
(file.getName().startsWith(it + "$") && FileUtilRt.getExtension(file.getName()) == "class") ||
|
||||
|
||||
@@ -61,7 +61,7 @@ object SuperDeclarationMarkerTooltip: Function<KtDeclaration, String> {
|
||||
"${if (!isAbstract && isBaseAbstract) "Implements" else "Overrides"} $memberKind in '${renderer.render(declaration)}'"
|
||||
}
|
||||
|
||||
return containingStrings.sorted().join(separator = "<br/>")
|
||||
return containingStrings.sorted().joinToString(separator = "<br/>")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class ConvertToConcatenatedStringIntention : SelfTargetingOffsetIndepende
|
||||
.mapIndexed { index, entry ->
|
||||
entry.toSeparateString(quote, convertExplicitly = (index == 0), isFinalEntry = (index == entries.lastIndex))
|
||||
}
|
||||
.join(separator = "+")
|
||||
.joinToString(separator = "+")
|
||||
.replace("""$quote+$quote""", "")
|
||||
|
||||
val replacement = KtPsiFactory(element).createExpression(text)
|
||||
|
||||
@@ -74,7 +74,7 @@ object IdeaDocCommentConverter : DocCommentConverter {
|
||||
|
||||
private fun convertInlineDocTag(tag: PsiInlineDocTag) = when(tag.getName()) {
|
||||
"code", "literal" -> {
|
||||
val text = tag.getDataElements().map { it.getText() }.join("")
|
||||
val text = tag.getDataElements().joinToString("") { it.getText() }
|
||||
val escaped = StringUtil.escapeXml(text.trimStart())
|
||||
if (tag.getName() == "code") "<code>$escaped</code>" else escaped
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ object KDocRenderer {
|
||||
// Avoid wrapping the entire converted contents in a <p> tag if it's just a single paragraph
|
||||
val maybeSingleParagraph = markdownNode.children.filter { it.type != MarkdownTokenTypes.EOL }.singleOrNull()
|
||||
if (maybeSingleParagraph != null && !allowSingleParagraph) {
|
||||
return maybeSingleParagraph.children.map { it.toHtml() }.join("")
|
||||
return maybeSingleParagraph.children.joinToString("") { it.toHtml() }
|
||||
} else {
|
||||
return markdownNode.toHtml()
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ public class MakeOverriddenMemberOpenFix(declaration: KtDeclaration) : KotlinQui
|
||||
}
|
||||
|
||||
Collections.sort(containingDeclarationsNames)
|
||||
val declarations = containingDeclarationsNames.subList(0, containingDeclarationsNames.size()-1).join(", ") + " and " +
|
||||
containingDeclarationsNames.last()
|
||||
val declarations = containingDeclarationsNames.subList(0, containingDeclarationsNames.size()-1).joinToString(", ") + " and " +
|
||||
containingDeclarationsNames.last()
|
||||
return "Make '${element.name}' in $declarations open"
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public abstract class AbstractKotlinCoverageOutputFilesTest(): KotlinLightCodeIn
|
||||
}
|
||||
|
||||
val actualClasses = KotlinCoverageExtension.collectGeneratedClassQualifiedNames(outDir, kotlinFile)
|
||||
KotlinTestUtils.assertEqualsToFile(File(path.replace(".kt", ".expected.txt")), actualClasses!!.join("\n"))
|
||||
KotlinTestUtils.assertEqualsToFile(File(path.replace(".kt", ".expected.txt")), actualClasses!!.joinToString("\n"))
|
||||
}
|
||||
finally {
|
||||
runWriteAction {
|
||||
|
||||
@@ -34,5 +34,4 @@ fun PsiDocTag.content(): String =
|
||||
.dropWhile { it.getNode().getElementType() == JavaDocTokenType.DOC_TAG_NAME }
|
||||
.dropWhile { it is PsiWhiteSpace }
|
||||
.filterNot { it.getNode().getElementType() == JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS }
|
||||
.map { it.getText() }
|
||||
.join("")
|
||||
.joinToString("") { it.getText() }
|
||||
|
||||
@@ -138,7 +138,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
val dataManager = projectDescriptor.dataManager
|
||||
|
||||
if (chunk.targets.any { dataManager.dataPaths.getKotlinCacheVersion(it).isIncompatible() }) {
|
||||
LOG.info("Clearing caches for " + chunk.targets.map { it.presentableName }.join())
|
||||
LOG.info("Clearing caches for " + chunk.targets.joinToString { it.presentableName })
|
||||
chunk.targets.forEach { dataManager.getKotlinCache(it).clean() }
|
||||
return CHUNK_REBUILD_REQUIRED
|
||||
}
|
||||
@@ -278,7 +278,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
): OutputItemsCollectorImpl? {
|
||||
|
||||
if (JpsUtils.isJsKotlinModule(chunk.representativeTarget())) {
|
||||
LOG.debug("Compiling to JS ${filesToCompile.values().size()} files in " + filesToCompile.keySet().map { it.getPresentableName() }.join())
|
||||
LOG.debug("Compiling to JS ${filesToCompile.values().size()} files in ${filesToCompile.keySet().joinToString { it.presentableName }}")
|
||||
return compileToJs(chunk, commonArguments, environment, null, messageCollector, project)
|
||||
}
|
||||
|
||||
@@ -563,7 +563,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
|
||||
val moduleFile = KotlinBuilderModuleScriptGenerator.generateModuleDescription(context, chunk, filesToCompile, totalRemovedFiles != 0)
|
||||
if (moduleFile == null) {
|
||||
KotlinBuilder.LOG.debug("Not compiling, because no files affected: " + filesToCompile.keySet().map { it.getPresentableName() }.join())
|
||||
KotlinBuilder.LOG.debug("Not compiling, because no files affected: " + filesToCompile.keySet().joinToString { it.presentableName })
|
||||
// No Kotlin sources found
|
||||
return null
|
||||
}
|
||||
@@ -574,7 +574,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
||||
|
||||
KotlinBuilder.LOG.debug("Compiling to JVM ${filesToCompile.values().size()} files"
|
||||
+ (if (totalRemovedFiles == 0) "" else " ($totalRemovedFiles removed files)")
|
||||
+ " in " + filesToCompile.keySet().map { it.getPresentableName() }.join())
|
||||
+ " in " + filesToCompile.keySet().joinToString { it.presentableName })
|
||||
|
||||
KotlinCompilerRunner.runK2JvmCompiler(commonArguments, k2JvmArguments, compilerSettings, messageCollector, environment, moduleFile, outputItemCollector)
|
||||
moduleFile.delete()
|
||||
|
||||
@@ -110,7 +110,7 @@ public class IncrementalCacheImpl(
|
||||
|
||||
@TestOnly
|
||||
public fun dump(): String {
|
||||
return maps.map { it.dump() }.join("\n\n")
|
||||
return maps.joinToString("\n\n") { it.dump() }
|
||||
}
|
||||
|
||||
public fun markOutputClassesDirty(removedAndCompiledSources: List<File>) {
|
||||
@@ -769,7 +769,7 @@ private fun <K : Comparable<K>, V> Map<K, V>.dumpMap(dumpValue: (V)->String): St
|
||||
|
||||
@TestOnly
|
||||
public fun <T : Comparable<T>> Collection<T>.dumpCollection(): String =
|
||||
"[${sorted().map(Any::toString).join(", ")}]"
|
||||
"[${sorted().joinToString(", ", transform = Any::toString)}]"
|
||||
|
||||
private class PathFunctionPair(
|
||||
public val path: String,
|
||||
|
||||
@@ -88,7 +88,7 @@ abstract class AbstractLookupTrackerTest : AbstractIncrementalJpsTest(
|
||||
start = end
|
||||
}
|
||||
|
||||
lines[line - 1] = parts.join("") + lineContent.subSequence(start, lineContent.length)
|
||||
lines[line - 1] = parts.joinToString("") + lineContent.subSequence(start, lineContent.length)
|
||||
}
|
||||
|
||||
val actual = lines.joinToString("\n")
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class KotlinStringWriter : KotlinWriter {
|
||||
}
|
||||
else {
|
||||
body.writeNoIndent("=")
|
||||
body.writeNoIndent(getterBody.join("").replace("return", ""))
|
||||
body.writeNoIndent(getterBody.joinToString("").replace("return", ""))
|
||||
body.newLine()
|
||||
}
|
||||
body.decIndent()
|
||||
|
||||
Reference in New Issue
Block a user