]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 29 Feb 2016 11:04:44 +0000 (12:04 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 29 Feb 2016 11:04:44 +0000 (12:04 +0100)
server/sonar-server/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java

index b46048b6d66d626849eb566cb2f55a07fe9f42a0..c14e868511487e0ce582262dc91f45dbab660eaf 100644 (file)
@@ -34,6 +34,7 @@ import org.sonar.server.issue.IssueUpdater;
 @ServerSide
 public class IssueWorkflow implements Startable {
 
+  public static final String AUTOMATIC_CLOSE_TRANSITION = "automaticclose";
   private final FunctionExecutor functionExecutor;
   private final IssueUpdater updater;
   private StateMachine machine;
@@ -54,7 +55,7 @@ public class IssueWorkflow implements Startable {
     machine = builder.build();
   }
 
-  private void buildManualTransitions(StateMachine.Builder builder) {
+  private static void buildManualTransitions(StateMachine.Builder builder) {
     builder.transition(Transition.builder(DefaultTransitions.CONFIRM)
       .from(Issue.STATUS_OPEN).to(Issue.STATUS_CONFIRMED)
       .functions(new SetResolution(null))
@@ -125,28 +126,28 @@ public class IssueWorkflow implements Startable {
 
   }
 
-  private void buildAutomaticTransitions(StateMachine.Builder builder) {
+  private static void buildAutomaticTransitions(StateMachine.Builder builder) {
     // Close the "end of life" issues (disabled/deleted rule, deleted component)
     builder
-      .transition(Transition.builder("automaticclose")
+      .transition(Transition.builder(AUTOMATIC_CLOSE_TRANSITION)
         .from(Issue.STATUS_OPEN).to(Issue.STATUS_CLOSED)
         .conditions(IsBeingClosed.INSTANCE)
         .functions(SetClosed.INSTANCE, new SetCloseDate(true))
         .automatic()
         .build())
-      .transition(Transition.builder("automaticclose")
+      .transition(Transition.builder(AUTOMATIC_CLOSE_TRANSITION)
         .from(Issue.STATUS_REOPENED).to(Issue.STATUS_CLOSED)
         .conditions(IsBeingClosed.INSTANCE)
         .functions(SetClosed.INSTANCE, new SetCloseDate(true))
         .automatic()
         .build())
-      .transition(Transition.builder("automaticclose")
+      .transition(Transition.builder(AUTOMATIC_CLOSE_TRANSITION)
         .from(Issue.STATUS_CONFIRMED).to(Issue.STATUS_CLOSED)
         .conditions(IsBeingClosed.INSTANCE)
         .functions(SetClosed.INSTANCE, new SetCloseDate(true))
         .automatic()
         .build())
-      .transition(Transition.builder("automaticclose")
+      .transition(Transition.builder(AUTOMATIC_CLOSE_TRANSITION)
         .from(Issue.STATUS_RESOLVED).to(Issue.STATUS_CLOSED)
         .conditions(new OrCondition(IsBeingClosed.INSTANCE, IsManual.INSTANCE))
         .functions(SetClosed.INSTANCE, new SetCloseDate(true))