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
commit 84dbe824ba5e98db600a48e33c49c546afcbe655 Author: Gary Gregory <[email protected]> AuthorDate: Mon Nov 7 10:59:34 2022 -0500 Use final --- src/main/java/org/apache/commons/net/ftp/FTPClient.java | 4 ++-- src/main/java/org/apache/commons/net/ftp/FTPSClient.java | 4 ++-- src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java | 8 ++++---- .../apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/net/ftp/FTPClient.java b/src/main/java/org/apache/commons/net/ftp/FTPClient.java index 21c1d562..99c71455 100644 --- a/src/main/java/org/apache/commons/net/ftp/FTPClient.java +++ b/src/main/java/org/apache/commons/net/ftp/FTPClient.java @@ -1945,7 +1945,7 @@ public class FTPClient extends FTP implements Configurable { key = line.substring(1); } key = key.toUpperCase(Locale.ENGLISH); - Set<String> entries = featuresMap.computeIfAbsent(key, k -> new HashSet<>()); + final Set<String> entries = featuresMap.computeIfAbsent(key, k -> new HashSet<>()); entries.add(value); } } @@ -3108,7 +3108,7 @@ public class FTPClient extends FTP implements Configurable { * @see #isIpAddressFromPasvResponse * @since 3.9.0 */ - public void setIpAddressFromPasvResponse(boolean usingIpAddressFromPasvResponse) { + public void setIpAddressFromPasvResponse(final boolean usingIpAddressFromPasvResponse) { this.ipAddressFromPasvResponse = usingIpAddressFromPasvResponse; } diff --git a/src/main/java/org/apache/commons/net/ftp/FTPSClient.java b/src/main/java/org/apache/commons/net/ftp/FTPSClient.java index 15d7f3a2..74cad43d 100644 --- a/src/main/java/org/apache/commons/net/ftp/FTPSClient.java +++ b/src/main/java/org/apache/commons/net/ftp/FTPSClient.java @@ -314,7 +314,7 @@ public class FTPSClient extends FTPClient { * @param sslSocket ssl socket * @throws IOException closing sockets is not successful */ - private void closeSockets(Socket socket, Socket sslSocket) throws IOException { + private void closeSockets(final Socket socket, final Socket sslSocket) throws IOException { if (socket != null) { socket.close(); } @@ -685,7 +685,7 @@ public class FTPSClient extends FTPClient { * @throws IOException If an I/O error occurs while either sending a command to the server or receiving a reply from the server. * @since 3.1 */ - private Socket openDataSecureConnection(String command, String arg) throws IOException { + private Socket openDataSecureConnection(final String command, final String arg) throws IOException { if (getDataConnectionMode() != ACTIVE_LOCAL_DATA_CONNECTION_MODE && getDataConnectionMode() != PASSIVE_LOCAL_DATA_CONNECTION_MODE) { return null; } 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 780c6d06..ee9cc228 100644 --- a/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java +++ b/src/test/java/org/apache/commons/net/ftp/FTPSClientTest.java @@ -133,8 +133,8 @@ public class FTPSClientTest { sllConfigFactory.setKeystorePassword("password"); // set the SSL configuration for the listener - SslConfiguration sslConfiguration = sllConfigFactory.createSslConfiguration(); - NoProtocolSslConfigurationProxy noProtocolSslConfigurationProxy = new NoProtocolSslConfigurationProxy(sslConfiguration); + final SslConfiguration sslConfiguration = sllConfigFactory.createSslConfiguration(); + final NoProtocolSslConfigurationProxy noProtocolSslConfigurationProxy = new NoProtocolSslConfigurationProxy(sslConfiguration); factory.setSslConfiguration(noProtocolSslConfigurationProxy); factory.setImplicitSsl(implicit); @@ -154,7 +154,7 @@ public class FTPSClientTest { return new Boolean[] { Boolean.FALSE, Boolean.TRUE }; } - private static void trace(String msg) { + private static void trace(final String msg) { if (TRACE_CALLS) { System.err.println(msg + " " + (System.nanoTime() - startTime)); } @@ -203,7 +203,7 @@ public class FTPSClientTest { // HACK: Without this sleep, the user command sometimes does not reach the ftpserver // This only seems to affect GitHub builds, and only Java 11+ Thread.sleep(200); // 100 seems to be not always enough - } catch (InterruptedException e) { + } catch (final InterruptedException e) { } assertTrue(client.login("test", "test")); assertClientCode(client); diff --git a/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java b/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java index 65bd9517..33381544 100644 --- a/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java +++ b/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java @@ -32,7 +32,7 @@ public class NoProtocolSslConfigurationProxy implements SslConfiguration { private final SslConfiguration sslConfiguration; - public NoProtocolSslConfigurationProxy(SslConfiguration sslConfiguration) { + public NoProtocolSslConfigurationProxy(final SslConfiguration sslConfiguration) { this.sslConfiguration = sslConfiguration; } @@ -62,7 +62,7 @@ public class NoProtocolSslConfigurationProxy implements SslConfiguration { } @Override - public SSLContext getSSLContext(String protocol) throws GeneralSecurityException { + public SSLContext getSSLContext(final String protocol) throws GeneralSecurityException { return this.sslConfiguration.getSSLContext(protocol); }
