Use explicit public visibility in kotlin-runtime.

This commit is contained in:
Ilya Gorbunov
2016-09-20 17:38:51 +03:00
parent 2fc8f5d5e2
commit 71af020beb
12 changed files with 59 additions and 59 deletions

View File

@@ -19,17 +19,17 @@ package kotlin.coroutines
/**
* Interface representing a continuation after a suspension point that returns value of type `P`
*/
interface Continuation<in P> {
public interface Continuation<in P> {
/**
* Resumes the execution of the corresponding coroutine passing `data` as the return value of the last suspension point
*/
fun resume(data: P)
public fun resume(data: P)
/**
* Resumes the execution of the corresponding coroutine so that the `exception` is re-thrown right after the
* last suspension point
*/
fun resumeWithException(exception: Throwable)
public fun resumeWithException(exception: Throwable)
}
@@ -38,4 +38,4 @@ interface Continuation<in P> {
*/
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
annotation class AllowSuspendExtensions
public annotation class AllowSuspendExtensions

View File

@@ -16,7 +16,7 @@
package kotlin
class UninitializedPropertyAccessException : RuntimeException {
public class UninitializedPropertyAccessException : RuntimeException {
constructor()
constructor(message: String) : super(message)

View File

@@ -33,14 +33,14 @@ import java.lang.Short as JavaLangShort
/**
* Returns a Java [Class] instance corresponding to the given [KClass] instance.
*/
val <T : Any> KClass<T>.java: Class<T>
public val <T : Any> KClass<T>.java: Class<T>
@JvmName("getJavaClass")
get() = (this as ClassBasedDeclarationContainer).jClass as Class<T>
/**
* Returns a Java [Class] instance representing the primitive type corresponding to the given [KClass] if it exists.
*/
val <T : Any> KClass<T>.javaPrimitiveType: Class<T>?
public val <T : Any> KClass<T>.javaPrimitiveType: Class<T>?
get() {
val thisJClass = (this as ClassBasedDeclarationContainer).jClass
if (thisJClass.isPrimitive) return thisJClass as Class<T>
@@ -62,7 +62,7 @@ val <T : Any> KClass<T>.javaPrimitiveType: Class<T>?
* Returns a Java [Class] instance corresponding to the given [KClass] instance.
* In case of primitive types it returns corresponding wrapper classes.
*/
val <T : Any> KClass<T>.javaObjectType: Class<T>
public val <T : Any> KClass<T>.javaObjectType: Class<T>
get() {
val thisJClass = (this as ClassBasedDeclarationContainer).jClass
if (!thisJClass.isPrimitive) return thisJClass as Class<T>
@@ -83,7 +83,7 @@ val <T : Any> KClass<T>.javaObjectType: Class<T>
/**
* Returns a [KClass] instance corresponding to the given Java [Class] instance.
*/
val <T : Any> Class<T>.kotlin: KClass<T>
public val <T : Any> Class<T>.kotlin: KClass<T>
@JvmName("getKotlinClass")
get() = Reflection.createKotlinClass(this) as KClass<T>
@@ -91,12 +91,12 @@ val <T : Any> Class<T>.kotlin: KClass<T>
/**
* Returns the runtime Java class of this object.
*/
val <T: Any> T.javaClass : Class<T>
public val <T: Any> T.javaClass : Class<T>
@Suppress("UsePropertyAccessSyntax")
get() = (this as java.lang.Object).getClass() as Class<T>
@Deprecated("Use 'java' property to get Java class corresponding to this Kotlin class or cast this instance to Any if you really want to get the runtime Java class of this implementation of KClass.", ReplaceWith("(this as Any).javaClass"), level = DeprecationLevel.ERROR)
val <T: Any> KClass<T>.javaClass: Class<KClass<T>>
public val <T: Any> KClass<T>.javaClass: Class<KClass<T>>
@JvmName("getRuntimeClassOfKClassInstance")
@Suppress("UsePropertyAccessSyntax")
get() = (this as java.lang.Object).getClass() as Class<KClass<T>>
@@ -105,11 +105,11 @@ val <T: Any> KClass<T>.javaClass: Class<KClass<T>>
* Checks if array can contain element of type [T].
*/
@Suppress("REIFIED_TYPE_PARAMETER_NO_INLINE")
fun <reified T : Any> Array<*>.isArrayOf(): Boolean =
public fun <reified T : Any> Array<*>.isArrayOf(): Boolean =
T::class.java.isAssignableFrom(this.javaClass.componentType)
/**
* Returns a [KClass] instance corresponding to the annotation type of this annotation.
*/
val <T : Annotation> T.annotationClass: KClass<out T>
public val <T : Annotation> T.annotationClass: KClass<out T>
get() = (this as java.lang.annotation.Annotation).annotationType().kotlin as KClass<out T>

View File

@@ -37,4 +37,4 @@ package kotlin.jvm
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
annotation class PurelyImplements(val value: String)
public annotation class PurelyImplements(val value: String)

View File

@@ -25,7 +25,7 @@ import kotlin.annotation.AnnotationTarget.*
@Target(FIELD)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class Volatile
public annotation class Volatile
/**
* Marks the JVM backing field of the annotated property as `transient`, meaning that it is not
@@ -34,7 +34,7 @@ annotation class Volatile
@Target(FIELD)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class Transient
public annotation class Transient
/**
* Marks the JVM method generated from the annotated function as `strictfp`, meaning that the precision
@@ -44,7 +44,7 @@ annotation class Transient
@Target(FUNCTION, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER, CLASS)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class Strictfp
public annotation class Strictfp
/**
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
@@ -54,4 +54,4 @@ annotation class Strictfp
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class Synchronized
public annotation class Synchronized

View File

@@ -27,7 +27,7 @@ import kotlin.reflect.KClass
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
annotation class JvmOverloads
public annotation class JvmOverloads
/**
@@ -38,7 +38,7 @@ annotation class JvmOverloads
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
annotation class JvmStatic
public annotation class JvmStatic
/**
* Specifies the name for the Java class or method which is generated from this element.
@@ -49,7 +49,7 @@ annotation class JvmStatic
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FILE)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
annotation class JvmName(val name: String)
public annotation class JvmName(val name: String)
/**
* Instructs the Kotlin compiler to generate a multifile class with top-level functions and properties declared in this file as one of its parts.
@@ -58,11 +58,11 @@ annotation class JvmName(val name: String)
@Target(AnnotationTarget.FILE)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class JvmMultifileClass
public annotation class JvmMultifileClass
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.FIELD)
@Retention(AnnotationRetention.SOURCE)
annotation class JvmSynthetic
public annotation class JvmSynthetic
/**
* This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.
@@ -84,7 +84,7 @@ annotation class JvmSynthetic
*/
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.SOURCE)
annotation class Throws(vararg val exceptionClasses: KClass<out Throwable>)
public annotation class Throws(vararg val exceptionClasses: KClass<out Throwable>)
/**
@@ -93,7 +93,7 @@ annotation class Throws(vararg val exceptionClasses: KClass<out Throwable>)
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
annotation class JvmField
public annotation class JvmField
/**
* Instructs compiler to generate or omit wildcards for type arguments corresponding to parameters with
@@ -107,7 +107,7 @@ annotation class JvmField
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPE)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
annotation class JvmSuppressWildcards(val suppress: Boolean = true)
public annotation class JvmSuppressWildcards(val suppress: Boolean = true)
/**
* Instructs compiler to generate wildcard for annotated type arguments corresponding to parameters with declaration-site variance.
@@ -117,4 +117,4 @@ annotation class JvmSuppressWildcards(val suppress: Boolean = true)
@Target(AnnotationTarget.TYPE)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
annotation class JvmWildcard
public annotation class JvmWildcard

View File

@@ -22,4 +22,4 @@ private class ArrayIterator<T>(val array: Array<T>) : Iterator<T> {
override fun next() = array[index++]
}
fun <T> iterator(array: Array<T>): Iterator<T> = ArrayIterator(array)
public fun <T> iterator(array: Array<T>): Iterator<T> = ArrayIterator(array)

View File

@@ -18,6 +18,6 @@ package kotlin.jvm.internal
import kotlin.reflect.KDeclarationContainer
interface ClassBasedDeclarationContainer : KDeclarationContainer {
val jClass: Class<*>
public interface ClassBasedDeclarationContainer : KDeclarationContainer {
public val jClass: Class<*>
}

View File

@@ -18,7 +18,7 @@ package kotlin.jvm.internal
import kotlin.reflect.*
class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassBasedDeclarationContainer {
public class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassBasedDeclarationContainer {
override val simpleName: String?
get() = error()

View File

@@ -16,7 +16,7 @@
package kotlin.jvm.internal
abstract class Lambda(private val arity: Int) : FunctionImpl {
public abstract class Lambda(private val arity: Int) : FunctionImpl {
override fun getArity() = arity
override fun toString() = Reflection.renderLambdaToString(this)

View File

@@ -16,7 +16,7 @@
package kotlin.jvm.internal
abstract class PrimitiveSpreadBuilder<T : Any>(private val size: Int) {
public abstract class PrimitiveSpreadBuilder<T : Any>(private val size: Int) {
abstract protected fun T.getSize(): Int
protected var position: Int = 0
@@ -24,7 +24,7 @@ abstract class PrimitiveSpreadBuilder<T : Any>(private val size: Int) {
@Suppress("UNCHECKED_CAST")
private val spreads: Array<T?> = arrayOfNulls<Any>(size) as Array<T?>
fun addSpread(spreadArgument: T) {
public fun addSpread(spreadArgument: T) {
spreads[position++] = spreadArgument
}
@@ -60,90 +60,90 @@ abstract class PrimitiveSpreadBuilder<T : Any>(private val size: Int) {
}
}
class ByteSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<ByteArray>(size) {
public class ByteSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<ByteArray>(size) {
private val values: ByteArray = ByteArray(size)
override fun ByteArray.getSize(): Int = this.size
fun add(value: Byte) {
public fun add(value: Byte) {
values[position++] = value
}
fun toArray(): ByteArray = toArray(values, ByteArray(size()))
public fun toArray(): ByteArray = toArray(values, ByteArray(size()))
}
class CharSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<CharArray>(size) {
public class CharSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<CharArray>(size) {
private val values: CharArray = CharArray(size)
override fun CharArray.getSize(): Int = this.size
fun add(value: Char) {
public fun add(value: Char) {
values[position++] = value
}
fun toArray(): CharArray = toArray(values, CharArray(size()))
public fun toArray(): CharArray = toArray(values, CharArray(size()))
}
class DoubleSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<DoubleArray>(size) {
public class DoubleSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<DoubleArray>(size) {
private val values: DoubleArray = DoubleArray(size)
override fun DoubleArray.getSize(): Int = this.size
fun add(value: Double) {
public fun add(value: Double) {
values[position++] = value
}
fun toArray(): DoubleArray = toArray(values, DoubleArray(size()))
public fun toArray(): DoubleArray = toArray(values, DoubleArray(size()))
}
class FloatSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<FloatArray>(size) {
public class FloatSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<FloatArray>(size) {
private val values: FloatArray = FloatArray(size)
override fun FloatArray.getSize(): Int = this.size
fun add(value: Float) {
public fun add(value: Float) {
values[position++] = value
}
fun toArray(): FloatArray = toArray(values, FloatArray(size()))
public fun toArray(): FloatArray = toArray(values, FloatArray(size()))
}
class IntSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<IntArray>(size) {
public class IntSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<IntArray>(size) {
private val values: IntArray = IntArray(size)
override fun IntArray.getSize(): Int = this.size
fun add(value: Int) {
public fun add(value: Int) {
values[position++] = value
}
fun toArray(): IntArray = toArray(values, IntArray(size()))
public fun toArray(): IntArray = toArray(values, IntArray(size()))
}
class LongSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<LongArray>(size) {
public class LongSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<LongArray>(size) {
private val values: LongArray = LongArray(size)
override fun LongArray.getSize(): Int = this.size
fun add(value: Long) {
public fun add(value: Long) {
values[position++] = value
}
fun toArray(): LongArray = toArray(values, LongArray(size()))
public fun toArray(): LongArray = toArray(values, LongArray(size()))
}
class ShortSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<ShortArray>(size) {
public class ShortSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<ShortArray>(size) {
private val values: ShortArray = ShortArray(size)
override fun ShortArray.getSize(): Int = this.size
fun add(value: Short) {
public fun add(value: Short) {
values[position++] = value
}
fun toArray(): ShortArray = toArray(values, ShortArray(size()))
public fun toArray(): ShortArray = toArray(values, ShortArray(size()))
}
class BooleanSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<BooleanArray>(size) {
public class BooleanSpreadBuilder(size: Int) : PrimitiveSpreadBuilder<BooleanArray>(size) {
private val values: BooleanArray = BooleanArray(size)
override fun BooleanArray.getSize(): Int = this.size
fun add(value: Boolean) {
public fun add(value: Boolean) {
values[position++] = value
}
fun toArray(): BooleanArray = toArray(values, BooleanArray(size()))
public fun toArray(): BooleanArray = toArray(values, BooleanArray(size()))
}

View File

@@ -19,4 +19,4 @@ package kotlin.script
/**
* Default script definition template
*/
abstract class StandardScriptTemplate(val args: Array<String>)
public abstract class StandardScriptTemplate(val args: Array<String>)