diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt index 06d9573617a..072c5c51f89 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt @@ -27,7 +27,12 @@ abstract class AbstractBlackBoxAgainstJavaCodegenTest : AbstractBlackBoxCodegenT CodegenTestUtil.compileJava(CodegenTestUtil.findJavaSourcesInDirectory(directory), emptyList(), extractJavacOptions(files)) } - super.doMultiFileTest(wholeFile, files) + super.doMultiFileTest(wholeFile, files.map { file -> + // This is a hack which allows to avoid compiling Java sources for the second time (which would be incorrect in this test), + // while also retaining content of all Java sources so that we could find and use test directives in Java sources + // in CodegenTestCase.compile. + if (file.name.endsWith(".java")) TestFile("${file.name}.disabled", file.content) else file + }) } override fun updateConfiguration(configuration: CompilerConfiguration) {