Permalink
Browse files

Fix violation

  • Loading branch information...
1 parent 11a723c commit ac4ad0128f36aee9ab483c7d3cf66f961e9700ed @dgageot dgageot committed Jul 24, 2012
Showing with 6 additions and 8 deletions.
  1. +6 −8 sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
@@ -340,13 +340,15 @@ public void addViolation(Violation violation, boolean force) {
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 @@ private void addViolation(Violation violation, Bucket bucket) {
}
}
- doAddViolation(violation, bucket);
- }
-
- private void doAddViolation(Violation violation, Bucket bucket) {
bucket.addViolation(violation);
}

0 comments on commit ac4ad01

Please sign in to comment.