From: David Gageot Date: Tue, 24 Jul 2012 10:16:06 +0000 (+0200) Subject: Fix violation X-Git-Tag: 3.3~362 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ac4ad0128f36aee9ab483c7d3cf66f961e9700ed;p=sonarqube.git Fix violation --- 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); }