This is an automated email from the ASF dual-hosted git repository.

tibordigana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/master by this push:
     new 157d2d90d refactor RunOrderParameters constructors
157d2d90d is described below

commit 157d2d90d3063bcad4bec5a67d1fc3bc5dc8072e
Author: tibor.digana <tibordig...@apache.org>
AuthorDate: Thu Apr 7 02:38:48 2022 +0200

    refactor RunOrderParameters constructors
---
 .../surefire/api/testset/RunOrderParameters.java   | 26 +++++++++-------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git 
a/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/RunOrderParameters.java
 
b/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/RunOrderParameters.java
index 92828e975..d7f55a652 100644
--- 
a/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/RunOrderParameters.java
+++ 
b/surefire-api/src/main/java/org/apache/maven/surefire/api/testset/RunOrderParameters.java
@@ -22,10 +22,13 @@ package org.apache.maven.surefire.api.testset;
 import java.io.File;
 import org.apache.maven.surefire.api.util.RunOrder;
 
+import static org.apache.maven.surefire.api.util.RunOrder.ALPHABETICAL;
+import static org.apache.maven.surefire.api.util.RunOrder.DEFAULT;
+
 /**
  * @author Kristian Rosenvold
  */
-public class RunOrderParameters
+public final class RunOrderParameters
 {
     private final RunOrder[] runOrder;
 
@@ -35,35 +38,29 @@ public class RunOrderParameters
 
     public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile )
     {
-        this.runOrder = runOrder;
-        this.runStatisticsFile = runStatisticsFile;
-        this.runOrderRandomSeed = null;
+        this( runOrder, runStatisticsFile, null );
     }
 
     public RunOrderParameters( String runOrder, File runStatisticsFile )
     {
-        this.runOrder = runOrder == null ? RunOrder.DEFAULT : 
RunOrder.valueOfMulti( runOrder );
-        this.runStatisticsFile = runStatisticsFile;
-        this.runOrderRandomSeed = null;
+        this( runOrder, runStatisticsFile, null );
     }
 
-    public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile, 
Long runOrderRandomSeed )
+    public RunOrderParameters( String runOrder, File runStatisticsFile, Long 
runOrderRandomSeed )
     {
-        this.runOrder = runOrder;
-        this.runStatisticsFile = runStatisticsFile;
-        this.runOrderRandomSeed = runOrderRandomSeed;
+        this( runOrder == null ? DEFAULT : RunOrder.valueOfMulti( runOrder ), 
runStatisticsFile, runOrderRandomSeed );
     }
 
-    public RunOrderParameters( String runOrder, File runStatisticsFile, Long 
runOrderRandomSeed )
+    public RunOrderParameters( RunOrder[] runOrder, File runStatisticsFile, 
Long runOrderRandomSeed )
     {
-        this.runOrder = runOrder == null ? RunOrder.DEFAULT : 
RunOrder.valueOfMulti( runOrder );
+        this.runOrder = runOrder;
         this.runStatisticsFile = runStatisticsFile;
         this.runOrderRandomSeed = runOrderRandomSeed;
     }
 
     public static RunOrderParameters alphabetical()
     {
-        return new RunOrderParameters( new RunOrder[]{ RunOrder.ALPHABETICAL 
}, null );
+        return new RunOrderParameters( new RunOrder[]{ ALPHABETICAL }, null );
     }
 
     public RunOrder[] getRunOrder()
@@ -80,5 +77,4 @@ public class RunOrderParameters
     {
         return runStatisticsFile;
     }
-
 }

Reply via email to