Support inner classes in -Xjdk-release
#KT-52823 Fixed
This commit is contained in:
@@ -129,10 +129,7 @@ class ClasspathRootsResolver(
|
||||
addModularRoots(modules, result)
|
||||
} else {
|
||||
//TODO: see also `addJvmSdkRoots` usages, some refactoring is required with moving such logic into one place
|
||||
val listFoldersForRelease = javaModuleFinder.listFoldersForRelease
|
||||
listFoldersForRelease.forEach {
|
||||
result += JavaRoot(it, JavaRoot.RootType.BINARY_SIG)
|
||||
}
|
||||
result += JavaRoot(javaModuleFinder.nonModuleRoot.file, JavaRoot.RootType.BINARY_SIG)
|
||||
}
|
||||
|
||||
return RootsAndModules(result, modules)
|
||||
|
||||
@@ -134,8 +134,16 @@ class CliJavaModuleFinder(
|
||||
}
|
||||
|
||||
private fun createModuleFromSignature(moduleInfo: JavaModuleInfo): List<JavaModule.Root> {
|
||||
return listOf(createModuleFromSignature(!isCompilationJDK12OrLater, isCompilationJDK12OrLater, moduleInfo))
|
||||
}
|
||||
|
||||
private fun createModuleFromSignature(
|
||||
filterPackages: Boolean,
|
||||
filterModules: Boolean,
|
||||
moduleInfo: JavaModuleInfo
|
||||
): JavaModule.Root {
|
||||
val packageParts =
|
||||
if (isCompilationJDK12OrLater) emptyMap()
|
||||
if (!filterPackages) emptyMap()
|
||||
else hashMapOf<String, Boolean>().also { parts ->
|
||||
moduleInfo.exports.forEach {
|
||||
for (part in generateSequence(it.packageFqName) { part -> if (!part.isRoot) part.parent() else null }) {
|
||||
@@ -148,21 +156,24 @@ class CliJavaModuleFinder(
|
||||
}
|
||||
}
|
||||
|
||||
val moduleFolders =
|
||||
if (filterModules)
|
||||
listFoldersForRelease.filter { virtualFile -> virtualFile.name == moduleInfo.moduleName }
|
||||
else
|
||||
listFoldersForRelease
|
||||
|
||||
return listFoldersForRelease.mapNotNull { virtualFile ->
|
||||
val rootFolder = when {
|
||||
isCompilationJDK12OrLater -> if (virtualFile.name == moduleInfo.moduleName) virtualFile else return@mapNotNull null
|
||||
else -> {
|
||||
if (virtualFile.children.none { it.name in packageParts }) return@mapNotNull null
|
||||
ModuleVirtualFileForRootPart(virtualFile.parent, virtualFile, packageParts, "")
|
||||
}
|
||||
}
|
||||
JavaModule.Root(
|
||||
rootFolder,
|
||||
isBinary = true,
|
||||
isBinarySignature = true
|
||||
)
|
||||
}
|
||||
return JavaModule.Root(
|
||||
CtSymDirectoryContainer(
|
||||
ctSymRootFolder ?: ctSymFile,
|
||||
moduleFolders,
|
||||
packageParts,
|
||||
"",
|
||||
moduleInfo.moduleName,
|
||||
skipPackageCheck = !filterPackages
|
||||
),
|
||||
isBinary = true,
|
||||
isBinarySignature = true
|
||||
)
|
||||
}
|
||||
|
||||
private fun codeFor(release: Int): String = release.toString(36).toUpperCase()
|
||||
@@ -170,7 +181,12 @@ class CliJavaModuleFinder(
|
||||
private fun matchesRelease(fileName: String, release: Int) =
|
||||
!fileName.contains("-") && fileName.contains(codeFor(release)) // skip `*-modules`
|
||||
|
||||
val listFoldersForRelease: List<VirtualFile> by lazy {
|
||||
|
||||
val nonModuleRoot: JavaModule.Root by lazy {
|
||||
createModuleFromSignature(false, false, JavaModuleInfo("*", emptyList(), emptyList(), emptyList()))
|
||||
}
|
||||
|
||||
private val listFoldersForRelease: List<VirtualFile> by lazy {
|
||||
if (ctSymRootFolder == null) emptyList()
|
||||
else ctSymRootFolder!!.children.filter { matchesRelease(it.name, jdkRelease!!) }.flatMap {
|
||||
if (isCompilationJDK12OrLater)
|
||||
@@ -179,7 +195,7 @@ class CliJavaModuleFinder(
|
||||
listOf(it)
|
||||
}
|
||||
}.apply {
|
||||
if (isEmpty()) reportError("'-Xrelease=${jdkRelease}' option is not supported by used JDK: ${jdkHome?.path}")
|
||||
if (isEmpty()) reportError("'-Xjdk-release=${jdkRelease}' option is not supported by used JDK: ${jdkHome?.path}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +213,7 @@ class CliJavaModuleFinder(
|
||||
children.forEach {
|
||||
result[it.name] = it
|
||||
}
|
||||
} ?: reportError("Can't find modules signatures in `ct.sym` file for `-Xrelease=$jdkRelease` in ${ctSymFile!!.path}")
|
||||
} ?: reportError("Can't find modules signatures in `ct.sym` file for `-Xjdk-release=$jdkRelease` in ${ctSymFile!!.path}")
|
||||
}
|
||||
}
|
||||
return result
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm.modules
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import java.io.InputStream
|
||||
|
||||
class CtSymClassVirtualFile(
|
||||
private val parent: VirtualFile?,
|
||||
private val file: VirtualFile
|
||||
): VirtualFile() {
|
||||
override fun getName() = file.name
|
||||
|
||||
override fun getFileSystem() = file.fileSystem
|
||||
|
||||
override fun getPath() = file.path
|
||||
|
||||
override fun isWritable() = file.isWritable
|
||||
|
||||
override fun isDirectory() = false
|
||||
|
||||
override fun isValid() = file.isValid
|
||||
|
||||
override fun getParent(): VirtualFile? = parent
|
||||
|
||||
override fun getChildren(): Array<VirtualFile>? = null
|
||||
|
||||
override fun getOutputStream(p0: Any?, p1: Long, p2: Long) = file.getOutputStream(p0, p1, p2)
|
||||
|
||||
override fun contentsToByteArray(): ByteArray = file.contentsToByteArray()
|
||||
|
||||
override fun getTimeStamp() = file.timeStamp
|
||||
|
||||
override fun getLength() = file.length
|
||||
|
||||
override fun refresh(p0: Boolean, p1: Boolean, p2: Runnable?) = file.refresh(p0, p1, p2)
|
||||
|
||||
override fun getInputStream(): InputStream? = file.inputStream
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm.modules
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import java.io.InputStream
|
||||
|
||||
class CtSymDirectoryContainer(
|
||||
private val parent: VirtualFile?,
|
||||
private val rootOrPackageParts: List<VirtualFile>,
|
||||
private val packages: Map<String, Boolean>,
|
||||
private val currentPackage: String,
|
||||
private val moduleRoot: String,
|
||||
private val skipPackageCheck: Boolean
|
||||
) : VirtualFile() {
|
||||
|
||||
private val _path by lazy { parent?.path + currentPackage + "/" }
|
||||
|
||||
private val _fileSystem by lazy { parent!!.fileSystem }
|
||||
|
||||
private val _isValid by lazy { rootOrPackageParts.all { it.isValid } }
|
||||
|
||||
private val _children by lazy {
|
||||
val children = rootOrPackageParts.flatMap { it.children?.toList() ?: emptyList() }
|
||||
if (children.isEmpty()) return@lazy emptyArray()
|
||||
|
||||
val isExported = skipPackageCheck || packages.getOrDefault(currentPackage, false)
|
||||
val containers = mutableMapOf<String, Pair<CtSymDirectoryContainer, MutableList<VirtualFile>>>()
|
||||
children.mapNotNull { child ->
|
||||
when {
|
||||
child.isDirectory -> {
|
||||
val childPackage = if (currentPackage.isEmpty()) child.name else currentPackage + "." + child.name
|
||||
if (skipPackageCheck || packages.contains(childPackage)) {
|
||||
containers.getOrPut(childPackage) {
|
||||
val list = mutableListOf<VirtualFile>()
|
||||
CtSymDirectoryContainer(
|
||||
this,
|
||||
list,
|
||||
packages,
|
||||
childPackage,
|
||||
moduleRoot,
|
||||
skipPackageCheck
|
||||
) to list
|
||||
}.also { it.second.add(child) }.first
|
||||
} else null
|
||||
}
|
||||
isExported -> CtSymClassVirtualFile(this, child)
|
||||
else -> null
|
||||
}
|
||||
}.toTypedArray()
|
||||
}
|
||||
|
||||
override fun getName() = currentPackage.substringAfterLast(".")
|
||||
|
||||
override fun getFileSystem() = _fileSystem
|
||||
|
||||
override fun getPath() = _path
|
||||
|
||||
override fun isWritable() = false
|
||||
|
||||
override fun isDirectory() = true
|
||||
|
||||
override fun isValid() = _isValid
|
||||
|
||||
override fun getParent(): VirtualFile? = parent
|
||||
|
||||
override fun getChildren(): Array<VirtualFile>? = _children
|
||||
|
||||
override fun getOutputStream(p0: Any?, p1: Long, p2: Long) = error("not supported")
|
||||
|
||||
override fun contentsToByteArray(): ByteArray = error("not supported")
|
||||
|
||||
override fun getTimeStamp() = error("not supported")
|
||||
|
||||
override fun getLength() = error("not supported")
|
||||
|
||||
override fun refresh(p0: Boolean, p1: Boolean, p2: Runnable?) {}
|
||||
|
||||
override fun getInputStream(): InputStream? = error("not supported")
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm.modules
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import java.io.InputStream
|
||||
|
||||
class ModuleVirtualFileForRootPart(
|
||||
private val parent: VirtualFile?,
|
||||
private val virtualFile: VirtualFile,
|
||||
private val packages: Map<String, Boolean>,
|
||||
private val currentPackage: String
|
||||
) : VirtualFile() {
|
||||
|
||||
private val _children by lazy {
|
||||
val children = virtualFile.children ?: return@lazy null
|
||||
val isExported = packages.getOrDefault(currentPackage, false)
|
||||
children.mapNotNull {
|
||||
when {
|
||||
it.isDirectory -> {
|
||||
val childPackage = if (currentPackage.isEmpty()) it.name else currentPackage + "." + it.name
|
||||
if (packages.contains(childPackage))
|
||||
ModuleVirtualFileForRootPart(this, it, packages, childPackage)
|
||||
else null
|
||||
}
|
||||
isExported -> ModuleVirtualFileForRootPart(this, it, emptyMap(), currentPackage)
|
||||
else -> null
|
||||
}
|
||||
}.toTypedArray<VirtualFile>()
|
||||
}
|
||||
|
||||
override fun getName() = virtualFile.name
|
||||
|
||||
override fun getFileSystem() = virtualFile.fileSystem
|
||||
|
||||
override fun getPath() = virtualFile.path
|
||||
|
||||
override fun isWritable() = virtualFile.isWritable
|
||||
|
||||
override fun isDirectory() = virtualFile.isDirectory
|
||||
|
||||
override fun isValid() = virtualFile.isValid
|
||||
|
||||
override fun getParent(): VirtualFile? = parent
|
||||
|
||||
override fun getChildren(): Array<VirtualFile>? = _children
|
||||
|
||||
override fun getOutputStream(p0: Any?, p1: Long, p2: Long) = virtualFile.getOutputStream(p0, p1, p2)
|
||||
|
||||
override fun contentsToByteArray(): ByteArray = virtualFile.contentsToByteArray()
|
||||
|
||||
override fun getTimeStamp() = virtualFile.timeStamp
|
||||
|
||||
override fun getLength() = virtualFile.length
|
||||
|
||||
override fun refresh(p0: Boolean, p1: Boolean, p2: Runnable?) = virtualFile.refresh(p0, p1, p2)
|
||||
|
||||
override fun getInputStream(): InputStream? = virtualFile.inputStream
|
||||
}
|
||||
+104
@@ -199,6 +199,40 @@ public class FirBlackBoxModernJdkCodegenTestGenerated extends AbstractFirBlackBo
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InnerClass {
|
||||
@Test
|
||||
public void testAllFilesPresentInInnerClass() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_10.kt")
|
||||
public void testThreadState_10() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_10.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_11.kt")
|
||||
public void testThreadState_11() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_11.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_8.kt")
|
||||
public void testThreadState_8() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_8.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_9.kt")
|
||||
public void testThreadState_9() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_9.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/reflective")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -487,6 +521,76 @@ public class FirBlackBoxModernJdkCodegenTestGenerated extends AbstractFirBlackBo
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/constable/constable_9.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InnerClass {
|
||||
@Test
|
||||
public void testAllFilesPresentInInnerClass() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_10.kt")
|
||||
public void testThreadState_10() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_10.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_11.kt")
|
||||
public void testThreadState_11() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_11.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_12.kt")
|
||||
public void testThreadState_12() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_12.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_13.kt")
|
||||
public void testThreadState_13() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_13.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_14.kt")
|
||||
public void testThreadState_14() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_14.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_15.kt")
|
||||
public void testThreadState_15() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_15.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_16.kt")
|
||||
public void testThreadState_16() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_16.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_17.kt")
|
||||
public void testThreadState_17() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_17.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_8.kt")
|
||||
public void testThreadState_8() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_8.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_9.kt")
|
||||
public void testThreadState_9() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_9.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+1
-1
@@ -249,7 +249,7 @@ class BinaryJavaClass(
|
||||
fun findInnerClass(name: Name, classFileContent: ByteArray?): JavaClass? {
|
||||
val access = ownInnerClassNameToAccess[name] ?: return null
|
||||
|
||||
return virtualFile.parent.findChild("${virtualFile.nameWithoutExtension}$$name.class")?.let {
|
||||
return virtualFile.parent.findChild("${virtualFile.nameWithoutExtension}$$name.${virtualFile.extension}")?.let {
|
||||
BinaryJavaClass(
|
||||
it, fqName.child(name), context.copyForMember(), signatureParser, access, this,
|
||||
classFileContent
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 10
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 11
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 8
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 9
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 10
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 11
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 12
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 13
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 14
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 15
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 16
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 17
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 8
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// JDK_RELEASE: 9
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
fun box(): String {
|
||||
val myThread: Thread = thread(start = false) { }
|
||||
return if (myThread.state == Thread.State.NEW) "OK" else "fail"
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
error: can't find modules signatures in `ct.sym` file for `-Xrelease=12` in $JDK11/lib/ct.sym
|
||||
error: can't find modules signatures in `ct.sym` file for `-Xjdk-release=12` in $JDK11/lib/ct.sym
|
||||
error: module java.base cannot be found in the module graph
|
||||
COMPILATION_ERROR
|
||||
|
||||
+104
@@ -181,6 +181,40 @@ public class BlackBoxModernJdkCodegenTestGenerated extends AbstractBlackBoxCodeg
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InnerClass {
|
||||
@Test
|
||||
public void testAllFilesPresentInInnerClass() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_10.kt")
|
||||
public void testThreadState_10() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_10.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_11.kt")
|
||||
public void testThreadState_11() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_11.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_8.kt")
|
||||
public void testThreadState_8() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_8.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_9.kt")
|
||||
public void testThreadState_9() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_9.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/reflective")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -469,6 +503,76 @@ public class BlackBoxModernJdkCodegenTestGenerated extends AbstractBlackBoxCodeg
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/constable/constable_9.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InnerClass {
|
||||
@Test
|
||||
public void testAllFilesPresentInInnerClass() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_10.kt")
|
||||
public void testThreadState_10() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_10.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_11.kt")
|
||||
public void testThreadState_11() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_11.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_12.kt")
|
||||
public void testThreadState_12() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_12.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_13.kt")
|
||||
public void testThreadState_13() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_13.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_14.kt")
|
||||
public void testThreadState_14() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_14.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_15.kt")
|
||||
public void testThreadState_15() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_15.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_16.kt")
|
||||
public void testThreadState_16() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_16.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_17.kt")
|
||||
public void testThreadState_17() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_17.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_8.kt")
|
||||
public void testThreadState_8() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_8.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_9.kt")
|
||||
public void testThreadState_9() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_9.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+104
@@ -199,6 +199,40 @@ public class IrBlackBoxModernJdkCodegenTestGenerated extends AbstractIrBlackBoxC
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InnerClass {
|
||||
@Test
|
||||
public void testAllFilesPresentInInnerClass() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_10.kt")
|
||||
public void testThreadState_10() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_10.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_11.kt")
|
||||
public void testThreadState_11() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_11.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_8.kt")
|
||||
public void testThreadState_8() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_8.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_9.kt")
|
||||
public void testThreadState_9() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/innerClass/threadState_9.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava11/releaseFlag/reflective")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -487,6 +521,76 @@ public class IrBlackBoxModernJdkCodegenTestGenerated extends AbstractIrBlackBoxC
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/constable/constable_9.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class InnerClass {
|
||||
@Test
|
||||
public void testAllFilesPresentInInnerClass() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_10.kt")
|
||||
public void testThreadState_10() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_10.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_11.kt")
|
||||
public void testThreadState_11() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_11.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_12.kt")
|
||||
public void testThreadState_12() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_12.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_13.kt")
|
||||
public void testThreadState_13() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_13.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_14.kt")
|
||||
public void testThreadState_14() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_14.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_15.kt")
|
||||
public void testThreadState_15() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_15.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_16.kt")
|
||||
public void testThreadState_16() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_16.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_17.kt")
|
||||
public void testThreadState_17() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_17.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_8.kt")
|
||||
public void testThreadState_8() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_8.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("threadState_9.kt")
|
||||
public void testThreadState_9() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxModernJdk/testsWithJava17/releaseFlag/innerClass/threadState_9.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
Reference in New Issue
Block a user