]> source.dussan.org Git - sonarqube.git/commitdiff
Fix violation
authorDavid Gageot <david@gageot.net>
Tue, 24 Jul 2012 10:16:06 +0000 (12:16 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 24 Jul 2012 10:16:46 +0000 (12:16 +0200)
sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java

index 807f3e175049c3573e61aa44c3fda75a94c5b3f7..af56d4a04dc640b3fb7ccfb79925a643f75ff06f 100644 (file)
@@ -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);
   }