summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-24 12:16:06 +0200
committerDavid Gageot <david@gageot.net>2012-07-24 12:16:46 +0200
commitac4ad0128f36aee9ab483c7d3cf66f961e9700ed (patch)
treee6e9f430de6ef51ce01e57b9d5f2f67b5a6c574b
parent11a723c41edf7d0cf4ddae4700a77eaedf4fc298 (diff)
downloadsonarqube-ac4ad0128f36aee9ab483c7d3cf66f961e9700ed.tar.gz
sonarqube-ac4ad0128f36aee9ab483c7d3cf66f961e9700ed.zip
Fix violation
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java14
1 files changed, 6 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 807f3e17504..af56d4a04dc 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
@@ -340,13 +340,15 @@ public class DefaultIndex extends SonarIndex {
return;
}
+ addViolation(violation, bucket, force);
+ }
+
+ private void addViolation(Violation violation, Bucket bucket, boolean force) {
boolean isIgnored = !force && violationFilters != null && violationFilters.isIgnored(violation);
- if (!isIgnored) {
- addViolation(violation, bucket);
+ if (isIgnored) {
+ return;
}
- }
- private void addViolation(Violation violation, Bucket bucket) {
// TODO this code is not the responsibility of this index. It should be moved somewhere else.
if (!violation.isManual()) {
ActiveRule activeRule = profile.getActiveRule(violation.getRule());
@@ -360,10 +362,6 @@ public class DefaultIndex extends SonarIndex {
}
}
- doAddViolation(violation, bucket);
- }
-
- private void doAddViolation(Violation violation, Bucket bucket) {
bucket.addViolation(violation);
}