summaryrefslogtreecommitdiffstats
path: root/sonar-batch/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-11-24 17:15:31 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2011-11-24 17:18:30 +0100
commit36f47f4b53f8a5b8befecf89ce6e10c977ba874c (patch)
tree85cfcc52d4fc386f477a2f82f723fcc079002609 /sonar-batch/src
parent47140a13d3cc91f8b71426cb767dc382f9a3ef9e (diff)
downloadsonarqube-36f47f4b53f8a5b8befecf89ce6e10c977ba874c.tar.gz
sonarqube-36f47f4b53f8a5b8befecf89ce6e10c977ba874c.zip
SONAR-3029 API: allow to have different severities for violations related to the same rule
Diffstat (limited to 'sonar-batch/src')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java b/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java
index 5b21a07ba5c..3b835911d41 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java
@@ -65,7 +65,7 @@ public class PastMeasuresLoader implements BatchExtension {
}
public List<Object[]> getPastMeasures(String resourceKey, Snapshot projectPastSnapshot) {
- String sql = "select m.metric_id, m.characteristic_id, m.rule_id, m.rule_priority, m.value from project_measures m, snapshots s" +
+ String sql = "select m.metric_id, m.characteristic_id, m.rule_id, m.value from project_measures m, snapshots s" +
" where m.snapshot_id=s.id and m.metric_id in (:metricIds) " +
" and (s.root_snapshot_id=:rootSnapshotId or s.id=:rootSnapshotId) and s.status=:status and s.project_id=(select p.id from projects p where p.kee=:resourceKey and p.qualifier<>:lib)";
return session.createNativeQuery(sql)
@@ -94,17 +94,11 @@ public class PastMeasuresLoader implements BatchExtension {
return number!=null ? number.intValue() : null;
}
- public static Integer getSeverityId(Object[] row) {
- // can be BigDecimal on Oracle
- Number number = (Number) row[3];
- return number!=null ? number.intValue() : null;
- }
-
public static boolean hasValue(Object[] row) {
- return row[4] != null;
+ return row[3] != null;
}
public static double getValue(Object[] row) {
- return ((Number) row[4]).doubleValue();
+ return ((Number) row[3]).doubleValue();
}
}