diff --git a/libraries/stdlib/src/generated/_SpecialJVM.kt b/libraries/stdlib/src/generated/_SpecialJVM.kt index 6e204b2a29f..e32a470a444 100644 --- a/libraries/stdlib/src/generated/_SpecialJVM.kt +++ b/libraries/stdlib/src/generated/_SpecialJVM.kt @@ -140,7 +140,7 @@ public fun ShortArray.asList(): List { /** * Searches array or range of array for provided element index using binary search algorithm. Array is expected to be sorted according to the specified [comparator]. */ -public fun Array.binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size()): Int { +public fun Array.binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size()): Int { return Arrays.binarySearch(this, fromIndex, toIndex, element, comparator) } diff --git a/libraries/stdlib/src/kotlin/collections/JUtil.kt b/libraries/stdlib/src/kotlin/collections/JUtil.kt index 65eeb126379..44889141cf7 100644 --- a/libraries/stdlib/src/kotlin/collections/JUtil.kt +++ b/libraries/stdlib/src/kotlin/collections/JUtil.kt @@ -190,7 +190,7 @@ public fun > List.binarySearch(element: T?, fromIndex: Int * * If the list contains multiple elements equal to the specified object, there is no guarantee which one will be found. */ -public fun List.binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size()): Int { +public fun List.binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size()): Int { rangeCheck(size(), fromIndex, toIndex) var low = fromIndex diff --git a/libraries/stdlib/src/kotlin/collections/JUtilJVM.kt b/libraries/stdlib/src/kotlin/collections/JUtilJVM.kt index 845edc73e91..3a98e756d19 100644 --- a/libraries/stdlib/src/kotlin/collections/JUtilJVM.kt +++ b/libraries/stdlib/src/kotlin/collections/JUtilJVM.kt @@ -29,7 +29,7 @@ public fun sortedSetOf(vararg values: T): TreeSet = values.toCollection(Tr /** * Returns a new [SortedSet] with the given [comparator] and elements. */ -public fun sortedSetOf(comparator: Comparator, vararg values: T): TreeSet = values.toCollection(TreeSet(comparator)) +public fun sortedSetOf(comparator: Comparator, vararg values: T): TreeSet = values.toCollection(TreeSet(comparator)) /** * Returns a list containing the elements returned by this enumeration diff --git a/libraries/stdlib/src/kotlin/collections/MapsJVM.kt b/libraries/stdlib/src/kotlin/collections/MapsJVM.kt index 19ea6317aa4..fca47c8e757 100644 --- a/libraries/stdlib/src/kotlin/collections/MapsJVM.kt +++ b/libraries/stdlib/src/kotlin/collections/MapsJVM.kt @@ -50,7 +50,7 @@ public fun , V> Map.toSortedMap(): SortedMap = Tre * * @sample test.collections.MapJVMTest.toSortedMapWithComparator */ -public fun Map.toSortedMap(comparator: Comparator): SortedMap { +public fun Map.toSortedMap(comparator: Comparator): SortedMap { val result = TreeMap(comparator) result.putAll(this) return result diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt index bc4240273e1..47292031bc5 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/SpecialJVM.kt @@ -108,7 +108,7 @@ fun specialJVM(): List { } } - templates add f("binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size())") { + templates add f("binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size())") { only(ArraysOfObjects) doc { "Searches array or range of array for provided element index using binary search algorithm. Array is expected to be sorted according to the specified [comparator]." } returns("Int")