Reformat stdlib: jvm part

#KT-5558
This commit is contained in:
Ilya Gorbunov
2018-04-20 23:33:11 +03:00
parent c53a2d57c3
commit e3883d8d6d
36 changed files with 337 additions and 271 deletions
+49 -49
View File
@@ -12,53 +12,53 @@ package kotlin
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.CLASS)
internal annotation class Metadata(
/**
* A kind of the metadata this annotation encodes. Kotlin compiler recognizes the following kinds (see KotlinClassHeader.Kind):
*
* 1 Class
* 2 File
* 3 Synthetic class
* 4 Multi-file class facade
* 5 Multi-file class part
*
* The class file with a kind not listed here is treated as a non-Kotlin file.
*/
val k: Int = 1,
/**
* The version of the metadata provided in the arguments of this annotation.
*/
val mv: IntArray = intArrayOf(),
/**
* The version of the bytecode interface (naming conventions, signatures) of the class file annotated with this annotation.
*/
val bv: IntArray = intArrayOf(),
/**
* Metadata in a custom format. The format may be different (or even absent) for different kinds.
*/
val d1: Array<String> = arrayOf(),
/**
* An addition to [d1]: array of strings which occur in metadata, written in plain text so that strings already present
* in the constant pool are reused. These strings may be then indexed in the metadata by an integer index in this array.
*/
val d2: Array<String> = arrayOf(),
/**
* An extra string. For a multi-file part class, internal name of the facade class.
*/
val xs: String = "",
/**
* Fully qualified name of the package this class is located in, from Kotlin's point of view, or empty string if this name
* does not differ from the JVM's package FQ name. These names can be different in case the [JvmPackageName] annotation is used.
* Note that this information is also stored in the corresponding module's `.kotlin_module` file.
*/
@SinceKotlin("1.2")
val pn: String = "",
/**
* An extra int. Bits of this number represent the following flags:
*
* 0 - this is a multi-file class facade or part, compiled with `-Xmultifile-parts-inherit`.
* 1 - this class file is compiled by a pre-release version of Kotlin and is not visible to release versions.
* 2 - this class file is a compiled Kotlin script source file (.kts).
*/
@SinceKotlin("1.1")
val xi: Int = 0
/**
* A kind of the metadata this annotation encodes. Kotlin compiler recognizes the following kinds (see KotlinClassHeader.Kind):
*
* 1 Class
* 2 File
* 3 Synthetic class
* 4 Multi-file class facade
* 5 Multi-file class part
*
* The class file with a kind not listed here is treated as a non-Kotlin file.
*/
val k: Int = 1,
/**
* The version of the metadata provided in the arguments of this annotation.
*/
val mv: IntArray = intArrayOf(),
/**
* The version of the bytecode interface (naming conventions, signatures) of the class file annotated with this annotation.
*/
val bv: IntArray = intArrayOf(),
/**
* Metadata in a custom format. The format may be different (or even absent) for different kinds.
*/
val d1: Array<String> = arrayOf(),
/**
* An addition to [d1]: array of strings which occur in metadata, written in plain text so that strings already present
* in the constant pool are reused. These strings may be then indexed in the metadata by an integer index in this array.
*/
val d2: Array<String> = arrayOf(),
/**
* An extra string. For a multi-file part class, internal name of the facade class.
*/
val xs: String = "",
/**
* Fully qualified name of the package this class is located in, from Kotlin's point of view, or empty string if this name
* does not differ from the JVM's package FQ name. These names can be different in case the [JvmPackageName] annotation is used.
* Note that this information is also stored in the corresponding module's `.kotlin_module` file.
*/
@SinceKotlin("1.2")
val pn: String = "",
/**
* An extra int. Bits of this number represent the following flags:
*
* 0 - this is a multi-file class facade or part, compiled with `-Xmultifile-parts-inherit`.
* 1 - this class file is compiled by a pre-release version of Kotlin and is not visible to release versions.
* 2 - this class file is a compiled Kotlin script source file (.kts).
*/
@SinceKotlin("1.1")
val xi: Int = 0
)
@@ -83,12 +83,12 @@ public val <T : Any> Class<T>.kotlin: KClass<T>
/**
* Returns the runtime Java class of this object.
*/
public inline val <T: Any> T.javaClass : Class<T>
public inline 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)
public inline val <T: Any> KClass<T>.javaClass: Class<KClass<T>>
public inline val <T : Any> KClass<T>.javaClass: Class<KClass<T>>
@JvmName("getRuntimeClassOfKClassInstance")
@Suppress("UsePropertyAccessSyntax")
get() = (this as java.lang.Object).getClass() as Class<KClass<T>>
@@ -98,7 +98,7 @@ public inline val <T: Any> KClass<T>.javaClass: Class<KClass<T>>
*/
@Suppress("REIFIED_TYPE_PARAMETER_NO_INLINE")
public fun <reified T : Any> Array<*>.isArrayOf(): Boolean =
T::class.java.isAssignableFrom(this::class.java.componentType)
T::class.java.isAssignableFrom(this::class.java.componentType)
/**
* Returns a [KClass] instance corresponding to the annotation type of this annotation.
@@ -75,11 +75,11 @@ public class ClassReference(override val jClass: Class<*>) : KClass<Any>, ClassB
private fun error(): Nothing = throw KotlinReflectionNotSupportedError()
override fun equals(other: Any?) =
other is ClassReference && javaObjectType == other.javaObjectType
other is ClassReference && javaObjectType == other.javaObjectType
override fun hashCode() =
javaObjectType.hashCode()
javaObjectType.hashCode()
override fun toString() =
jClass.toString() + Reflection.REFLECTION_NOT_AVAILABLE
jClass.toString() + Reflection.REFLECTION_NOT_AVAILABLE
}
@@ -9,18 +9,18 @@ import kotlin.reflect.KCallable
@SinceKotlin("1.1")
public class PackageReference(
override val jClass: Class<*>,
@Suppress("unused") private val moduleName: String
override val jClass: Class<*>,
@Suppress("unused") private val moduleName: String
) : ClassBasedDeclarationContainer {
override val members: Collection<KCallable<*>>
get() = throw KotlinReflectionNotSupportedError()
override fun equals(other: Any?) =
other is PackageReference && jClass == other.jClass
other is PackageReference && jClass == other.jClass
override fun hashCode() =
jClass.hashCode()
jClass.hashCode()
override fun toString() =
jClass.toString() + Reflection.REFLECTION_NOT_AVAILABLE
jClass.toString() + Reflection.REFLECTION_NOT_AVAILABLE
}
@@ -8,17 +8,17 @@ package kotlin.jvm.internal
internal object DoubleCompanionObject {
val MIN_VALUE: Double = java.lang.Double.MIN_VALUE
val MAX_VALUE: Double = java.lang.Double.MAX_VALUE
val POSITIVE_INFINITY : Double = java.lang.Double.POSITIVE_INFINITY
val NEGATIVE_INFINITY : Double = java.lang.Double.NEGATIVE_INFINITY
val NaN : Double = java.lang.Double.NaN
val POSITIVE_INFINITY: Double = java.lang.Double.POSITIVE_INFINITY
val NEGATIVE_INFINITY: Double = java.lang.Double.NEGATIVE_INFINITY
val NaN: Double = java.lang.Double.NaN
}
internal object FloatCompanionObject {
val MIN_VALUE: Float = java.lang.Float.MIN_VALUE
val MAX_VALUE: Float = java.lang.Float.MAX_VALUE
val POSITIVE_INFINITY : Float = java.lang.Float.POSITIVE_INFINITY
val NEGATIVE_INFINITY : Float = java.lang.Float.NEGATIVE_INFINITY
val NaN : Float = java.lang.Float.NaN
val POSITIVE_INFINITY: Float = java.lang.Float.POSITIVE_INFINITY
val NEGATIVE_INFINITY: Float = java.lang.Float.NEGATIVE_INFINITY
val NaN: Float = java.lang.Float.NaN
}
internal object IntCompanionObject {