ViolationPersisterDecorator must be executed before computing measures on violations, so the flag switched_off is correctly loaded from database.
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);
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
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;
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.
*/