Move internal declarations in kotlin-stdlib-jdk7/8 to other packages

- in kotlin-stdlib-jdk7, package kotlin.internal -> kotlin.internal.jdk7
- in kotlin-stdlib-jdk8, package kotlin.internal -> kotlin.internal.jdk8
This commit is contained in:
Alexander Udalov
2017-09-07 18:23:16 +03:00
committed by Ilya Gorbunov
parent 537a0ce315
commit 2a8be2cdb4
3 changed files with 28 additions and 13 deletions
@@ -19,15 +19,27 @@ internal open class PlatformImplementations {
@JvmField
internal val IMPLEMENTATIONS: PlatformImplementations = run {
val version = getJavaVersion()
try {
if (version >= 0x10008)
if (version >= 0x10008) {
try {
return@run Class.forName("kotlin.internal.jdk8.JDK8PlatformImplementations").newInstance() as PlatformImplementations
}
catch (e: ClassNotFoundException) { }
try {
return@run Class.forName("kotlin.internal.JRE8PlatformImplementations").newInstance() as PlatformImplementations
} catch (e: ClassNotFoundException) {}
}
catch (e: ClassNotFoundException) { }
}
try {
if (version >= 0x10007)
if (version >= 0x10007) {
try {
return@run Class.forName("kotlin.internal.jdk7.JDK7PlatformImplementations").newInstance() as PlatformImplementations
}
catch (e: ClassNotFoundException) { }
try {
return@run Class.forName("kotlin.internal.JRE7PlatformImplementations").newInstance() as PlatformImplementations
} catch (e: ClassNotFoundException) {}
}
catch (e: ClassNotFoundException) { }
}
PlatformImplementations()
}
@@ -50,4 +62,3 @@ private fun getJavaVersion(): Int {
default
}
}