Author: krosenvold
Date: Sun Jul  8 20:16:46 2012
New Revision: 1358827

URL: http://svn.apache.org/viewvc?rev=1358827&view=rev
Log:
[SUREFIRE-870] Changed order of statements to avoid potential race

Modified:
    
maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java

Modified: 
maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
URL: 
http://svn.apache.org/viewvc/maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java?rev=1358827&r1=1358826&r2=1358827&view=diff
==============================================================================
--- 
maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
 (original)
+++ 
maven/surefire/trunk/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ForkStarter.java
 Sun Jul  8 20:16:46 2012
@@ -277,12 +277,12 @@ public class ForkStarter
             final int result =
                 CommandLineUtils.executeCommandLine( cli, 
threadedStreamConsumer, threadedStreamConsumer, timeout );
 
+            threadedStreamConsumer.close();
+            forkClient.close();
             if ( result != RunResult.SUCCESS )
             {
                 throw new SurefireBooterForkException( "Error occurred in 
starting fork, check output in log" );
             }
-            threadedStreamConsumer.close();
-            forkClient.close();
 
             runResult = globalRunStatistics.getRunResult();
         }


Reply via email to