aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-04-23 00:00:36 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-04-23 19:23:31 +0200
commit5b0b77ac366811d1aa67e15adc10b09eb6351548 (patch)
tree810dd5f06c6c12a1bfbc0787e79b8beaad7d28a4 /sonar-plugin-api
parent4cb7edb0029e605faf960d9d569341c10c4897b2 (diff)
downloadsonarqube-5b0b77ac366811d1aa67e15adc10b09eb6351548.tar.gz
sonarqube-5b0b77ac366811d1aa67e15adc10b09eb6351548.zip
SONAR-6392 Drop measure trends
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachine.java5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java18
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java19
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java1
5 files changed, 19 insertions, 26 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java
index 6289dd9cb2d..710de16c3c5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java
@@ -110,7 +110,7 @@ public interface DecoratorBarriers {
/**
* Any kinds of time machine data are calculated before this barrier. Decorators executed after this barrier can use
- * Measure#getVariationValue() and Measure#getTendency() methods.
+ * Measure#getVariationValue() method.
*
* @since 2.5
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachine.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachine.java
index eb6341b5135..81ffb504294 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachine.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/TimeMachine.java
@@ -42,10 +42,7 @@ public interface TimeMachine extends BatchComponent {
List<Measure> getMeasures(TimeMachineQuery query);
/**
- * Past measures sorted by date. Return only a subset of basic fields : [date (java.util.Date), metric (org.sonar.api.measures.Metric), value (Double)].
- * <p/>
- * <p>Measures of current analysis are not included.</p>
- * <p>This method is recommended instead of getMeasures() for performance reasons. It needs less memory.</p>
+ * Return an empty list since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
*/
List<Object[]> getMeasuresFields(TimeMachineQuery query);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
index fdf32504847..7725d50ce49 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
@@ -27,6 +27,7 @@ import org.sonar.api.database.DatabaseSession;
import org.sonar.api.measures.Metric;
import org.sonar.api.rules.RulePriority;
+import javax.annotation.CheckForNull;
import javax.persistence.*;
import java.io.UnsupportedEncodingException;
@@ -51,9 +52,6 @@ public class MeasureModel implements Cloneable {
@Column(name = "text_value", updatable = true, nullable = true, length = TEXT_VALUE_LENGTH)
private String textValue;
- @Column(name = "tendency", updatable = true, nullable = true)
- private Integer tendency;
-
@Column(name = "metric_id", updatable = false, nullable = false)
private Integer metricId;
@@ -208,19 +206,20 @@ public class MeasureModel implements Cloneable {
}
/**
- * @return the measure tendency
+ * Concept of measure trend is dropped. This method always returns {@code null} since version 5.2.
+ * @deprecated since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
+ * @return null
*/
+ @CheckForNull
public Integer getTendency() {
- return tendency;
+ return null;
}
/**
- * Sets the measure tendency
- *
- * @return the current object
+ * Concept of measure trend is dropped. This method does nothing.
+ * @deprecated since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
*/
public MeasureModel setTendency(Integer tendency) {
- this.tendency = tendency;
return this;
}
@@ -468,7 +467,6 @@ public class MeasureModel implements Cloneable {
clone.setTextValue(getTextValue());
clone.setAlertStatus(getAlertStatus());
clone.setAlertText(getAlertText());
- clone.setTendency(getTendency());
clone.setVariationValue1(getVariationValue1());
clone.setVariationValue2(getVariationValue2());
clone.setVariationValue3(getVariationValue3());
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
index 0cd77c10ddf..260efe3be55 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
@@ -55,7 +55,6 @@ public class Measure<G extends Serializable> implements Serializable {
protected String description;
protected Metric.Level alertStatus;
protected String alertText;
- protected Integer tendency;
protected Date date;
protected Double variation1, variation2, variation3, variation4, variation5;
protected String url;
@@ -438,22 +437,22 @@ public class Measure<G extends Serializable> implements Serializable {
}
/**
- * Gets the measure tendency
- *
- * @return the tendency
+ * Concept of measure trend is dropped.
+ * @deprecated since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
+ * @return {@code null} since version 5.2
*/
+ @Deprecated
+ @CheckForNull
public Integer getTendency() {
- return tendency;
+ return null;
}
/**
- * Sets the tendency for the measure - Internal use only
- *
- * @param tendency the tendency
+ * Concept of measure trend is dropped. This method does nothing.
+ * @deprecated since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
* @return the measure object instance
*/
public Measure setTendency(@Nullable Integer tendency) {
- this.tendency = tendency;
return this;
}
@@ -684,7 +683,7 @@ public class Measure<G extends Serializable> implements Serializable {
return metric.isOptimizedBestValue() == Boolean.TRUE
&& bestValue != null
&& (value == null || NumberUtils.compare(bestValue, value) == 0)
- && allNull(alertStatus, description, tendency, url, data)
+ && allNull(alertStatus, description, url, data)
&& isZeroVariation(variation1, variation2, variation3, variation4, variation5);
}
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 6c507bcb34f..ca201e7ca06 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
@@ -161,7 +161,6 @@ public class RuleMeasure extends Measure {
.append("description", description)
.append("alertStatus", alertStatus)
.append("alertText", alertText)
- .append("tendency", tendency)
.append("severity", rulePriority)
.toString();
}