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 {
for (ModuleBuildTarget target : chunk.getTargets()) {
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
}
public fun clearCacheForRemovedFile(moduleId: String, sourceFile: File) {
packageSourcesData.remove(getKeyForPackagePart(moduleId, sourceFile))
}
private fun putData(moduleId: String, fqName: FqName, data: ByteArray): Boolean {
val id = ClassOrPackageId(moduleId, fqName)
val oldData = protoData[id]
@@ -156,19 +160,12 @@ public class IncrementalCacheImpl(baseDir: File): IncrementalCache {
return true
}
private fun putPackagePartSourceData(moduleId: String, sourceFile: File, className: JvmClassName?) {
val key = moduleId + File.pathSeparator + sourceFile.getAbsolutePath()
if (className != null) {
packageSourcesData.put(key, className.getInternalName())
}
else {
packageSourcesData.remove(key)
}
private fun getKeyForPackagePart(moduleId: String, sourceFile: File): String {
return moduleId + File.pathSeparator + sourceFile.getAbsolutePath()
}
public fun clearPackagePartSourceData(moduleId: String, sourceFile: File) {
putPackagePartSourceData(moduleId, sourceFile, null)
private fun putPackagePartSourceData(moduleId: String, sourceFile: File, className: JvmClassName) {
packageSourcesData.put(getKeyForPackagePart(moduleId, sourceFile), className.getInternalName())
}
public override fun getRemovedPackageParts(moduleId: String, compiledSourceFilesToFqName: Map<File, String>): Collection<String> {