Generalized method name.

Original commit: 9f86441f95
This commit is contained in:
Evgeny Gerashchenko
2014-06-19 15:47:22 +04:00
parent fe3a02e750
commit e6f2f89255
2 changed files with 9 additions and 12 deletions
@@ -224,7 +224,7 @@ public class KotlinBuilder extends ModuleLevelBuilder {
try { try {
for (ModuleBuildTarget target : chunk.getTargets()) { for (ModuleBuildTarget target : chunk.getTargets()) {
for (String file : dirtyFilesHolder.getRemovedFiles(target)) { for (String file : dirtyFilesHolder.getRemovedFiles(target)) {
cache.clearPackagePartSourceData(target.getId(), new File(file)); cache.clearCacheForRemovedFile(target.getId(), new File(file));
} }
} }
@@ -135,6 +135,10 @@ public class IncrementalCacheImpl(baseDir: File): IncrementalCache {
return false return false
} }
public fun clearCacheForRemovedFile(moduleId: String, sourceFile: File) {
packageSourcesData.remove(getKeyForPackagePart(moduleId, sourceFile))
}
private fun putData(moduleId: String, fqName: FqName, data: ByteArray): Boolean { private fun putData(moduleId: String, fqName: FqName, data: ByteArray): Boolean {
val id = ClassOrPackageId(moduleId, fqName) val id = ClassOrPackageId(moduleId, fqName)
val oldData = protoData[id] val oldData = protoData[id]
@@ -156,19 +160,12 @@ public class IncrementalCacheImpl(baseDir: File): IncrementalCache {
return true return true
} }
private fun putPackagePartSourceData(moduleId: String, sourceFile: File, className: JvmClassName?) { private fun getKeyForPackagePart(moduleId: String, sourceFile: File): String {
val key = moduleId + File.pathSeparator + sourceFile.getAbsolutePath() return moduleId + File.pathSeparator + sourceFile.getAbsolutePath()
if (className != null) {
packageSourcesData.put(key, className.getInternalName())
}
else {
packageSourcesData.remove(key)
}
} }
public fun clearPackagePartSourceData(moduleId: String, sourceFile: File) { private fun putPackagePartSourceData(moduleId: String, sourceFile: File, className: JvmClassName) {
putPackagePartSourceData(moduleId, sourceFile, null) packageSourcesData.put(getKeyForPackagePart(moduleId, sourceFile), className.getInternalName())
} }
public override fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String> { public override fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String> {