incremental compilation: do not recompile on changes in private static final values.

Original commit: 8557e540fc
This commit is contained in:
Michael Nedzelsky
2015-09-28 14:43:39 +03:00
parent ac20dbf780
commit d3d256e709
6 changed files with 53 additions and 2 deletions
@@ -366,8 +366,8 @@ public class IncrementalCacheImpl(
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL
if (value != null && access and staticFinal == staticFinal) {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE
if (value != null && access and staticFinal == Opcodes.ACC_STATIC or Opcodes.ACC_FINAL) {
result[name] = value
}
return null
@@ -485,6 +485,12 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
doTest(fileName);
}
@TestMetadata("privateConstantsChanged")
public void testPrivateConstantsChanged() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/privateConstantsChanged/");
doTest(fileName);
}
@TestMetadata("privateMethodAdded")
public void testPrivateMethodAdded() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/privateMethodAdded/");
@@ -0,0 +1,11 @@
Cleaning output files:
out/production/module/META-INF/module.kotlin_module
out/production/module/test/ConstKt.class
out/production/module/test/Klass$Companion.class
out/production/module/test/Klass.class
out/production/module/test/Obj.class
out/production/module/test/TestPackage.class
End of files
Compiling files:
src/const.kt
End of files
@@ -0,0 +1,15 @@
package test
val CONST = "foo"
class Klass {
companion object {
private val CHANGED = "old"
public val UNCHANGED = 100
}
}
object Obj : Any() {
private val CHANGED = "old:Obj"
public val UNCHANGED = 200
}
@@ -0,0 +1,15 @@
package test
val CONST = "foo"
class Klass {
companion object {
private val CHANGED = "new"
public val UNCHANGED = 100
}
}
object Obj : Any() {
private val CHANGED = "new:Obj"
public val UNCHANGED = 200
}
@@ -0,0 +1,4 @@
package test
@Deprecated(CONST + Klass.UNCHANGED)
class Usage