diff options
Diffstat (limited to 'sonar-batch/src')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/components/PastMeasuresLoader.java | 12 |
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(); } } |