Rename Random companion object to Default

#KT-27508
This commit is contained in:
Ilya Gorbunov
2018-10-09 05:12:41 +03:00
parent 81b4031a35
commit 27dc160aef
2 changed files with 16 additions and 1 deletions
+10 -1
View File
@@ -237,7 +237,7 @@ public abstract class Random {
*
* @sample samples.random.Randoms.defaultRandom
*/
companion object : Random() {
companion object Default : Random() {
private val defaultRandom: Random = defaultPlatformRandom()
@@ -262,6 +262,15 @@ public abstract class Random {
override fun nextBytes(size: Int): ByteArray = defaultRandom.nextBytes(size)
override fun nextBytes(array: ByteArray, fromIndex: Int, toIndex: Int): ByteArray = defaultRandom.nextBytes(array, fromIndex, toIndex)
@Deprecated("Use Default companion object instead", level = DeprecationLevel.HIDDEN)
@Suppress("DEPRECATION_ERROR")
@kotlin.jvm.JvmField
public val Companion: Random.Companion = Random.Companion
}
@Deprecated("Use Default companion object instead", level = DeprecationLevel.HIDDEN)
public object Companion : Random() {
override fun nextBits(bitCount: Int): Int = Default.nextBits(bitCount)
}
}
@@ -3695,6 +3695,7 @@ public final class kotlin/random/PlatformRandomKt {
public abstract class kotlin/random/Random {
public static final field Companion Lkotlin/random/Random$Companion;
public static final field Default Lkotlin/random/Random$Default;
public fun <init> ()V
public abstract fun nextBits (I)I
public fun nextBoolean ()Z
@@ -3715,6 +3716,11 @@ public abstract class kotlin/random/Random {
}
public final class kotlin/random/Random$Companion : kotlin/random/Random {
public static final field INSTANCE Lkotlin/random/Random$Companion;
public fun nextBits (I)I
}
public final class kotlin/random/Random$Default : kotlin/random/Random {
public fun nextBits (I)I
public fun nextBoolean ()Z
public fun nextBytes (I)[B