Skip to content
Permalink
Browse files
Fix SpotBugs issue.
  • Loading branch information
garydgregory committed Feb 9, 2021
1 parent cf8c01a commit e3691bfd27581acb2e0960c8bbaff8952619420c
Showing 1 changed file with 6 additions and 6 deletions.
@@ -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 static void setUpClass() throws Exception {
* @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 @@ static void setUpClass(final boolean implicit) throws FtpException {
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"));
}

0 comments on commit e3691bf

Please sign in to comment.