Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix violation

  • Loading branch information...
commit ac4ad0128f36aee9ab483c7d3cf66f961e9700ed 1 parent 11a723c
David Gageot authored July 24, 2012
14  sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
@@ -340,13 +340,15 @@ public void addViolation(Violation violation, boolean force) {
340 340
       return;
341 341
     }
342 342
 
  343
+    addViolation(violation, bucket, force);
  344
+  }
  345
+
  346
+  private void addViolation(Violation violation, Bucket bucket, boolean force) {
343 347
     boolean isIgnored = !force && violationFilters != null && violationFilters.isIgnored(violation);
344  
-    if (!isIgnored) {
345  
-      addViolation(violation, bucket);
  348
+    if (isIgnored) {
  349
+      return;
346 350
     }
347  
-  }
348 351
 
349  
-  private void addViolation(Violation violation, Bucket bucket) {
350 352
     // TODO this code is not the responsibility of this index. It should be moved somewhere else.
351 353
     if (!violation.isManual()) {
352 354
       ActiveRule activeRule = profile.getActiveRule(violation.getRule());
@@ -360,10 +362,6 @@ private void addViolation(Violation violation, Bucket bucket) {
360 362
       }
361 363
     }
362 364
 
363  
-    doAddViolation(violation, bucket);
364  
-  }
365  
-
366  
-  private void doAddViolation(Violation violation, Bucket bucket) {
367 365
     bucket.addViolation(violation);
368 366
   }
369 367
 

0 notes on commit ac4ad01

Please sign in to comment.
Something went wrong with that request. Please try again.