diff --git a/libraries/stdlib/common/src/generated/_Arrays.kt b/libraries/stdlib/common/src/generated/_Arrays.kt index 8ec3f08db9a..31cba44a11c 100644 --- a/libraries/stdlib/common/src/generated/_Arrays.kt +++ b/libraries/stdlib/common/src/generated/_Arrays.kt @@ -8237,63 +8237,63 @@ public fun > CharArray.toCollection(destination: } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun Array.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun ByteArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun ShortArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun IntArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun LongArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun FloatArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun DoubleArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun BooleanArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun CharArray.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(size))) @@ -8399,14 +8399,14 @@ public fun CharArray.toList(): List { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun Array.toMutableList(): MutableList { return ArrayList(this.asCollection()) } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun ByteArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8415,7 +8415,7 @@ public fun ByteArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun ShortArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8424,7 +8424,7 @@ public fun ShortArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun IntArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8433,7 +8433,7 @@ public fun IntArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun LongArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8442,7 +8442,7 @@ public fun LongArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun FloatArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8451,7 +8451,7 @@ public fun FloatArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun DoubleArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8460,7 +8460,7 @@ public fun DoubleArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun BooleanArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -8469,7 +8469,7 @@ public fun BooleanArray.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this array. + * Returns a new [MutableList] filled with all elements of this array. */ public fun CharArray.toMutableList(): MutableList { val list = ArrayList(size) @@ -10314,7 +10314,7 @@ public infix fun CharArray.subtract(other: Iterable): Set { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10325,7 +10325,7 @@ public fun Array.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10336,7 +10336,7 @@ public fun ByteArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10347,7 +10347,7 @@ public fun ShortArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10358,7 +10358,7 @@ public fun IntArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10369,7 +10369,7 @@ public fun LongArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10380,7 +10380,7 @@ public fun FloatArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10391,7 +10391,7 @@ public fun DoubleArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ @@ -10402,7 +10402,7 @@ public fun BooleanArray.toMutableSet(): MutableSet { } /** - * Returns a mutable set containing all distinct elements from the given array. + * Returns a new [MutableSet] containing all distinct elements from the given array. * * The returned set preserves the element iteration order of the original array. */ diff --git a/libraries/stdlib/common/src/generated/_Collections.kt b/libraries/stdlib/common/src/generated/_Collections.kt index c693683264e..ae440ab9251 100644 --- a/libraries/stdlib/common/src/generated/_Collections.kt +++ b/libraries/stdlib/common/src/generated/_Collections.kt @@ -1204,7 +1204,7 @@ public fun > Iterable.toCollection(destination } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. */ public fun Iterable.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12)))) @@ -1225,7 +1225,7 @@ public fun Iterable.toList(): List { } /** - * Returns a [MutableList] filled with all elements of this collection. + * Returns a new [MutableList] filled with all elements of this collection. */ public fun Iterable.toMutableList(): MutableList { if (this is Collection) @@ -1234,7 +1234,7 @@ public fun Iterable.toMutableList(): MutableList { } /** - * Returns a [MutableList] filled with all elements of this collection. + * Returns a new [MutableList] filled with all elements of this collection. */ public fun Collection.toMutableList(): MutableList { return ArrayList(this) @@ -1496,7 +1496,7 @@ public infix fun Iterable.subtract(other: Iterable): Set { } /** - * Returns a mutable set containing all distinct elements from the given collection. + * Returns a new [MutableSet] containing all distinct elements from the given collection. * * The returned set preserves the element iteration order of the original collection. */ diff --git a/libraries/stdlib/common/src/generated/_Sequences.kt b/libraries/stdlib/common/src/generated/_Sequences.kt index 1d4c1c8ff0b..7fdab30e3ec 100644 --- a/libraries/stdlib/common/src/generated/_Sequences.kt +++ b/libraries/stdlib/common/src/generated/_Sequences.kt @@ -720,7 +720,7 @@ public fun > Sequence.toCollection(destination } /** - * Returns a [HashSet] of all elements. + * Returns a new [HashSet] of all elements. * * The operation is _terminal_. */ @@ -738,7 +738,7 @@ public fun Sequence.toList(): List { } /** - * Returns a [MutableList] filled with all elements of this sequence. + * Returns a new [MutableList] filled with all elements of this sequence. * * The operation is _terminal_. */ @@ -1002,7 +1002,7 @@ public fun Sequence.distinctBy(selector: (T) -> K): Sequence { } /** - * Returns a mutable set containing all distinct elements from the given sequence. + * Returns a new [MutableSet] containing all distinct elements from the given sequence. * * The returned set preserves the element iteration order of the original sequence. * diff --git a/libraries/stdlib/common/src/generated/_Strings.kt b/libraries/stdlib/common/src/generated/_Strings.kt index 8bba76383bf..cb98b6cfaca 100644 --- a/libraries/stdlib/common/src/generated/_Strings.kt +++ b/libraries/stdlib/common/src/generated/_Strings.kt @@ -731,7 +731,7 @@ public fun > CharSequence.toCollection(destinatio } /** - * Returns a [HashSet] of all characters. + * Returns a new [HashSet] of all characters. */ public fun CharSequence.toHashSet(): HashSet { return toCollection(HashSet(mapCapacity(length))) @@ -749,7 +749,7 @@ public fun CharSequence.toList(): List { } /** - * Returns a [MutableList] filled with all characters of this char sequence. + * Returns a new [MutableList] filled with all characters of this char sequence. */ public fun CharSequence.toMutableList(): MutableList { return toCollection(ArrayList(length)) diff --git a/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt b/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt index 6ace54f04d3..fb15638ca7f 100644 --- a/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt @@ -2057,70 +2057,70 @@ public actual fun CharArray.toTypedArray(): Array { } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun > Array.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun ByteArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun ShortArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun IntArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun LongArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun FloatArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun DoubleArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun BooleanArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun CharArray.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. * * Elements in the set returned are sorted according to the given [comparator]. */ diff --git a/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt b/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt index 8277c990086..2822c9924f2 100644 --- a/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt @@ -40,14 +40,14 @@ public actual fun MutableList.reverse(): Unit { } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. */ public fun > Iterable.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. * * Elements in the set returned are sorted according to the given [comparator]. */ diff --git a/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt b/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt index 33d2ebde31f..5847a739370 100644 --- a/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt @@ -36,7 +36,7 @@ public fun , R> Sequence<*>.filterIsInstanceTo(desti } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. * * The operation is _terminal_. */ @@ -45,7 +45,7 @@ public fun > Sequence.toSortedSet(): java.util.SortedSet } /** - * Returns a [SortedSet][java.util.SortedSet] of all elements. + * Returns a new [SortedSet][java.util.SortedSet] of all elements. * * Elements in the set returned are sorted according to the given [comparator]. * diff --git a/libraries/stdlib/jvm/src/generated/_StringsJvm.kt b/libraries/stdlib/jvm/src/generated/_StringsJvm.kt index 448a484f7ce..c000bb544ed 100644 --- a/libraries/stdlib/jvm/src/generated/_StringsJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_StringsJvm.kt @@ -25,7 +25,7 @@ public actual inline fun CharSequence.elementAt(index: Int): Char { } /** - * Returns a [SortedSet][java.util.SortedSet] of all characters. + * Returns a new [SortedSet][java.util.SortedSet] of all characters. */ public fun CharSequence.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt index 2071cb55f15..9c95ac83b68 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Sets.kt @@ -19,7 +19,7 @@ object SetOps : TemplateGroupBase() { } builder { doc { """ - Returns a mutable set containing all distinct ${f.element.pluralize()} from the given ${f.collection}. + Returns a new [MutableSet] containing all distinct ${f.element.pluralize()} from the given ${f.collection}. The returned set preserves the element iteration order of the original ${f.collection}. """ diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt index 03582e9f46d..a37c0ea9776 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Snapshots.kt @@ -75,7 +75,7 @@ object Snapshots : TemplateGroupBase() { includeDefault() include(CharSequences) } builder { - doc { "Returns a [HashSet] of all ${f.element.pluralize()}." } + doc { "Returns a new [HashSet] of all ${f.element.pluralize()}." } returns("HashSet") body { "return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12))))" } body(Sequences) { "return toCollection(HashSet())" } @@ -89,7 +89,7 @@ object Snapshots : TemplateGroupBase() { platforms(Platform.JVM) } builder { typeParam("T : Comparable") - doc { "Returns a [SortedSet][java.util.SortedSet] of all ${f.element.pluralize()}." } + doc { "Returns a new [SortedSet][java.util.SortedSet] of all ${f.element.pluralize()}." } returns("java.util.SortedSet") body { "return toCollection(java.util.TreeSet())" } } @@ -100,7 +100,7 @@ object Snapshots : TemplateGroupBase() { } builder { doc { """ - Returns a [SortedSet][java.util.SortedSet] of all ${f.element.pluralize()}. + Returns a new [SortedSet][java.util.SortedSet] of all ${f.element.pluralize()}. Elements in the set returned are sorted according to the given [comparator]. """ @@ -113,7 +113,7 @@ object Snapshots : TemplateGroupBase() { includeDefault() include(Collections, CharSequences) } builder { - doc { "Returns a [MutableList] filled with all ${f.element.pluralize()} of this ${f.collection}." } + doc { "Returns a new [MutableList] filled with all ${f.element.pluralize()} of this ${f.collection}." } returns("MutableList") body { "return toCollection(ArrayList())" } body(Iterables) {