Replace deprecated join with joinToString
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user