From 2a8e1af48947bbd355f517f345095cc97bdf16b2 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Sun, 14 Feb 2016 15:04:54 +0100 Subject: [PATCH] trim -release- from plugin version number when checking whether the runtime is outdated --- .../kotlin/idea/versions/OutdatedKotlinRuntimeChecker.kt | 2 +- .../kotlin/idea/OutdatedKotlinRuntimeNotificationTest.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/versions/OutdatedKotlinRuntimeChecker.kt b/idea/src/org/jetbrains/kotlin/idea/versions/OutdatedKotlinRuntimeChecker.kt index 8ebf529b0e0..e2c15776ff8 100644 --- a/idea/src/org/jetbrains/kotlin/idea/versions/OutdatedKotlinRuntimeChecker.kt +++ b/idea/src/org/jetbrains/kotlin/idea/versions/OutdatedKotlinRuntimeChecker.kt @@ -174,5 +174,5 @@ private val OUTDATED_RUNTIME_GROUP_DISPLAY_ID = "Outdated Kotlin Runtime" fun isRuntimeOutdated(libraryVersion: String?, runtimeVersion: String): Boolean { return libraryVersion == null || libraryVersion.startsWith("internal-") != runtimeVersion.startsWith("internal-") || - VersionComparatorUtil.compare(runtimeVersion, libraryVersion) > 0 + VersionComparatorUtil.compare(runtimeVersion.substringBefore("-release-"), libraryVersion) > 0 } diff --git a/idea/tests/org/jetbrains/kotlin/idea/OutdatedKotlinRuntimeNotificationTest.kt b/idea/tests/org/jetbrains/kotlin/idea/OutdatedKotlinRuntimeNotificationTest.kt index e1482e4c877..bf129b14d27 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/OutdatedKotlinRuntimeNotificationTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/OutdatedKotlinRuntimeNotificationTest.kt @@ -69,6 +69,8 @@ class KotlinRuntimeLibraryUtilTest : TestCase() { notOutdated("1.0.0-beta1-001-Idea3-1", "1.0.0-beta1-001") notOutdated("1.0.0-beta1-001-Idea3-(1)", "1.0.0-beta1-001") + notOutdated("1.0.0-release-IJ143-12", "1.0.0") + outdated("1.0.0-beta1-002-Idea141-1", "1.0.0-beta1-001") outdated("1.0.0-beta1-010-Idea141-1", "1.0.0-beta1-009") outdated("1.0.0-beta1-100-Idea141-1", "1.0.0-beta1-099")