From 57da8588103106fd154eddf8f14f715cb89f32ca Mon Sep 17 00:00:00 2001 From: "Aleksei.Cherepanov" Date: Tue, 14 Feb 2023 11:50:57 +0100 Subject: [PATCH] [JPS] Don't use non-optimal Files.exist() in JPS context check on dry start-up After moving JPS from the IJ repo back to the Kotlin repo, some file operations were accidentally changed to non-optimal ones. #KTIJ-21161 Fixed --- .../org/jetbrains/kotlin/jps/incremental/CacheVersionManager.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionManager.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionManager.kt index 56ff40115eb..d7412d180b4 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionManager.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/CacheVersionManager.kt @@ -28,7 +28,7 @@ class CacheVersionManager( else CacheVersion(expectedOwnVersion, JvmBytecodeBinaryVersion.INSTANCE, JvmMetadataVersion.INSTANCE) override fun loadActual(): CacheVersion? = - if (Files.notExists(versionFile)) null + if (!versionFile.toFile().exists()) null else try { CacheVersion(Files.newInputStream(versionFile).bufferedReader().use { it.readText() }.toInt()) } catch (e: NumberFormatException) {