aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-06-24 09:11:30 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-07-02 16:07:04 +0200
commit534bda208505d82734a41f44791ccd50ea928432 (patch)
tree21841906bf21de140050dffdc7d070262208fc99 /sonar-plugin-api/src
parent08cdf04215f4b0b3a4ccfe7902c36df4906688c3 (diff)
downloadsonarqube-534bda208505d82734a41f44791ccd50ea928432.tar.gz
sonarqube-534bda208505d82734a41f44791ccd50ea928432.zip
SONAR-6623 distribution of issues by debt in Compute Engine
This allows to deprecate org.sonar.api.measures.RuleMeasure
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/test/IsRuleMeasure.java52
3 files changed, 10 insertions, 52 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
index 42530abf132..e3be32a43a0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/MeasuresFilters.java
@@ -204,6 +204,10 @@ public final class MeasuresFilters {
}
}
+ /**
+ * @deprecated since 5.2. Useless by design because of Compute Engine
+ */
+ @Deprecated
private abstract static class AbstractRuleMeasureFilter<M> extends MetricFilter<M> {
protected AbstractRuleMeasureFilter(Metric metric) {
super(metric);
@@ -232,6 +236,10 @@ public final class MeasuresFilters {
}
}
+ /**
+ * @deprecated since 5.2. Useless by design because of Compute Engine
+ */
+ @Deprecated
private static class RuleFilter extends AbstractRuleMeasureFilter<RuleMeasure> {
private RuleKey ruleKey;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
index ca201e7ca06..ba265ef413d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
@@ -31,7 +31,9 @@ import javax.annotation.Nullable;
/**
* @since 1.10
+ * @deprecated since 5.2. Ignored by design because of Compute Engine.
*/
+@Deprecated
public class RuleMeasure extends Measure {
private RuleKey ruleKey;
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/test/IsRuleMeasure.java b/sonar-plugin-api/src/test/java/org/sonar/api/test/IsRuleMeasure.java
deleted file mode 100644
index 3f9f67ce236..00000000000
--- a/sonar-plugin-api/src/test/java/org/sonar/api/test/IsRuleMeasure.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.test;
-
-import org.apache.commons.lang.ObjectUtils;
-import org.apache.commons.lang.math.NumberUtils;
-import org.mockito.ArgumentMatcher;
-import org.sonar.api.measures.Measure;
-import org.sonar.api.measures.Metric;
-import org.sonar.api.measures.RuleMeasure;
-import org.sonar.api.rules.Rule;
-
-public class IsRuleMeasure extends ArgumentMatcher<Measure> {
-
- private Metric metric = null;
- private Rule rule = null;
- private Double value = null;
-
- public IsRuleMeasure(Metric metric, Rule rule, Double value) {
- this.metric = metric;
- this.rule = rule;
- this.value = value;
- }
-
- @Override
- public boolean matches(Object o) {
- if (!(o instanceof RuleMeasure)) {
- return false;
- }
- RuleMeasure m = (RuleMeasure) o;
- return ObjectUtils.equals(metric, m.getMetric()) &&
- ObjectUtils.equals(rule.ruleKey(), m.ruleKey()) &&
- NumberUtils.compare(value, m.getValue()) == 0;
- }
-}