diff --git a/libraries/stdlib/src/kotlin/dom/DomJVM.kt b/libraries/stdlib/src/kotlin/dom/DomJVM.kt index 6dc67a79f8c..06a5d2e2800 100644 --- a/libraries/stdlib/src/kotlin/dom/DomJVM.kt +++ b/libraries/stdlib/src/kotlin/dom/DomJVM.kt @@ -165,10 +165,10 @@ public val NodeList.outerHTML: String get() = toList().map { it.innerHTML }.join("") /** Returns an [Iterator] of all the next [Element] siblings */ -public fun Node.nextElements(): List = nextSiblings().filterIsInstance(javaClass()) +public fun Node.nextElements(): List = nextSiblings().filterIsInstance() /** Returns an [Iterator] of all the previous [Element] siblings */ -public fun Node.previousElements(): List = previousSiblings().filterIsInstance(javaClass()) +public fun Node.previousElements(): List = previousSiblings().filterIsInstance() public var Element.classSet: MutableSet diff --git a/libraries/stdlib/src/kotlin/io/files/Utils.kt b/libraries/stdlib/src/kotlin/io/files/Utils.kt index 4976ae14390..f94a668d917 100644 --- a/libraries/stdlib/src/kotlin/io/files/Utils.kt +++ b/libraries/stdlib/src/kotlin/io/files/Utils.kt @@ -49,7 +49,7 @@ public fun createTempFile(prefix: String = "tmp", suffix: String? = null, direct * Returns this if this file is a directory, or the parent if it is a file inside a directory. */ public val File.directory: File - get() = if (isDirectory()) this else parent!! + get() = if (isDirectory()) this else parentFile!! /** * Returns parent of this abstract path name, or `null` if it has no parent. diff --git a/libraries/stdlib/src/kotlin/text/CharCategoryJVM.kt b/libraries/stdlib/src/kotlin/text/CharCategoryJVM.kt index 1c4ba510b29..5989779e3bd 100644 --- a/libraries/stdlib/src/kotlin/text/CharCategoryJVM.kt +++ b/libraries/stdlib/src/kotlin/text/CharCategoryJVM.kt @@ -158,7 +158,7 @@ public enum class CharCategory(public val value: Int, public val code: String) { public companion object { - private val categoryMap by Delegates.lazy { CharCategory.values().toMap { it.value } } + private val categoryMap by lazy { CharCategory.values().toMap { it.value } } public fun valueOf(category: Int): CharCategory = categoryMap[category] ?: throw IllegalArgumentException("Category #$category is not defined.") } diff --git a/libraries/stdlib/src/kotlin/text/CharDirectionalityJVM.kt b/libraries/stdlib/src/kotlin/text/CharDirectionalityJVM.kt index 3dd09979e8e..98ca7f421ff 100644 --- a/libraries/stdlib/src/kotlin/text/CharDirectionalityJVM.kt +++ b/libraries/stdlib/src/kotlin/text/CharDirectionalityJVM.kt @@ -112,7 +112,7 @@ public enum class CharDirectionality(public val value: Int) { public companion object { - private val directionalityMap by Delegates.lazy { CharDirectionality.values().toMap { it.value } } + private val directionalityMap by lazy { CharDirectionality.values().toMap { it.value } } public fun valueOf(directionality: Int): CharDirectionality = directionalityMap[directionality] ?: throw IllegalArgumentException("Directionality #$directionality is not defined.") } diff --git a/libraries/stdlib/test/js/MapJsTest.kt b/libraries/stdlib/test/js/MapJsTest.kt index d16bdae0eeb..7d77653f8c0 100644 --- a/libraries/stdlib/test/js/MapJsTest.kt +++ b/libraries/stdlib/test/js/MapJsTest.kt @@ -21,7 +21,7 @@ class ComplexMapJsTest : MapJsTest() { doTest() } - override fun > Collection.toNormalizedList(): List = this.toSortedList() + override fun > Collection.toNormalizedList(): List = this.sorted() // hashMapOf returns ComlpexHashMap because it is Generic override fun emptyMutableMap(): MutableMap = genericHashMapOf() override fun emptyMutableMapWithNullableKeyValue(): MutableMap = genericHashMapOf() @@ -39,7 +39,7 @@ class PrimitiveMapJsTest : MapJsTest() { assertEquals(VALUES.toNormalizedList(), map.values().toNormalizedList()) } - override fun > Collection.toNormalizedList(): List = this.toSortedList() + override fun > Collection.toNormalizedList(): List = this.sorted() override fun emptyMutableMap(): MutableMap = HashMap() override fun emptyMutableMapWithNullableKeyValue(): MutableMap = HashMap() diff --git a/libraries/stdlib/test/text/StringJVMTest.kt b/libraries/stdlib/test/text/StringJVMTest.kt index 3f9f234dfa0..c67958c5dd4 100644 --- a/libraries/stdlib/test/text/StringJVMTest.kt +++ b/libraries/stdlib/test/text/StringJVMTest.kt @@ -103,7 +103,7 @@ class StringJVMTest { assertTrue { data.all { it.isJavaLetter() } } - assertNot { + assertFalse { data.all { it.isUpperCase() } } } @@ -113,7 +113,7 @@ class StringJVMTest { assertTrue { data.any() { it.isDigit() } } - assertNot { + assertFalse { data.any() { it.isUpperCase() } } } @@ -362,7 +362,7 @@ class StringJVMTest { @test fun orderIgnoringCase() { val list = listOf("Beast", "Ast", "asterisk") - assertEquals(listOf("Ast", "Beast", "asterisk"), list.sort()) - assertEquals(listOf("Ast", "asterisk", "Beast"), list.sortBy(String.CASE_INSENSITIVE_ORDER)) + assertEquals(listOf("Ast", "Beast", "asterisk"), list.sorted()) + assertEquals(listOf("Ast", "asterisk", "Beast"), list.sortedWith(String.CASE_INSENSITIVE_ORDER)) } } diff --git a/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt b/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt index 23585bea9ff..d1e25afc77f 100644 --- a/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt +++ b/libraries/tools/kotlin-annotation-processing/src/test/kotlin/org/jetbrains/kotlin/annotation/AnnotationListParseTest.kt @@ -74,8 +74,8 @@ public class AnnotationListParseTest { } } - val actualAnnotationsSorted = actualAnnotations.toString().lines().filter { it.isNotEmpty() }.sort() - val classDeclarationsSorted = annotationProvider.kotlinClasses.sort() + val actualAnnotationsSorted = actualAnnotations.toString().lines().filter { it.isNotEmpty() }.sorted() + val classDeclarationsSorted = annotationProvider.kotlinClasses.sorted() val fileContents = (actualAnnotationsSorted + classDeclarationsSorted).joinToString("\n") assertEqualsToFile(expectedFile, fileContents)