Repository: maven-surefire
Updated Branches:
  refs/heads/master 0d4ca4dec -> 178e67942


[SUREFIRE] refactoring


Project: http://git-wip-us.apache.org/repos/asf/maven-surefire/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-surefire/commit/822e17c7
Tree: http://git-wip-us.apache.org/repos/asf/maven-surefire/tree/822e17c7
Diff: http://git-wip-us.apache.org/repos/asf/maven-surefire/diff/822e17c7

Branch: refs/heads/master
Commit: 822e17c7586d76b9992193c854770f85b074a4ef
Parents: 0d4ca4d
Author: Tibor17 <tibo...@lycos.com>
Authored: Sun Oct 11 10:47:10 2015 +0200
Committer: Tibor17 <tibo...@lycos.com>
Committed: Sun Oct 11 10:47:10 2015 +0200

----------------------------------------------------------------------
 .../surefire/booterclient/ForkStarter.java      | 38 ++++++++++----------
 1 file changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-surefire/blob/822e17c7/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
----------------------------------------------------------------------
diff --git 
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
 
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
index 6f9624c..629ede7 100644
--- 
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
+++ 
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
@@ -119,12 +119,30 @@ public class ForkStarter
     private static final ThreadFactory SHUTDOWN_HOOK_THREAD_FACTORY
         = newDaemonThreadFactory( "surefire-jvm-killer-shutdownhook" );
 
+    private static final AtomicInteger systemPropertiesFileCounter = new 
AtomicInteger();
+
     private final ScheduledExecutorService pingThreadScheduler = 
createPingScheduler();
 
     private final ScheduledExecutorService timeoutCheckScheduler;
 
     private final Queue<ForkClient> currentForkClients;
 
+    private final int forkedProcessTimeoutInSeconds;
+
+    private final ProviderConfiguration providerConfiguration;
+
+    private final StartupConfiguration startupConfiguration;
+
+    private final ForkConfiguration forkConfiguration;
+
+    private final StartupReportConfiguration startupReportConfiguration;
+
+    private final Log log;
+
+    private final DefaultReporterFactory defaultReporterFactory;
+
+    private final Collection<DefaultReporterFactory> defaultReporterFactories;
+
     /**
      * Closes an InputStream
      */
@@ -155,24 +173,6 @@ public class ForkStarter
         }
     }
 
-    private final int forkedProcessTimeoutInSeconds;
-
-    private final ProviderConfiguration providerConfiguration;
-
-    private final StartupConfiguration startupConfiguration;
-
-    private final ForkConfiguration forkConfiguration;
-
-    private final StartupReportConfiguration startupReportConfiguration;
-
-    private final Log log;
-
-    private final DefaultReporterFactory defaultReporterFactory;
-
-    private final Collection<DefaultReporterFactory> defaultReporterFactories;
-
-    private static volatile int systemPropertiesFileCounter = 0;
-
     public ForkStarter( ProviderConfiguration providerConfiguration, 
StartupConfiguration startupConfiguration,
                         ForkConfiguration forkConfiguration, int 
forkedProcessTimeoutInSeconds,
                         StartupReportConfiguration startupReportConfiguration, 
Log log )
@@ -487,7 +487,7 @@ public class ForkStarter
                     createCopyAndReplaceForkNumPlaceholder( 
effectiveSystemProperties, forkNumber );
 
                 systPropsFile = writePropertiesFile( filteredProperties, 
forkConfiguration.getTempDirectory(),
-                                                     "surefire_" + 
systemPropertiesFileCounter++,
+                                                     "surefire_" + 
systemPropertiesFileCounter.getAndIncrement(),
                                                      
forkConfiguration.isDebug() );
             }
             else

Reply via email to