From fa29297fb179143c08256334148d13f45c227688 Mon Sep 17 00:00:00 2001 From: "victor.petukhov" Date: Mon, 19 Aug 2019 11:56:24 +0300 Subject: [PATCH] Introduce workaround for back-end exception in the test cases parser code --- .../jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt index 19d73cc07af..8f24b78c1b8 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt @@ -54,9 +54,9 @@ fun parseTestCases(testFiles: TestFiles): SpecTestCasesSet { val matcher = testCaseInfoPattern.matcher(fileContent) var startFind = 0 - if (!testCasesSet.byFiles.contains(filename)) { - testCasesSet.byFiles[filename] = mutableMapOf() - testCasesSet.byRanges[filename] = TreeMap() + testCasesSet.byFiles.computeIfAbsent(filename) { + testCasesSet.byRanges.putIfAbsent(filename, TreeMap()) + mutableMapOf() } val testCasesOfFile = testCasesSet.byFiles[filename]!!