You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ti...@apache.org on 2020/02/19 20:32:29 UTC

[maven-surefire] branch maven2surefire-jvm-communication updated: volatile due to async call of close() and renamed variable

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

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


The following commit(s) were added to refs/heads/maven2surefire-jvm-communication by this push:
     new 8aa3b53  volatile due to async call of close() and renamed variable
8aa3b53 is described below

commit 8aa3b530c3efc0dc0cfe10f6a638cf72d90e448b
Author: tibordigana <ti...@apache.org>
AuthorDate: Wed Feb 19 21:32:20 2020 +0100

    volatile due to async call of close() and renamed variable
---
 .../maven/plugin/surefire/extensions/SurefireForkChannel.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
index a7254c0..9f035e4 100644
--- a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
+++ b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/extensions/SurefireForkChannel.java
@@ -52,8 +52,8 @@ final class SurefireForkChannel extends ForkChannel
     private static final byte[] LOCAL_LOOPBACK_IP_ADDRESS = new byte[]{127, 0, 0, 1};
 
     private final ServerSocketChannel server;
-    private final int serverPort;
-    private SocketChannel channel;
+    private final int localPort;
+    private volatile SocketChannel channel;
 
     SurefireForkChannel( int forkChannelId ) throws IOException
     {
@@ -62,7 +62,7 @@ final class SurefireForkChannel extends ForkChannel
         setTrueOptions( SO_REUSEADDR, TCP_NODELAY, SO_KEEPALIVE );
         InetAddress ip = Inet4Address.getByAddress( LOCAL_LOOPBACK_IP_ADDRESS );
         server.bind( new InetSocketAddress( ip, 0 ), 1 );
-        serverPort = ( (InetSocketAddress) server.getLocalAddress() ).getPort();
+        localPort = ( (InetSocketAddress) server.getLocalAddress() ).getPort();
     }
 
     @Override
@@ -90,7 +90,7 @@ final class SurefireForkChannel extends ForkChannel
     @Override
     public String getForkNodeConnectionString()
     {
-        return "tcp://127.0.0.1:" + serverPort;
+        return "tcp://127.0.0.1:" + localPort;
     }
 
     @Override