Throw BuildDataCorruptedException when lookup operation cannot be performed

That is expected to force a rebuild (but it does not seem to be the case
in case of parallel build).

  #KT-22535
  #KT-22995
This commit is contained in:
Alexey Tsvetkov
2018-02-22 02:10:09 +03:00
parent 8ab9366ae5
commit 140ba0681a
2 changed files with 18 additions and 6 deletions
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.utils.Printer
import org.jetbrains.kotlin.utils.keysToMap
import java.io.File
import java.io.IOException
import java.util.*
@@ -47,11 +48,16 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
private var deletedCount: Int = 0
init {
if (countersFile.exists()) {
val lines = countersFile.readLines()
size = lines[0].toInt()
deletedCount = lines[1].toInt()
try {
if (countersFile.exists()) {
val lines = countersFile.readLines()
size = lines[0].toInt()
deletedCount = lines[1].toInt()
}
} catch (e: Exception) {
throw IOException("Could not read $countersFile", e)
}
}
@Synchronized