diff --git a/libraries/stdlib/jre7/src/kotlin/Standard.kt b/libraries/stdlib/jre7/src/kotlin/Standard.kt index 68ff07c1c11..7a31dd0a5d7 100644 --- a/libraries/stdlib/jre7/src/kotlin/Standard.kt +++ b/libraries/stdlib/jre7/src/kotlin/Standard.kt @@ -11,6 +11,7 @@ package kotlin * @param block a function to process this [AutoCloseable] resource. * @return the result of [block] function invoked on this resource. */ +@SinceKotlin("1.1") @Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @kotlin.internal.InlineOnly public inline fun T.use(block: (T) -> R): R { @@ -33,6 +34,7 @@ public inline fun T.use(block: (T) -> R): R { * Closes this [AutoCloseable] suppressing possible exception or error thrown by [AutoCloseable.close] function. * The suppressed exception is added to the list of suppressed exceptions of [cause] exception. */ +@SinceKotlin("1.1") @Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @kotlin.internal.InlineExposed internal fun AutoCloseable.closeSuppressed(cause: Throwable) { diff --git a/libraries/stdlib/jre8/src/kotlin/collections/Collections.kt b/libraries/stdlib/jre8/src/kotlin/collections/Collections.kt index 86e61a26ed1..f42d7b414a6 100644 --- a/libraries/stdlib/jre8/src/kotlin/collections/Collections.kt +++ b/libraries/stdlib/jre8/src/kotlin/collections/Collections.kt @@ -6,6 +6,7 @@ package kotlin.collections * Returns the value to which the specified key is mapped, or * [defaultValue] if this map contains no mapping for the key. */ +@SinceKotlin("1.1") @Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @kotlin.internal.InlineOnly public inline fun <@kotlin.internal.OnlyInputTypes K, V> Map.getOrDefault(key: K, defaultValue: V): V @@ -16,6 +17,7 @@ public inline fun <@kotlin.internal.OnlyInputTypes K, V> Map.getOrDefa * Removes the entry for the specified key only if it is currently * mapped to the specified value. */ +@SinceKotlin("1.1") @Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @kotlin.internal.InlineOnly public inline fun <@kotlin.internal.OnlyInputTypes K, @kotlin.internal.OnlyInputTypes V> MutableMap.remove(key: K, value: V): Boolean diff --git a/libraries/stdlib/jre8/src/kotlin/streams/Streams.kt b/libraries/stdlib/jre8/src/kotlin/streams/Streams.kt index 5ef785733a0..88cc62e424f 100644 --- a/libraries/stdlib/jre8/src/kotlin/streams/Streams.kt +++ b/libraries/stdlib/jre8/src/kotlin/streams/Streams.kt @@ -7,31 +7,37 @@ import java.util.stream.* /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ +@SinceKotlin("1.1") public fun Stream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ +@SinceKotlin("1.1") public fun IntStream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ +@SinceKotlin("1.1") public fun LongStream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a [Sequence] instance that wraps the original stream iterating through its elements. */ +@SinceKotlin("1.1") public fun DoubleStream.asSequence(): Sequence = Sequence { iterator() } /** * Creates a sequential [Stream] instance that produces elements from the original sequence. */ +@SinceKotlin("1.1") public fun Sequence.asStream(): Stream = StreamSupport.stream({ Spliterators.spliteratorUnknownSize(iterator(), Spliterator.ORDERED) }, Spliterator.ORDERED, false) /** * Returns a [List] containing all elements produced by this stream. */ +@SinceKotlin("1.1") public fun Stream.toList(): List = collect(Collectors.toList()) /** @@ -42,10 +48,12 @@ public fun IntStream.toList(): List = toArray().asList() /** * Returns a [List] containing all elements produced by this stream. */ +@SinceKotlin("1.1") public fun LongStream.toList(): List = toArray().asList() /** * Returns a [List] containing all elements produced by this stream. */ +@SinceKotlin("1.1") public fun DoubleStream.toList(): List = toArray().asList() diff --git a/libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt b/libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt index 78c8367050d..3b6547f4c9c 100644 --- a/libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt +++ b/libraries/stdlib/jre8/src/kotlin/text/RegexExtensions.kt @@ -23,6 +23,7 @@ package kotlin.text * @return An instance of [MatchGroup] if the group with the specified [name] was matched or `null` otherwise. * @throws [UnsupportedOperationException] if getting named groups isn't supported on the current platform. */ +@SinceKotlin("1.1") public operator fun MatchGroupCollection.get(name: String): MatchGroup? { val namedGroups = this as? MatchNamedGroupCollection ?: throw UnsupportedOperationException("Retrieving groups by name is not supported on this platform.")