diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-04-27 23:41:28 +0200 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-04-27 23:43:05 +0200 |
commit | f4e12a9527a48da48784dce1345f1014509c19e9 (patch) | |
tree | 5cc7e9df5696347330ee778235027b8a7418d0cf /plugins/sonar-core-plugin/src | |
parent | ec6b3ca5aea613d856fe5631728a34db9b4a2c73 (diff) | |
download | sonarqube-f4e12a9527a48da48784dce1345f1014509c19e9.tar.gz sonarqube-f4e12a9527a48da48784dce1345f1014509c19e9.zip |
Fix scheduling of ViolationDecorator
ViolationPersisterDecorator must be executed before computing measures on violations, so the flag switched_off is correctly loaded from database.
Diffstat (limited to 'plugins/sonar-core-plugin/src')
4 files changed, 8 insertions, 4 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java index e037cd03877..2d339753595 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/CloseReviewsDecorator.java @@ -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); diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationsDecorator.java index 1190432b1a9..de9e1a1123b 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationsDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ViolationsDecorator.java @@ -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 diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java index 1408ac59902..b5fd6553251 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/NewViolationsDecorator.java @@ -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; diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java index 84b13feeae2..fe42056dea0 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/timemachine/ViolationPersisterDecorator.java @@ -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. */ |