]> source.dussan.org Git - sonarqube.git/commitdiff
Fix scheduling of ViolationDecorator
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 27 Apr 2011 21:41:28 +0000 (23:41 +0200)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 27 Apr 2011 21:43:05 +0000 (23:43 +0200)
ViolationPersisterDecorator must be executed before computing measures on violations, so the flag switched_off is correctly loaded from database.

plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationsDecorator.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java

index e037cd0387734a955f87516a4c2ee4a1b9e22810..2d33975359565c7221f504202aca29af34bfe4b9 100644 (file)
@@ -31,11 +31,12 @@ import org.sonar.api.database.model.Snapshot;
 import org.sonar.api.resources.Project;
 import org.sonar.api.resources.Resource;
 import org.sonar.batch.index.ResourcePersister;
+import org.sonar.plugins.core.timemachine.ViolationPersisterDecorator;
 
 /**
  * Decorator that currently only closes a review when its corresponding violation has been fixed.
  */
-@DependsUpon("ViolationPersisterDecorator")
+@DependsUpon(ViolationPersisterDecorator.BARRIER)
 public class CloseReviewsDecorator implements Decorator {
 
   private static final Logger LOG = LoggerFactory.getLogger(CloseReviewsDecorator.class);
index 1190432b1a9511761266884f24427624f2278632..de9e1a1123b4b69f2c50c64952f0d25c7fc974dc 100644 (file)
@@ -30,13 +30,14 @@ import org.sonar.api.resources.ResourceUtils;
 import org.sonar.api.rules.Rule;
 import org.sonar.api.rules.RulePriority;
 import org.sonar.api.rules.Violation;
+import org.sonar.plugins.core.timemachine.ViolationPersisterDecorator;
 
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
-@DependsUpon(value = DecoratorBarriers.END_OF_VIOLATIONS_GENERATION)
+@DependsUpon(value = ViolationPersisterDecorator.BARRIER)
 public class ViolationsDecorator implements Decorator {
 
   // temporary data for current resource
index 1408ac599028feea6a239e70190a0e83139d135d..b5fd6553251ea639a5e7eebc75a3748c0896180d 100644 (file)
@@ -39,7 +39,7 @@ import org.sonar.batch.components.TimeMachineConfiguration;
 import java.util.*;
 
 /* temporary workaround - the attributes classes() should be used but it is buggy */
-@DependsUpon("ViolationPersisterDecorator")
+@DependsUpon(ViolationPersisterDecorator.BARRIER)
 public class NewViolationsDecorator implements Decorator {
 
   private TimeMachineConfiguration timeMachineConfiguration;
index 84b13feeae2ba733af87e91f4023e88d982a374d..fe42056dea09a18b48dc2a7720d82ff00076d731 100644 (file)
@@ -45,10 +45,12 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Multimap;
 
 @DependsUpon(DecoratorBarriers.END_OF_VIOLATIONS_GENERATION)
-@DependedUpon("ViolationPersisterDecorator")
+@DependedUpon(ViolationPersisterDecorator.BARRIER)
 /* temporary workaround - see NewViolationsDecorator */
 public class ViolationPersisterDecorator implements Decorator {
 
+  public static final String BARRIER = "ViolationPersisterDecorator";
+
   /**
    * Those chars would be ignored during generation of checksums.
    */