From ac4ad0128f36aee9ab483c7d3cf66f961e9700ed Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 24 Jul 2012 12:16:06 +0200 Subject: [PATCH] Fix violation --- .../java/org/sonar/batch/index/DefaultIndex.java | 14 ++++++-------- 1 file 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); } -- 2.39.5