aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch/src
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-04-12 16:22:07 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-04-12 16:22:07 +0200
commit6ee4c8231668266efdfd986ebafa84a79d77360a (patch)
tree3cb32c54f049a9b9afc964e5588bf2ab02b1f30f /sonar-batch/src
parentd96d5a6f582f863a89cf3fc7637401a05080bcd6 (diff)
downloadsonarqube-6ee4c8231668266efdfd986ebafa84a79d77360a.tar.gz
sonarqube-6ee4c8231668266efdfd986ebafa84a79d77360a.zip
SONAR-3755 Add Issues console page
Diffstat (limited to 'sonar-batch/src')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java2
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedViolations.java7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/issue/IssuePersister.java7
3 files changed, 8 insertions, 8 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
index 44055904fdf..ea0746d6b47 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
@@ -367,8 +367,8 @@ public class DefaultIndex extends SonarIndex {
}
violation.setResource(bucket.getResource());
- deprecatedViolations.add(violation);
addViolation(violation, bucket, force);
+ deprecatedViolations.add(violation);
}
private void addViolation(Violation violation, Bucket bucket, boolean force) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedViolations.java b/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedViolations.java
index 9841207f8c4..d83c1bccb3e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedViolations.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedViolations.java
@@ -56,10 +56,9 @@ public class DeprecatedViolations implements BatchComponent {
.setCost(violation.getCost())
.setLine(violation.getLineId())
.setMessage(violation.getMessage())
- .setStatus(Issue.STATUS_OPEN);
- if (violation.getSeverity() != null) {
- issue.setSeverity(violation.getSeverity().name());
- }
+ .setStatus(Issue.STATUS_OPEN)
+ .setSeverity(violation.getSeverity() != null ? violation.getSeverity().name() : null);
+
// FIXME
//issue.setPerson(violation.getPersonId());
return issue;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/IssuePersister.java b/sonar-batch/src/main/java/org/sonar/batch/issue/IssuePersister.java
index 8722358f488..55333446f62 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/issue/IssuePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/issue/IssuePersister.java
@@ -23,6 +23,7 @@ import org.sonar.api.database.model.Snapshot;
import org.sonar.api.issue.Issue;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RuleFinder;
+import org.sonar.api.utils.KeyValueFormat;
import org.sonar.batch.index.ScanPersister;
import org.sonar.batch.index.SnapshotCache;
import org.sonar.core.issue.DefaultIssue;
@@ -76,6 +77,7 @@ public class IssuePersister implements ScanPersister {
.setCost(issue.cost())
.setResolution(issue.resolution())
.setStatus(issue.status())
+ .setSeverity(issue.severity())
.setChecksum(issue.getChecksum())
.setManualIssue(issue.isManual())
.setManualSeverity(issue.isManualSeverity())
@@ -86,9 +88,8 @@ public class IssuePersister implements ScanPersister {
.setClosedAt(issue.closedAt())
.setRuleId(ruleId)
.setResourceId(componentId)
-
- // TODO
-// .setData(null)
+ .setData(issue.attributes() != null ? KeyValueFormat.format(issue.attributes()) : null)
+ // TODO
// .setPersonId()
;
}