diff options
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java | 4 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java b/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java index 6b96809a76b..c0c00ae9be3 100644 --- a/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java +++ b/sonar-core/src/main/java/org/sonar/core/plugins/DefaultPluginMetadata.java @@ -191,8 +191,8 @@ public class DefaultPluginMetadata implements PluginMetadata, Comparable<PluginM return true; // Plugins without sonar version are so old, they are compatible with a version containing this code } - Version minimumVersion = Version.create(this.sonarVersion); - Version actualVersion = Version.create(sonarVersion); + Version minimumVersion = Version.createRelease(this.sonarVersion); + Version actualVersion = Version.createRelease(sonarVersion); return actualVersion.compareTo(minimumVersion) >= 0; } diff --git a/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java b/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java index 7d8a770e85e..0714f5bdf23 100644 --- a/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java +++ b/sonar-core/src/test/java/org/sonar/core/plugins/DefaultPluginMetadataTest.java @@ -113,6 +113,9 @@ public class DefaultPluginMetadataTest { assertThat(pluginWithVersion("1.0").isCompatibleWith("1.1")).isTrue(); assertThat(pluginWithVersion("1.1.1").isCompatibleWith("1.1.2")).isTrue(); assertThat(pluginWithVersion("2.0").isCompatibleWith("2.1.0")).isTrue(); + assertThat(pluginWithVersion("3.2").isCompatibleWith("3.2-RC1")).isTrue(); + assertThat(pluginWithVersion("3.2").isCompatibleWith("3.2-RC2")).isTrue(); + assertThat(pluginWithVersion("3.2").isCompatibleWith("3.1-RC2")).isFalse(); assertThat(pluginWithVersion("1.1").isCompatibleWith("1.0")).isFalse(); assertThat(pluginWithVersion("2.0.1").isCompatibleWith("2.0.0")).isFalse(); @@ -127,7 +130,6 @@ public class DefaultPluginMetadataTest { assertThat(pluginWithVersion("3.1-RC2").isCompatibleWith("3.2-SNAPSHOT")).isTrue(); assertThat(pluginWithVersion("3.1-RC1").isCompatibleWith("3.2-RC2")).isTrue(); assertThat(pluginWithVersion("3.1-RC1").isCompatibleWith("3.1-RC2")).isTrue(); - assertThat(pluginWithVersion("3.1-RC2").isCompatibleWith("3.1-RC1")).isFalse(); assertThat(pluginWithVersion(null).isCompatibleWith("0")).isTrue(); assertThat(pluginWithVersion(null).isCompatibleWith("3.1")).isTrue(); |