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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git


The following commit(s) were added to refs/heads/master by this push:
     new e3691bf  Fix SpotBugs issue.
e3691bf is described below

commit e3691bfd27581acb2e0960c8bbaff8952619420c
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Feb 9 11:31:11 2021 -0500

    Fix SpotBugs issue.
---
 src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java 
b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
index 602a8f1..451efb4 100644
--- a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
+++ b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java
@@ -67,7 +67,7 @@ public class FTPSClientTest {
 
     private static String ConnectionUri;
 
-    private static FtpServer Server;
+    private static FtpServer EmbeddedFtpServer;
 
     private static final String USER_PROPS_RES = 
"org/apache/commons/net/ftpsserver/users.properties";
 
@@ -108,8 +108,8 @@ public class FTPSClientTest {
      * @param implicit FTPS connection mode
      * @throws FtpException
      */
-    static void setUpClass(final boolean implicit) throws FtpException {
-        if (Server != null) {
+    private synchronized static void setUpClass(final boolean implicit) throws 
FtpException {
+        if (EmbeddedFtpServer != null) {
             return;
         }
         // Use an ephemeral port.
@@ -148,9 +148,9 @@ public class FTPSClientTest {
         serverFactory.addListener("default", factory.createListener());
 
         // start the server
-        Server = serverFactory.createServer();
-        Server.start();
-        SocketPort = ((org.apache.ftpserver.impl.DefaultFtpServer) 
Server).getListener("default").getPort();
+        EmbeddedFtpServer = serverFactory.createServer();
+        EmbeddedFtpServer.start();
+        SocketPort = ((org.apache.ftpserver.impl.DefaultFtpServer) 
EmbeddedFtpServer).getListener("default").getPort();
         ConnectionUri = "ftps://test:test@localhost:" + SocketPort;
         // System.out.printf("jdk.tls.disabledAlgorithms = %s%n", 
System.getProperty("jdk.tls.disabledAlgorithms"));
     }

Reply via email to