aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-xoo-plugin/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-28 11:23:21 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-28 11:23:21 +0200
commit86ea84aacc37279b3d992b28a80a7aeab405e5e7 (patch)
tree7d50c88246aabb8ba2394fcbb0da5bf927f24942 /plugins/sonar-xoo-plugin/src
parent85bfbe28689b4276a04eeeed91b205ab76e81d06 (diff)
downloadsonarqube-86ea84aacc37279b3d992b28a80a7aeab405e5e7.tar.gz
sonarqube-86ea84aacc37279b3d992b28a80a7aeab405e5e7.zip
Revert deprecation of SonarQubeVersion
so that compatibility with 5.6 does not need to call deprecated code.
Diffstat (limited to 'plugins/sonar-xoo-plugin/src')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java2
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
index 06925832258..9a84189608f 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/XooPlugin.java
@@ -144,7 +144,7 @@ public class XooPlugin implements Plugin {
DeprecatedResourceApiSensor.class);
}
- if (context.getRuntime().getApiVersion().isGreaterThanOrEqual(Version.create(5, 5))) {
+ if (context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(5, 5))) {
context.addExtension(CpdTokenizerSensor.class);
}
}
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java
index 2b9474ec391..995b10d19d8 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java
@@ -19,7 +19,6 @@
*/
package org.sonar.xoo.rule;
-import org.sonar.api.SonarQubeVersion;
import org.sonar.api.batch.fs.FilePredicates;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
@@ -30,6 +29,7 @@ import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.SensorDescriptor;
import org.sonar.api.batch.sensor.issue.NewIssue;
import org.sonar.api.rule.RuleKey;
+import org.sonar.api.utils.Version;
import org.sonar.xoo.Xoo;
import org.sonar.xoo.Xoo2;
@@ -73,7 +73,7 @@ public class OneIssuePerLineSensor implements Sensor {
.at(file.selectLine(line))
.message("This issue is generated on each line"))
.overrideSeverity(severity != null ? Severity.valueOf(severity) : null);
- if (context.getSonarQubeVersion().isGreaterThanOrEqual(SonarQubeVersion.V5_5)) {
+ if (context.getSonarQubeVersion().isGreaterThanOrEqual(Version.create(5, 5))) {
newIssue.gap(context.settings().getDouble(EFFORT_TO_FIX_PROPERTY));
} else {
newIssue.effortToFix(context.settings().getDouble(EFFORT_TO_FIX_PROPERTY));