Annotate with SinceKotlin all in stdlib-jre7 and jre8

This commit is contained in:
Ilya Gorbunov
2016-10-12 04:07:13 +03:00
parent 70c3a0a244
commit a8f381cabc
4 changed files with 13 additions and 0 deletions
@@ -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 : AutoCloseable?, R> T.use(block: (T) -> R): R {
@@ -33,6 +34,7 @@ public inline fun <T : AutoCloseable?, R> 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) {
@@ -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<out K, V>.getOrDefault(key: K, defaultValue: V): V
@@ -16,6 +17,7 @@ public inline fun <@kotlin.internal.OnlyInputTypes K, V> Map<out K, V>.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<out K, out V>.remove(key: K, value: V): Boolean
@@ -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 <T> Stream<T>.asSequence(): Sequence<T> = Sequence { iterator() }
/**
* Creates a [Sequence] instance that wraps the original stream iterating through its elements.
*/
@SinceKotlin("1.1")
public fun IntStream.asSequence(): Sequence<Int> = Sequence { iterator() }
/**
* Creates a [Sequence] instance that wraps the original stream iterating through its elements.
*/
@SinceKotlin("1.1")
public fun LongStream.asSequence(): Sequence<Long> = Sequence { iterator() }
/**
* Creates a [Sequence] instance that wraps the original stream iterating through its elements.
*/
@SinceKotlin("1.1")
public fun DoubleStream.asSequence(): Sequence<Double> = Sequence { iterator() }
/**
* Creates a sequential [Stream] instance that produces elements from the original sequence.
*/
@SinceKotlin("1.1")
public fun <T> Sequence<T>.asStream(): Stream<T> = 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 <T> Stream<T>.toList(): List<T> = collect(Collectors.toList<T>())
/**
@@ -42,10 +48,12 @@ public fun IntStream.toList(): List<Int> = toArray().asList()
/**
* Returns a [List] containing all elements produced by this stream.
*/
@SinceKotlin("1.1")
public fun LongStream.toList(): List<Long> = toArray().asList()
/**
* Returns a [List] containing all elements produced by this stream.
*/
@SinceKotlin("1.1")
public fun DoubleStream.toList(): List<Double> = toArray().asList()
@@ -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.")