Avoid deserializing .kotlin_module as class proto
#KT-20184 fixed
This commit is contained in:
@@ -287,7 +287,9 @@ open class IncrementalJvmCache(
|
|||||||
fun remove(className: JvmClassName, changesCollector: ChangesCollector) {
|
fun remove(className: JvmClassName, changesCollector: ChangesCollector) {
|
||||||
val key = className.internalName
|
val key = className.internalName
|
||||||
val oldValue = storage[key] ?: return
|
val oldValue = storage[key] ?: return
|
||||||
changesCollector.collectProtoChanges(oldData = oldValue.toProtoData(className.packageFqName), newData = null)
|
if (key != MODULE_MAPPING_FILE_NAME) {
|
||||||
|
changesCollector.collectProtoChanges(oldData = oldValue.toProtoData(className.packageFqName), newData = null)
|
||||||
|
}
|
||||||
storage.remove(key)
|
storage.remove(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -1315,6 +1315,12 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("allKotlinFilesRemovedThenNewAdded")
|
||||||
|
public void testAllKotlinFilesRemovedThenNewAdded() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("classToPackageFacade")
|
@TestMetadata("classToPackageFacade")
|
||||||
public void testClassToPackageFacade() throws Exception {
|
public void testClassToPackageFacade() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade/");
|
||||||
|
|||||||
+6
@@ -1156,6 +1156,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("allKotlinFilesRemovedThenNewAdded")
|
||||||
|
public void testAllKotlinFilesRemovedThenNewAdded() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("classToPackageFacade")
|
@TestMetadata("classToPackageFacade")
|
||||||
public void testClassToPackageFacade() throws Exception {
|
public void testClassToPackageFacade() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade/");
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
public class A {}
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
class B
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/MainKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
================ Step #2 =================
|
||||||
|
|
||||||
|
Compiling files:
|
||||||
|
src/B.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
fun main(args: Array<String>) {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user