summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}