diff options
3 files changed, 26 insertions, 20 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 26c697bf542..e7c897d9fb3 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 @@ -41,7 +41,7 @@ import java.util.List; * Decorator that handles the life cycle of a review (for instance, closes a review when its corresponding violation has been fixed). */ @NotDryRun -@DependsUpon(DecoratorBarriers.END_OF_VIOLATION_TRACKING) +@DependsUpon(DecoratorBarriers.END_OF_VIOLATION_PERSISTENCE) @DependedUpon(CloseReviewsDecorator.REVIEW_LIFECYCLE_BARRIER) public class CloseReviewsDecorator implements Decorator { 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 1b49a41caf1..0c84c9859e5 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 @@ -35,7 +35,8 @@ import org.sonar.core.NotDryRun; import java.util.List; @NotDryRun -@Phase(name = Phase.Name.POST) +@DependsUpon({ DecoratorBarriers.END_OF_VIOLATION_TRACKING, DecoratorBarriers.START_VIOLATION_PERSISTENCE }) +@DependedUpon(DecoratorBarriers.END_OF_VIOLATION_PERSISTENCE) public class ViolationPersisterDecorator implements Decorator { private ViolationTrackingDecorator tracker; @@ -54,11 +55,6 @@ public class ViolationPersisterDecorator implements Decorator { return true; } - @DependsUpon - public Class dependsOnTracker() { - return ViolationTrackingDecorator.class; - } - public void decorate(Resource resource, DecoratorContext context) { saveViolations(context.getProject(), context.getViolations(ViolationQuery.create().forResource(resource).setSwitchMode(ViolationQuery.SwitchMode.BOTH))); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java index 526c87c6c9e..9d5b632cb56 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java @@ -23,8 +23,8 @@ package org.sonar.api.batch; * Barriers are used to define the order of execution of Decorators. Decorators must be annotated with the following : * * <ul> - * <li{@code @DependsUpon(BARRIER)} in order to be executed after BARRIER - * <li{@code @DependedUpon(BARRIER)} in order to be executed before BARRIER + * <li>{@code @DependsUpon(BARRIER)} in order to be executed after BARRIER</li> + * <li>{@code @DependedUpon(BARRIER)} in order to be executed before BARRIER</li> * </ul> * * @since 2.3 @@ -53,20 +53,30 @@ public interface DecoratorBarriers { */ String START_VIOLATION_TRACKING = "START_VIOLATION_TRACKING"; - /* - * This barrier is after {@code END_OF_VIOLATIONS_GENERATION} and {@code START_VIOLATION_TRACKING}. - * Decorators executed after this barrier ({@code @DependsUpon(value=DecoratorBarriers.END_OF_VIOLATION_TRACKING}) - * can benefit from all the features of violation tracking : - * <ul> - * <li>{@code Violation#getCreatedAt()}</li> - * <li>{@code Violation#isSwitchedOff()}, usually to know if a violation has been flagged as false-positives in UI</li> - * </ul> - * - * @since 2.8 - */ + /** + * This barrier is after {@code END_OF_VIOLATIONS_GENERATION} and {@code START_VIOLATION_TRACKING}. + * Decorators executed after this barrier ({@code @DependsUpon(value=DecoratorBarriers.END_OF_VIOLATION_TRACKING}) + * can benefit from all the features of violation tracking : + * <ul> + * <li>{@code Violation#getCreatedAt()}</li> + * <li>{@code Violation#isSwitchedOff()}, usually to know if a violation has been flagged as false-positives in UI</li> + * </ul> + * + * @since 2.8 + */ String END_OF_VIOLATION_TRACKING = "END_OF_VIOLATION_TRACKING"; /** + * @since 2.13 + */ + String START_VIOLATION_PERSISTENCE = "START_VIOLATION_PERSISTENCE"; + + /** + * @since 2.13 + */ + String END_OF_VIOLATION_PERSISTENCE = "END_OF_VIOLATION_PERSISTENCE"; + + /** * Any kinds of time machine data are calculated before this barrier. Decorators executed after this barrier can use * Measure#getVariationValue() and Measure#getTendency() methods. * |