From 48d9812d9e379af7713d93833d7eceb5f6222b0f Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Thu, 17 Dec 2020 15:37:16 +0300 Subject: [PATCH] Review fixes around type enhancement and loading type use annotations --- .../structure/impl/classFiles/Annotations.kt | 153 +++++++----------- .../impl/classFiles/BinaryJavaClass.kt | 42 ++--- .../java/structure/impl/classFiles/Other.kt | 1 + .../testData/cli/jvm/apiVersionInvalid.out | 2 +- .../cli/jvm/languageVersionInvalid.out | 2 +- .../Basic.runtime.txt | 10 +- .../Basic_DisabledImprovements.runtime.txt | 32 ++++ ...gnAnnotationsCompiledJavaDiagnosticTest.kt | 20 +-- ...nsCompiledJavaDiagnosticTestGenerated.java | 3 +- ...sNoAnnotationInClasspathTestGenerated.java | 45 +----- ...spathWithPsiClassReadingTestGenerated.java | 45 +----- .../ForeignJava8AnnotationsTestGenerated.java | 45 +----- ...cForeignJava8AnnotationsTestGenerated.java | 45 +----- .../generators/tests/GenerateJava8Tests.kt | 11 +- .../jvm/compiler/LoadJava8TestGenerated.java | 8 +- .../load/java/structure/javaElements.kt | 6 +- .../typeEnhancement/signatureEnhancement.kt | 6 +- ...8RuntimeDescriptorLoaderTestGenerated.java | 4 +- .../kotlin/gradle/dsl/KotlinCommonOptions.kt | 6 +- 19 files changed, 148 insertions(+), 338 deletions(-) create mode 100644 compiler/testData/loadJava8/compiledJava/typeUseAnnotations/Basic_DisabledImprovements.runtime.txt diff --git a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt index b474fa1e2bf..a6a5dd1e248 100644 --- a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt +++ b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Annotations.kt @@ -18,7 +18,6 @@ package org.jetbrains.kotlin.load.java.structure.impl.classFiles import org.jetbrains.kotlin.load.java.structure.* import org.jetbrains.kotlin.load.java.structure.impl.classFiles.BinaryJavaAnnotation.Companion.computeTargetType -import org.jetbrains.kotlin.load.java.structure.impl.classFiles.BinaryJavaAnnotation.Companion.translatePath import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name @@ -38,20 +37,14 @@ internal class AnnotationsCollectorFieldVisitor( if (descriptor == null) return null val typeReference = TypeReference(typeRef) + val targetType = if (typePath != null) computeTargetType(field.type, typePath) else field.type - if (typePath != null) { - val translatedPath = translatePath(typePath) - - when (typeReference.sort) { - TypeReference.FIELD -> { - val targetType = computeTargetType(field.type, translatedPath) - return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser, true) - } - } - } + if (targetType !is MutableJavaAnnotationOwner) return null return when (typeReference.sort) { - TypeReference.FIELD -> BinaryJavaAnnotation.addAnnotation(field.type as JavaPlainType, descriptor, context, signatureParser, true) + TypeReference.FIELD -> BinaryJavaAnnotation.addAnnotation( + targetType, descriptor, context, signatureParser, isFreshlySupportedAnnotation = true + ) else -> null } } @@ -69,7 +62,9 @@ internal class AnnotationsAndParameterCollectorMethodVisitor( private var visibleAnnotableParameterCount = parametersCountInMethodDesc private var invisibleAnnotableParameterCount = parametersCountInMethodDesc - override fun visitAnnotationDefault(): AnnotationVisitor? = + val freshlySupportedPositions = setOf(TypeReference.METHOD_TYPE_PARAMETER, TypeReference.METHOD_TYPE_PARAMETER_BOUND) + + override fun visitAnnotationDefault(): AnnotationVisitor = BinaryJavaAnnotationVisitor(context, signatureParser) { member.safeAs()?.annotationParameterDefaultValue = it } @@ -91,7 +86,6 @@ internal class AnnotationsAndParameterCollectorMethodVisitor( override fun visitAnnotation(desc: String, visible: Boolean) = BinaryJavaAnnotation.addAnnotation(member, desc, context, signatureParser) - @Suppress("NOTHING_TO_OVERRIDE") override fun visitAnnotableParameterCount(parameterCount: Int, visible: Boolean) { if (visible) { visibleAnnotableParameterCount = parameterCount @@ -109,39 +103,30 @@ internal class AnnotationsAndParameterCollectorMethodVisitor( return BinaryJavaAnnotation.addAnnotation(member.valueParameters[index], desc, context, signatureParser) } - override fun visitTypeAnnotation(typeRef: Int, typePath: TypePath?, desc: String, visible: Boolean): AnnotationVisitor? { + override fun visitTypeAnnotation(typeRef: Int, typePath: TypePath?, descriptor: String, visible: Boolean): AnnotationVisitor? { val typeReference = TypeReference(typeRef) - if (typePath != null) { - val baseType = when (typeReference.sort) { - TypeReference.METHOD_RETURN -> member.safeAs()?.returnType - TypeReference.METHOD_FORMAL_PARAMETER -> member.valueParameters[typeReference.formalParameterIndex].type - TypeReference.METHOD_TYPE_PARAMETER_BOUND -> - BinaryJavaAnnotation.computeTypeParameterBound(member.typeParameters, typeReference) - else -> null - } ?: return null + fun getTargetType(baseType: JavaType) = + if (typePath != null) { + computeTargetType(baseType, typePath) to true + } else { + baseType to (typeReference.sort in freshlySupportedPositions) + } - return BinaryJavaAnnotation.addAnnotation( - computeTargetType(baseType, translatePath(typePath)) as JavaPlainType, desc, context, signatureParser, true + val (annotationOwner, isFreshlySupportedAnnotation) = when (typeReference.sort) { + TypeReference.METHOD_RETURN -> getTargetType(member.safeAs()?.returnType ?: return null) + TypeReference.METHOD_TYPE_PARAMETER -> member.typeParameters[typeReference.typeParameterIndex] to true + TypeReference.METHOD_FORMAL_PARAMETER -> getTargetType(member.valueParameters[typeReference.formalParameterIndex].type) + TypeReference.METHOD_TYPE_PARAMETER_BOUND -> getTargetType( + BinaryJavaAnnotation.computeTypeParameterBound(member.typeParameters, typeReference) ) - } - - val (targetType, isFreshlySupportedAnnotation) = when (typeReference.sort) { - TypeReference.METHOD_RETURN -> - (member as? BinaryJavaMethod)?.returnType as JavaPlainType to false - TypeReference.METHOD_TYPE_PARAMETER -> - member.typeParameters[typeReference.typeParameterIndex] as BinaryJavaTypeParameter to true - TypeReference.METHOD_FORMAL_PARAMETER -> - member.valueParameters[typeReference.formalParameterIndex].type as JavaPlainType to false - TypeReference.METHOD_TYPE_PARAMETER_BOUND -> - BinaryJavaAnnotation.computeTypeParameterBound(member.typeParameters, typeReference) as JavaPlainType to true else -> return null } - return BinaryJavaAnnotation.addAnnotation(targetType, desc, context, signatureParser, isFreshlySupportedAnnotation) - } + if (annotationOwner !is MutableJavaAnnotationOwner) return null - enum class PathElementType { ARRAY_ELEMENT, WILDCARD_BOUND, ENCLOSING_CLASS, TYPE_ARGUMENT } + return BinaryJavaAnnotation.addAnnotation(annotationOwner, descriptor, context, signatureParser, isFreshlySupportedAnnotation) + } } class BinaryJavaAnnotation private constructor( @@ -150,9 +135,7 @@ class BinaryJavaAnnotation private constructor( override val arguments: Collection, override val isFreshlySupportedTypeUseAnnotation: Boolean ) : JavaAnnotation { - companion object { - fun createAnnotationAndVisitor( desc: String, context: ClassifierResolutionContext, @@ -178,66 +161,52 @@ class BinaryJavaAnnotation private constructor( return annotationVisitor } - internal fun translatePath(path: TypePath): List> { - val length = path.length - val list = mutableListOf>() - for (i in 0 until length) { - when (path.getStep(i)) { - TypePath.INNER_TYPE -> { - continue - } - TypePath.ARRAY_ELEMENT -> { - list.add(AnnotationsAndParameterCollectorMethodVisitor.PathElementType.ARRAY_ELEMENT to null) + @OptIn(ExperimentalStdlibApi::class) + private fun translatePath(path: TypePath) = buildList { + for (i in 0 until path.length) { + when (val step = path.getStep(i)) { + // TODO: process inner types and apply an annotation to the corresponding type component + TypePath.INNER_TYPE -> continue + TypePath.ARRAY_ELEMENT, TypePath.WILDCARD_BOUND -> add(step to 0) + TypePath.TYPE_ARGUMENT -> add(step to path.getStepArgument(i)) + } + } + } + + internal fun computeTargetType(baseType: JavaType, typePath: TypePath) = + translatePath(typePath).fold(baseType) { targetType, (typePathKind, typeArgumentIndex) -> + when (typePathKind) { + TypePath.TYPE_ARGUMENT -> { + require(targetType is JavaClassifierType) + targetType.typeArguments[typeArgumentIndex] + ?: throw IllegalArgumentException("There must be no less than ${typeArgumentIndex + 1} type arguments") } TypePath.WILDCARD_BOUND -> { - list.add(AnnotationsAndParameterCollectorMethodVisitor.PathElementType.WILDCARD_BOUND to null) + // TODO: think about processing annotated wildcards themselves + require(targetType is JavaWildcardType) + targetType.bound + ?: throw IllegalArgumentException("Wildcard mast have a bound for annotation of WILDCARD_BOUND position") } - TypePath.TYPE_ARGUMENT -> { - list.add(AnnotationsAndParameterCollectorMethodVisitor.PathElementType.TYPE_ARGUMENT to path.getStepArgument(i)) - } - } - } - return list - } - - internal fun computeTargetType( - baseType: JavaType, - typePath: List> - ): JavaType { - var targetType = baseType - - for (element in typePath) { - when (element.first) { - AnnotationsAndParameterCollectorMethodVisitor.PathElementType.TYPE_ARGUMENT -> { - if (targetType is JavaClassifierType) { - targetType = targetType.typeArguments[element.second!!]!! - } - } - AnnotationsAndParameterCollectorMethodVisitor.PathElementType.WILDCARD_BOUND -> { - if (targetType is JavaWildcardType) { - targetType = targetType.bound!! - } - } - AnnotationsAndParameterCollectorMethodVisitor.PathElementType.ARRAY_ELEMENT -> { - if (targetType is JavaArrayType) { - targetType = targetType.componentType - } + TypePath.ARRAY_ELEMENT -> { + require(targetType is JavaArrayType) + targetType.componentType } + else -> targetType } } - return targetType - } + internal fun computeTypeParameterBound(typeParameters: List, typeReference: TypeReference): JavaClassifierType { + val typeParameter = typeParameters[typeReference.typeParameterIndex] - internal fun computeTypeParameterBound( - typeParameters: List, - typeReference: TypeReference - ): JavaClassifierType { - val typeParameter = typeParameters[typeReference.typeParameterIndex] as BinaryJavaTypeParameter - val boundIndex = - if (typeParameter.hasImplicitObjectClassBound) typeReference.typeParameterBoundIndex - 1 else typeReference.typeParameterBoundIndex + require(typeParameter is BinaryJavaTypeParameter) { "Type parameter must be a binary type parameter" } - return typeParameters[typeReference.typeParameterIndex].upperBounds.toList()[boundIndex] + val boundIndex = if (typeParameter.hasImplicitObjectClassBound) { + typeReference.typeParameterBoundIndex - 1 + } else { + typeReference.typeParameterBoundIndex + } + + return typeParameter.upperBounds.elementAt(boundIndex) } } diff --git a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/BinaryJavaClass.kt b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/BinaryJavaClass.kt index f525228146c..48922713805 100644 --- a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/BinaryJavaClass.kt +++ b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/BinaryJavaClass.kt @@ -56,7 +56,7 @@ class BinaryJavaClass( // In accordance with JVMS, super class always comes before the interface list private val superclass: JavaClassifierType? get() = supertypes.firstOrNull() - private val interfaces: List get() = supertypes.drop(1) + private val implementedInterfaces: List get() = supertypes.drop(1) override val annotationsByFqName by buildLazyValueForMap() @@ -86,38 +86,22 @@ class BinaryJavaClass( if (descriptor == null) return null + fun getTargetType(baseType: JavaType) = + if (typePath != null) BinaryJavaAnnotation.computeTargetType(baseType, typePath) else baseType + val typeReference = TypeReference(typeRef) - if (typePath != null) { - val translatedPath = BinaryJavaAnnotation.translatePath(typePath) - - when (typeReference.sort) { - TypeReference.CLASS_EXTENDS -> { - val baseType: JavaType = if (typeReference.superTypeIndex == -1) superclass!! else interfaces[typeReference.superTypeIndex] - val targetType = BinaryJavaAnnotation.computeTargetType(baseType, translatedPath) - - return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser, true) - } - TypeReference.CLASS_TYPE_PARAMETER_BOUND -> { - val baseType = computeTypeParameterBound(typeParameters, typeReference) - val targetType = BinaryJavaAnnotation.computeTargetType(baseType, translatedPath) - - return BinaryJavaAnnotation.addAnnotation(targetType as JavaPlainType, descriptor, context, signatureParser, true) - } - } + val annotationOwner = when (typeReference.sort) { + TypeReference.CLASS_EXTENDS -> + getTargetType(if (typeReference.superTypeIndex == -1) superclass!! else implementedInterfaces[typeReference.superTypeIndex]) + TypeReference.CLASS_TYPE_PARAMETER -> typeParameters[typeReference.typeParameterIndex] + TypeReference.CLASS_TYPE_PARAMETER_BOUND -> getTargetType(computeTypeParameterBound(typeParameters, typeReference)) + else -> return null } - return when (typeReference.sort) { - TypeReference.CLASS_TYPE_PARAMETER -> - BinaryJavaAnnotation.addAnnotation( - typeParameters[typeReference.typeParameterIndex] as BinaryJavaTypeParameter, descriptor, context, signatureParser, true - ) - TypeReference.CLASS_TYPE_PARAMETER_BOUND -> - BinaryJavaAnnotation.addAnnotation( - computeTypeParameterBound(typeParameters, typeReference) as JavaPlainType, descriptor, context, signatureParser, true - ) - else -> null - } + if (annotationOwner !is MutableJavaAnnotationOwner) return null + + return BinaryJavaAnnotation.addAnnotation(annotationOwner, descriptor, context, signatureParser, isFreshlySupportedAnnotation = true) } override fun visitEnd() { diff --git a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Other.kt b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Other.kt index 975245f6c61..111ac9ac6b2 100644 --- a/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Other.kt +++ b/compiler/resolution.common.jvm/src/org/jetbrains/kotlin/load/java/structure/impl/classFiles/Other.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.load.java.structure.impl.classFiles import org.jetbrains.kotlin.load.java.structure.* +import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.SmartList import org.jetbrains.org.objectweb.asm.ClassReader diff --git a/compiler/testData/cli/jvm/apiVersionInvalid.out b/compiler/testData/cli/jvm/apiVersionInvalid.out index 5fea5778881..cd148e4175f 100644 --- a/compiler/testData/cli/jvm/apiVersionInvalid.out +++ b/compiler/testData/cli/jvm/apiVersionInvalid.out @@ -1,3 +1,3 @@ error: unknown API version: 239.42 -Supported API versions: 1.2 (DEPRECATED), 1.3, 1.4, 1.5 (EXPERIMENTAL) +Supported API versions: 1.2 (DEPRECATED), 1.3, 1.4, 1.5 (EXPERIMENTAL), 1.6 (EXPERIMENTAL) COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/languageVersionInvalid.out b/compiler/testData/cli/jvm/languageVersionInvalid.out index 150c7939bd9..27fe891bb92 100644 --- a/compiler/testData/cli/jvm/languageVersionInvalid.out +++ b/compiler/testData/cli/jvm/languageVersionInvalid.out @@ -1,3 +1,3 @@ error: unknown language version: 239.42 -Supported language versions: 1.2 (DEPRECATED), 1.3, 1.4, 1.5 (EXPERIMENTAL) +Supported language versions: 1.2 (DEPRECATED), 1.3, 1.4, 1.5 (EXPERIMENTAL), 1.6 (EXPERIMENTAL) COMPILATION_ERROR diff --git a/compiler/testData/loadJava8/compiledJava/typeParameterAnnotations/Basic.runtime.txt b/compiler/testData/loadJava8/compiledJava/typeParameterAnnotations/Basic.runtime.txt index 2a256fb0fdf..181650e0d52 100644 --- a/compiler/testData/loadJava8/compiledJava/typeParameterAnnotations/Basic.runtime.txt +++ b/compiler/testData/loadJava8/compiledJava/typeParameterAnnotations/Basic.runtime.txt @@ -2,13 +2,13 @@ package test public open class Basic { public constructor Basic() + public/*package*/ open fun foo(/*0*/ R!): kotlin.Unit - @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE_PARAMETER}) @kotlin.annotation.Retention(value = ...) public final annotation class A : kotlin.Annotation { - public final val value: kotlin.String - public final fun (): kotlin.String + public interface G { + public abstract fun foo(/*0*/ R!): kotlin.Unit } - public interface G { - public abstract fun foo(/*0*/ R!): kotlin.Unit + public interface G1 { + public abstract fun foo(/*0*/ R!): kotlin.Unit } } diff --git a/compiler/testData/loadJava8/compiledJava/typeUseAnnotations/Basic_DisabledImprovements.runtime.txt b/compiler/testData/loadJava8/compiledJava/typeUseAnnotations/Basic_DisabledImprovements.runtime.txt new file mode 100644 index 00000000000..9db3a85acae --- /dev/null +++ b/compiler/testData/loadJava8/compiledJava/typeUseAnnotations/Basic_DisabledImprovements.runtime.txt @@ -0,0 +1,32 @@ +package test + +public open class Basic_DisabledImprovements { + public/*package*/ constructor Basic_DisabledImprovements(/*0*/ test.Basic_DisabledImprovements.G!) + + public/*package*/ open class A { + public/*package*/ constructor A() + + public/*package*/ open inner class B { + public/*package*/ constructor B() + } + } + + public/*package*/ interface G : test.Basic_DisabledImprovements.G2 { + } + + public/*package*/ interface G2 { + } + + public interface MyClass { + public abstract fun f1(/*0*/ test.Basic_DisabledImprovements.G!): kotlin.Unit + public abstract fun !>!> f10(/*0*/ T!): kotlin.Unit + public abstract fun f2(): test.Basic_DisabledImprovements.G2! + public abstract fun f3(/*0*/ T!): kotlin.Unit + public abstract fun f4(/*0*/ test.Basic_DisabledImprovements.G!>!): kotlin.Unit + public abstract fun f5(/*0*/ test.Basic_DisabledImprovements.G<*>!): kotlin.Unit + public abstract fun f6(/*0*/ test.Basic_DisabledImprovements.G<*>!): kotlin.Unit + public abstract fun f7(/*0*/ test.Basic_DisabledImprovements.G!>!): kotlin.Unit + public abstract fun f81(): test.Basic_DisabledImprovements.G!>! + public abstract fun f9(): test.Basic_DisabledImprovements.G!>! + } +} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractForeignAnnotationsCompiledJavaDiagnosticTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractForeignAnnotationsCompiledJavaDiagnosticTest.kt index 2f06585782b..57be257095e 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractForeignAnnotationsCompiledJavaDiagnosticTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/AbstractForeignAnnotationsCompiledJavaDiagnosticTest.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.checkers -import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.MockLibraryUtil.compileJavaFilesLibraryToJar import java.io.File import kotlin.io.path.ExperimentalPathApi @@ -18,26 +17,21 @@ abstract class AbstractForeignAnnotationsCompiledJavaDiagnosticTest : AbstractDi files: List ) { val ktFiles = files.filter { !it.name.endsWith(".java") } - - val dir = createTempDirectory() val javaFile = File("${wholeFile.parentFile.path}/${wholeFile.nameWithoutExtension}.java") - File("$dir/${wholeFile.nameWithoutExtension}.java").apply { createNewFile() }.writeText(javaFile.readText()) - File(FOREIGN_JDK8_ANNOTATIONS_SOURCES_PATH).copyRecursively(File("$dir/annotations/")) + assertExists(javaFile) + + val javaFilesDir = createTempDirectory().toFile().also { + File(FOREIGN_JDK8_ANNOTATIONS_SOURCES_PATH).copyRecursively(File("$it/annotations/")) + javaFile.copyTo(File("$it/${javaFile.name}")) + } super.doMultiFileTest( wholeFile, ktFiles, - compileJavaFilesLibraryToJar(dir.toString(), "foreign-annotations"), + compileJavaFilesLibraryToJar(javaFilesDir.path, "java-files"), usePsiClassFilesReading = false, excludeNonTypeUseJetbrainsAnnotations = true ) } - - override fun doTest(filePath: String) { - val file = File(filePath) - val expectedText = KotlinTestUtils.doLoadFile(file) - - doMultiFileTest(file, createTestFilesFromFile(file, expectedText)) - } } diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignAnnotationsCompiledJavaDiagnosticTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignAnnotationsCompiledJavaDiagnosticTestGenerated.java index 3d3e1d606f0..4116daf3dd9 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignAnnotationsCompiledJavaDiagnosticTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignAnnotationsCompiledJavaDiagnosticTestGenerated.java @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.checkers; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TestMetadata; import org.junit.runner.RunWith; @@ -25,7 +26,7 @@ public class ForeignAnnotationsCompiledJavaDiagnosticTestGenerated extends Abstr } public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); } @TestMetadata("ClassTypeParameterBound.kt") diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathTestGenerated.java index 654e7666322..75fd2eb2ba1 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathTestGenerated.java @@ -26,7 +26,7 @@ public class ForeignJava8AnnotationsNoAnnotationInClasspathTestGenerated extends } public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); } @TestMetadata("checkerFramework.kt") @@ -129,47 +129,4 @@ public class ForeignJava8AnnotationsNoAnnotationInClasspathTestGenerated extends runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt"); } } - - @TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TypeEnhancementOnCompiledJava extends AbstractForeignJava8AnnotationsNoAnnotationInClasspathTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("ClassTypeParameterBound.kt") - public void testClassTypeParameterBound() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); - } - - @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") - public void testClassTypeParameterBoundWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); - } - - @TestMetadata("ReturnType.kt") - public void testReturnType() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnType.kt"); - } - - @TestMetadata("ReturnTypeWithWarnings.kt") - public void testReturnTypeWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); - } - - @TestMetadata("ValueParameter.kt") - public void testValueParameter() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); - } - - @TestMetadata("ValueParameterWithWarnings.kt") - public void testValueParameterWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); - } - } } diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java index c1a3cf480ce..ae58e4e1528 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTestGenerated.java @@ -26,7 +26,7 @@ public class ForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTe } public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); } @TestMetadata("checkerFramework.kt") @@ -129,47 +129,4 @@ public class ForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTe runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt"); } } - - @TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TypeEnhancementOnCompiledJava extends AbstractForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("ClassTypeParameterBound.kt") - public void testClassTypeParameterBound() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); - } - - @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") - public void testClassTypeParameterBoundWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); - } - - @TestMetadata("ReturnType.kt") - public void testReturnType() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnType.kt"); - } - - @TestMetadata("ReturnTypeWithWarnings.kt") - public void testReturnTypeWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); - } - - @TestMetadata("ValueParameter.kt") - public void testValueParameter() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); - } - - @TestMetadata("ValueParameterWithWarnings.kt") - public void testValueParameterWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); - } - } } diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsTestGenerated.java index d63396f3bbe..4eb268efc01 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/ForeignJava8AnnotationsTestGenerated.java @@ -26,7 +26,7 @@ public class ForeignJava8AnnotationsTestGenerated extends AbstractForeignJava8An } public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); } @TestMetadata("checkerFramework.kt") @@ -129,47 +129,4 @@ public class ForeignJava8AnnotationsTestGenerated extends AbstractForeignJava8An runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt"); } } - - @TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TypeEnhancementOnCompiledJava extends AbstractForeignJava8AnnotationsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("ClassTypeParameterBound.kt") - public void testClassTypeParameterBound() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); - } - - @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") - public void testClassTypeParameterBoundWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); - } - - @TestMetadata("ReturnType.kt") - public void testReturnType() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnType.kt"); - } - - @TestMetadata("ReturnTypeWithWarnings.kt") - public void testReturnTypeWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); - } - - @TestMetadata("ValueParameter.kt") - public void testValueParameter() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); - } - - @TestMetadata("ValueParameterWithWarnings.kt") - public void testValueParameterWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); - } - } } diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/javac/JavacForeignJava8AnnotationsTestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/javac/JavacForeignJava8AnnotationsTestGenerated.java index 06657adadb2..0f3fbf48add 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/javac/JavacForeignJava8AnnotationsTestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/checkers/javac/JavacForeignJava8AnnotationsTestGenerated.java @@ -26,7 +26,7 @@ public class JavacForeignJava8AnnotationsTestGenerated extends AbstractJavacFore } public void testAllFilesPresentInTests() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests"), Pattern.compile("^(.+)\\.kt$"), null, true, "jspecify", "typeEnhancementOnCompiledJava"); } @TestMetadata("checkerFramework.kt") @@ -129,47 +129,4 @@ public class JavacForeignJava8AnnotationsTestGenerated extends AbstractJavacFore runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancement/simple.kt"); } } - - @TestMetadata("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class TypeEnhancementOnCompiledJava extends AbstractJavacForeignJava8AnnotationsTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInTypeEnhancementOnCompiledJava() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava"), Pattern.compile("^(.+)\\.kt$"), null, true); - } - - @TestMetadata("ClassTypeParameterBound.kt") - public void testClassTypeParameterBound() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBound.kt"); - } - - @TestMetadata("ClassTypeParameterBoundWithWarnings.kt") - public void testClassTypeParameterBoundWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ClassTypeParameterBoundWithWarnings.kt"); - } - - @TestMetadata("ReturnType.kt") - public void testReturnType() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnType.kt"); - } - - @TestMetadata("ReturnTypeWithWarnings.kt") - public void testReturnTypeWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ReturnTypeWithWarnings.kt"); - } - - @TestMetadata("ValueParameter.kt") - public void testValueParameter() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameter.kt"); - } - - @TestMetadata("ValueParameterWithWarnings.kt") - public void testValueParameterWithWarnings() throws Exception { - runTest("compiler/testData/foreignAnnotationsJava8/tests/typeEnhancementOnCompiledJava/ValueParameterWithWarnings.kt"); - } - } } diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt b/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt index 108602199d2..aead7323de0 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt @@ -30,19 +30,22 @@ fun main(args: Array) { generateTestGroupSuite(args) { testGroup("compiler/tests-java8/tests", "compiler/testData") { testClass { - model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify")) + model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) } testClass { - model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify")) + model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) } testClass { - model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify")) + model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava")) } testClass { - model("foreignAnnotationsJava8/tests", excludeDirs = listOf("jspecify")) + model( + "foreignAnnotationsJava8/tests", + excludeDirs = listOf("jspecify", "typeEnhancementOnCompiledJava") + ) } testClass { diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/jvm/compiler/LoadJava8TestGenerated.java b/compiler/tests-java8/tests/org/jetbrains/kotlin/jvm/compiler/LoadJava8TestGenerated.java index f02f9b91ef2..c285cf7b703 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/jvm/compiler/LoadJava8TestGenerated.java +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/jvm/compiler/LoadJava8TestGenerated.java @@ -55,7 +55,7 @@ public class LoadJava8TestGenerated extends AbstractLoadJava8Test { } public void testAllFilesPresentInTypeParameterAnnotations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeParameterAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeParameterAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); } @TestMetadata("Basic.java") @@ -78,7 +78,7 @@ public class LoadJava8TestGenerated extends AbstractLoadJava8Test { } public void testAllFilesPresentInTypeUseAnnotations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeUseAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeUseAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); } @TestMetadata("BaseClassTypeArguments.java") @@ -154,7 +154,7 @@ public class LoadJava8TestGenerated extends AbstractLoadJava8Test { } public void testAllFilesPresentInTypeParameterAnnotations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/sourceJava/typeParameterAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/sourceJava/typeParameterAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); } @TestMetadata("Basic.java") @@ -177,7 +177,7 @@ public class LoadJava8TestGenerated extends AbstractLoadJava8Test { } public void testAllFilesPresentInTypeUseAnnotations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/sourceJava/typeUseAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/sourceJava/typeUseAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); } @TestMetadata("BaseClassTypeArguments.java") diff --git a/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/structure/javaElements.kt b/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/structure/javaElements.kt index 10fe0bc09bb..c32b9e35062 100644 --- a/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/structure/javaElements.kt +++ b/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/structure/javaElements.kt @@ -48,8 +48,10 @@ interface JavaTypeParameterListOwner : JavaElement { interface JavaAnnotation : JavaElement { val arguments: Collection val classId: ClassId? - val isIdeExternalAnnotation: Boolean get() = false - val isFreshlySupportedTypeUseAnnotation: Boolean get() = false + val isIdeExternalAnnotation: Boolean + get() = false + val isFreshlySupportedTypeUseAnnotation: Boolean + get() = false fun resolve(): JavaClass? } diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt index 06b40889420..6e4a1f372ac 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/signatureEnhancement.kt @@ -261,11 +261,7 @@ class SignatureEnhancement( * class A extends B<@NotNull Integer> {} */ fun enhanceSuperType(type: KotlinType, context: LazyJavaResolverContext) = - SignatureParts( - null, type, emptyList(), false, context, - AnnotationQualifierApplicabilityType.TYPE_USE, - typeParameterBounds = true - ).enhance().type + SignatureParts(null, type, emptyList(), false, context, AnnotationQualifierApplicabilityType.TYPE_USE).enhance().type private fun ValueParameterDescriptor.hasDefaultValueInAnnotation(type: KotlinType) = when (val defaultValue = getDefaultValueFromAnnotation()) { diff --git a/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/Jvm8RuntimeDescriptorLoaderTestGenerated.java b/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/Jvm8RuntimeDescriptorLoaderTestGenerated.java index b1d8877591d..bb8b8b41209 100644 --- a/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/Jvm8RuntimeDescriptorLoaderTestGenerated.java +++ b/core/descriptors.runtime/tests/org/jetbrains/kotlin/jvm/runtime/Jvm8RuntimeDescriptorLoaderTestGenerated.java @@ -53,7 +53,7 @@ public class Jvm8RuntimeDescriptorLoaderTestGenerated extends AbstractJvm8Runtim } public void testAllFilesPresentInTypeParameterAnnotations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeParameterAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeParameterAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); } @TestMetadata("Basic.java") @@ -76,7 +76,7 @@ public class Jvm8RuntimeDescriptorLoaderTestGenerated extends AbstractJvm8Runtim } public void testAllFilesPresentInTypeUseAnnotations() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeUseAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/loadJava8/compiledJava/typeUseAnnotations"), Pattern.compile("^(.+)\\.java$"), null, true); } @TestMetadata("BaseClassTypeArguments.java") diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt b/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt index 97e0e6dc889..ba5d1c01b53 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt @@ -6,15 +6,15 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToo /** * Allow using declarations only from the specified version of bundled libraries - * Possible values: "1.2 (DEPRECATED)", "1.3", "1.4", "1.5 (EXPERIMENTAL)" + * Possible values: "1.2 (DEPRECATED)", "1.3", "1.4", "1.5 (EXPERIMENTAL)", "1.6 (EXPERIMENTAL)" * Default value: null */ var apiVersion: kotlin.String? /** * Provide source compatibility with the specified version of Kotlin - * Possible values: "1.2 (DEPRECATED)", "1.3", "1.4", "1.5 (EXPERIMENTAL)" + * Possible values: "1.2 (DEPRECATED)", "1.3", "1.4", "1.5 (EXPERIMENTAL)", "1.6 (EXPERIMENTAL)" * Default value: null */ var languageVersion: kotlin.String? -} +} \ No newline at end of file