You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/07 16:20:41 UTC

[commons-net] 01/09: Consistent formatting

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 26f89bf24168a6673ecf86b29c2a18ca4fded1d4
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 7 10:56:56 2022 -0500

    Consistent formatting
---
 .../apache/commons/net/DatagramSocketClient.java   |  187 +-
 .../apache/commons/net/DatagramSocketFactory.java  |   26 +-
 .../commons/net/DefaultDatagramSocketFactory.java  |   28 +-
 .../apache/commons/net/DefaultSocketFactory.java   |  127 +-
 .../commons/net/MalformedServerReplyException.java |   23 +-
 .../apache/commons/net/PrintCommandListener.java   |   77 +-
 .../apache/commons/net/ProtocolCommandEvent.java   |   95 +-
 .../commons/net/ProtocolCommandListener.java       |   25 +-
 .../apache/commons/net/ProtocolCommandSupport.java |   85 +-
 .../java/org/apache/commons/net/SocketClient.java  |  475 ++--
 .../org/apache/commons/net/bsd/RCommandClient.java |  362 +--
 .../org/apache/commons/net/bsd/RExecClient.java    |  198 +-
 .../org/apache/commons/net/bsd/RLoginClient.java   |  110 +-
 .../commons/net/chargen/CharGenTCPClient.java      |   47 +-
 .../commons/net/chargen/CharGenUDPClient.java      |   65 +-
 .../commons/net/daytime/DaytimeTCPClient.java      |   43 +-
 .../commons/net/daytime/DaytimeUDPClient.java      |   42 +-
 .../commons/net/discard/DiscardTCPClient.java      |   34 +-
 .../commons/net/discard/DiscardUDPClient.java      |   58 +-
 .../org/apache/commons/net/echo/EchoTCPClient.java |   39 +-
 .../org/apache/commons/net/echo/EchoUDPClient.java |   63 +-
 .../java/org/apache/commons/net/examples/Main.java |   36 +-
 .../net/examples/cidr/SubnetUtilsExample.java      |   21 +-
 .../commons/net/examples/ftp/FTPClientExample.java |  300 +-
 .../net/examples/ftp/ServerToServerFTP.java        |  118 +-
 .../commons/net/examples/ftp/TFTPExample.java      |  133 +-
 .../commons/net/examples/mail/IMAPExportMbox.java  |  105 +-
 .../commons/net/examples/mail/IMAPImportMbox.java  |   61 +-
 .../apache/commons/net/examples/mail/IMAPMail.java |   16 +-
 .../commons/net/examples/mail/IMAPUtils.java       |   10 +-
 .../commons/net/examples/mail/POP3ExportMbox.java  |   57 +-
 .../apache/commons/net/examples/mail/POP3Mail.java |   57 +-
 .../apache/commons/net/examples/mail/SMTPMail.java |   49 +-
 .../apache/commons/net/examples/mail/Utils.java    |   14 +-
 .../commons/net/examples/nntp/ArticleReader.java   |    6 +-
 .../commons/net/examples/nntp/ExtendedNNTPOps.java |   12 +-
 .../commons/net/examples/nntp/ListNewsgroups.java  |   41 +-
 .../net/examples/nntp/MessageThreading.java        |    7 +-
 .../commons/net/examples/nntp/NNTPUtils.java       |   13 +-
 .../commons/net/examples/nntp/PostMessage.java     |   46 +-
 .../apache/commons/net/examples/ntp/NTPClient.java |   36 +-
 .../commons/net/examples/ntp/SimpleNTPServer.java  |   77 +-
 .../commons/net/examples/ntp/TimeClient.java       |   64 +-
 .../net/examples/telnet/TelnetClientExample.java   |  267 +-
 .../commons/net/examples/telnet/WeatherTelnet.java |   38 +-
 .../apache/commons/net/examples/unix/chargen.java  |   66 +-
 .../apache/commons/net/examples/unix/daytime.java  |   50 +-
 .../org/apache/commons/net/examples/unix/echo.java |   82 +-
 .../apache/commons/net/examples/unix/finger.java   |   70 +-
 .../apache/commons/net/examples/unix/fwhois.java   |   33 +-
 .../apache/commons/net/examples/unix/rdate.java    |   49 +-
 .../apache/commons/net/examples/unix/rexec.java    |   57 +-
 .../apache/commons/net/examples/unix/rlogin.java   |   71 +-
 .../apache/commons/net/examples/unix/rshell.java   |   61 +-
 .../apache/commons/net/examples/util/IOUtil.java   |   50 +-
 .../apache/commons/net/finger/FingerClient.java    |  112 +-
 .../org/apache/commons/net/ftp/Configurable.java   |    9 +-
 src/main/java/org/apache/commons/net/ftp/FTP.java  | 1665 ++++-------
 .../java/org/apache/commons/net/ftp/FTPClient.java | 2890 +++++++-------------
 .../apache/commons/net/ftp/FTPClientConfig.java    |  562 ++--
 .../java/org/apache/commons/net/ftp/FTPCmd.java    |   56 +-
 .../org/apache/commons/net/ftp/FTPCommand.java     |   47 +-
 .../net/ftp/FTPConnectionClosedException.java      |   22 +-
 .../java/org/apache/commons/net/ftp/FTPFile.java   |   58 +-
 .../apache/commons/net/ftp/FTPFileEntryParser.java |   89 +-
 .../commons/net/ftp/FTPFileEntryParserImpl.java    |   35 +-
 .../org/apache/commons/net/ftp/FTPFileFilters.java |    1 +
 .../org/apache/commons/net/ftp/FTPHTTPClient.java  |   28 +-
 .../apache/commons/net/ftp/FTPListParseEngine.java |  195 +-
 .../java/org/apache/commons/net/ftp/FTPReply.java  |  100 +-
 .../org/apache/commons/net/ftp/FTPSClient.java     |  427 ++-
 .../org/apache/commons/net/ftp/FTPSCommand.java    |    9 +-
 .../commons/net/ftp/FTPSServerSocketFactory.java   |    3 +-
 .../apache/commons/net/ftp/FTPSSocketFactory.java  |   46 +-
 .../apache/commons/net/ftp/FTPSTrustManager.java   |   21 +-
 .../net/ftp/parser/CompositeFileEntryParser.java   |   25 +-
 .../parser/ConfigurableFTPFileEntryParserImpl.java |   75 +-
 .../parser/DefaultFTPFileEntryParserFactory.java   |  223 +-
 .../ftp/parser/EnterpriseUnixFTPEntryParser.java   |   97 +-
 .../net/ftp/parser/FTPFileEntryParserFactory.java  |   47 +-
 .../commons/net/ftp/parser/FTPTimestampParser.java |   18 +-
 .../net/ftp/parser/FTPTimestampParserImpl.java     |  141 +-
 .../commons/net/ftp/parser/MLSxEntryParser.java    |  156 +-
 .../commons/net/ftp/parser/MVSFTPEntryParser.java  |  166 +-
 .../net/ftp/parser/MacOsPeterFTPEntryParser.java   |  178 +-
 .../commons/net/ftp/parser/NTFTPEntryParser.java   |  104 +-
 .../net/ftp/parser/NetwareFTPEntryParser.java      |   76 +-
 .../commons/net/ftp/parser/OS2FTPEntryParser.java  |   84 +-
 .../net/ftp/parser/OS400FTPEntryParser.java        |  127 +-
 .../ftp/parser/ParserInitializationException.java  |   13 +-
 .../ftp/parser/RegexFTPFileEntryParserImpl.java    |   74 +-
 .../commons/net/ftp/parser/UnixFTPEntryParser.java |  267 +-
 .../commons/net/ftp/parser/VMSFTPEntryParser.java  |  175 +-
 .../ftp/parser/VMSVersioningFTPEntryParser.java    |   58 +-
 .../commons/net/imap/AuthenticatingIMAPClient.java |  222 +-
 .../java/org/apache/commons/net/imap/IMAP.java     |  235 +-
 .../org/apache/commons/net/imap/IMAPClient.java    |  310 +--
 .../org/apache/commons/net/imap/IMAPCommand.java   |   50 +-
 .../org/apache/commons/net/imap/IMAPReply.java     |   24 +-
 .../org/apache/commons/net/imap/IMAPSClient.java   |  192 +-
 .../org/apache/commons/net/io/CRLFLineReader.java  |   29 +-
 .../apache/commons/net/io/CopyStreamAdapter.java   |   89 +-
 .../org/apache/commons/net/io/CopyStreamEvent.java |   64 +-
 .../apache/commons/net/io/CopyStreamException.java |   37 +-
 .../apache/commons/net/io/CopyStreamListener.java  |   53 +-
 .../commons/net/io/DotTerminatedMessageReader.java |  150 +-
 .../commons/net/io/DotTerminatedMessageWriter.java |  130 +-
 .../commons/net/io/FromNetASCIIInputStream.java    |  113 +-
 .../commons/net/io/FromNetASCIIOutputStream.java   |  106 +-
 .../apache/commons/net/io/SocketInputStream.java   |   32 +-
 .../apache/commons/net/io/SocketOutputStream.java  |   52 +-
 .../commons/net/io/ToNetASCIIInputStream.java      |   96 +-
 .../commons/net/io/ToNetASCIIOutputStream.java     |   67 +-
 src/main/java/org/apache/commons/net/io/Util.java  |  317 +--
 .../java/org/apache/commons/net/nntp/Article.java  |  150 +-
 .../org/apache/commons/net/nntp/ArticleInfo.java   |    5 +-
 .../apache/commons/net/nntp/ArticleIterator.java   |   11 +-
 .../apache/commons/net/nntp/ArticlePointer.java    |   16 +-
 .../java/org/apache/commons/net/nntp/NNTP.java     |  903 +++---
 .../org/apache/commons/net/nntp/NNTPClient.java    | 1441 ++++------
 .../org/apache/commons/net/nntp/NNTPCommand.java   |   64 +-
 .../net/nntp/NNTPConnectionClosedException.java    |   22 +-
 .../org/apache/commons/net/nntp/NNTPReply.java     |  160 +-
 .../commons/net/nntp/NewGroupsOrNewsQuery.java     |  117 +-
 .../org/apache/commons/net/nntp/NewsgroupInfo.java |   81 +-
 .../apache/commons/net/nntp/NewsgroupIterator.java |    7 +-
 .../org/apache/commons/net/nntp/ReplyIterator.java |   10 +-
 .../apache/commons/net/nntp/SimpleNNTPHeader.java  |   84 +-
 .../apache/commons/net/nntp/ThreadContainer.java   |   14 +-
 .../org/apache/commons/net/nntp/Threadable.java    |   10 +-
 .../java/org/apache/commons/net/nntp/Threader.java |   90 +-
 .../org/apache/commons/net/ntp/NTPUDPClient.java   |   73 +-
 .../java/org/apache/commons/net/ntp/NtpUtils.java  |   81 +-
 .../java/org/apache/commons/net/ntp/NtpV3Impl.java |  303 +-
 .../org/apache/commons/net/ntp/NtpV3Packet.java    |   42 +-
 .../java/org/apache/commons/net/ntp/TimeInfo.java  |  188 +-
 .../java/org/apache/commons/net/ntp/TimeStamp.java |  285 +-
 .../commons/net/pop3/ExtendedPOP3Client.java       |  117 +-
 .../java/org/apache/commons/net/pop3/POP3.java     |  179 +-
 .../org/apache/commons/net/pop3/POP3Client.java    |  389 +--
 .../org/apache/commons/net/pop3/POP3Command.java   |   20 +-
 .../apache/commons/net/pop3/POP3MessageInfo.java   |   51 +-
 .../org/apache/commons/net/pop3/POP3Reply.java     |    8 +-
 .../org/apache/commons/net/pop3/POP3SClient.java   |  198 +-
 .../commons/net/smtp/AuthenticatingSMTPClient.java |  200 +-
 .../org/apache/commons/net/smtp/RelayPath.java     |   34 +-
 .../java/org/apache/commons/net/smtp/SMTP.java     |  656 ++---
 .../org/apache/commons/net/smtp/SMTPClient.java    |  548 ++--
 .../org/apache/commons/net/smtp/SMTPCommand.java   |   41 +-
 .../net/smtp/SMTPConnectionClosedException.java    |   21 +-
 .../org/apache/commons/net/smtp/SMTPReply.java     |   98 +-
 .../org/apache/commons/net/smtp/SMTPSClient.java   |  199 +-
 .../apache/commons/net/smtp/SimpleSMTPHeader.java  |   75 +-
 .../commons/net/telnet/EchoOptionHandler.java      |   29 +-
 .../net/telnet/InvalidTelnetOptionException.java   |   16 +-
 .../commons/net/telnet/SimpleOptionHandler.java    |   38 +-
 .../net/telnet/SuppressGAOptionHandler.java        |   29 +-
 .../java/org/apache/commons/net/telnet/Telnet.java |  701 ++---
 .../apache/commons/net/telnet/TelnetClient.java    |  233 +-
 .../apache/commons/net/telnet/TelnetCommand.java   |   77 +-
 .../commons/net/telnet/TelnetInputListener.java    |    9 +-
 .../commons/net/telnet/TelnetInputStream.java      |  324 +--
 .../net/telnet/TelnetNotificationHandler.java      |   23 +-
 .../apache/commons/net/telnet/TelnetOption.java    |   76 +-
 .../commons/net/telnet/TelnetOptionHandler.java    |  168 +-
 .../commons/net/telnet/TelnetOutputStream.java     |   76 +-
 .../net/telnet/TerminalTypeOptionHandler.java      |   59 +-
 .../net/telnet/WindowSizeOptionHandler.java        |   78 +-
 .../java/org/apache/commons/net/tftp/TFTP.java     |  203 +-
 .../org/apache/commons/net/tftp/TFTPAckPacket.java |   98 +-
 .../org/apache/commons/net/tftp/TFTPClient.java    |  269 +-
 .../apache/commons/net/tftp/TFTPDataPacket.java    |  131 +-
 .../apache/commons/net/tftp/TFTPErrorPacket.java   |  102 +-
 .../org/apache/commons/net/tftp/TFTPPacket.java    |  145 +-
 .../commons/net/tftp/TFTPPacketException.java      |   25 +-
 .../commons/net/tftp/TFTPReadRequestPacket.java    |   51 +-
 .../apache/commons/net/tftp/TFTPRequestPacket.java |  140 +-
 .../commons/net/tftp/TFTPWriteRequestPacket.java   |   51 +-
 .../org/apache/commons/net/time/TimeTCPClient.java |   68 +-
 .../org/apache/commons/net/time/TimeUDPClient.java |   66 +-
 .../java/org/apache/commons/net/util/Base64.java   |  418 ++-
 .../java/org/apache/commons/net/util/Charsets.java |    8 +-
 .../apache/commons/net/util/KeyManagerUtils.java   |   75 +-
 .../org/apache/commons/net/util/ListenerList.java  |   33 +-
 .../apache/commons/net/util/SSLContextUtils.java   |   20 +-
 .../apache/commons/net/util/SSLSocketUtils.java    |    7 +-
 .../org/apache/commons/net/util/SubnetUtils.java   |  101 +-
 .../apache/commons/net/util/TrustManagerUtils.java |   11 +-
 .../org/apache/commons/net/whois/WhoisClient.java  |   78 +-
 .../commons/net/SocketClientFunctionalTest.java    |   12 +-
 .../org/apache/commons/net/SocketClientTest.java   |    6 +-
 .../org/apache/commons/net/SubnetUtilsTest.java    |   27 +-
 .../org/apache/commons/net/examples/MainTest.java  |   20 +-
 .../net/ftp/FTPClientConfigFunctionalTest.java     |   47 +-
 .../commons/net/ftp/FTPClientConfigTest.java       |   32 +-
 .../org/apache/commons/net/ftp/FTPClientTest.java  |   34 +-
 .../org/apache/commons/net/ftp/FTPSClientTest.java |   14 +-
 .../commons/net/ftp/ListingFunctionalTest.java     |  150 +-
 .../ftp/parser/CompositeFTPParseTestFramework.java |   55 +-
 .../DefaultFTPFileEntryParserFactoryTest.java      |   36 +-
 .../commons/net/ftp/parser/DownloadListings.java   |   14 +-
 .../parser/EnterpriseUnixFTPEntryParserTest.java   |  119 +-
 .../net/ftp/parser/FTPConfigEntryParserTest.java   |   59 +-
 .../net/ftp/parser/FTPParseTestFramework.java      |   63 +-
 .../net/ftp/parser/FTPTimestampParserImplTest.java |  161 +-
 .../commons/net/ftp/parser/MLSDComparison.java     |   62 +-
 .../net/ftp/parser/MLSxEntryParserTest.java        |   47 +-
 .../net/ftp/parser/MVSFTPEntryParserTest.java      |   66 +-
 .../ftp/parser/MacOsPeterFTPEntryParserTest.java   |   77 +-
 .../net/ftp/parser/NTFTPEntryParserTest.java       |  284 +-
 .../net/ftp/parser/NetwareFTPEntryParserTest.java  |   25 +-
 .../net/ftp/parser/OS2FTPEntryParserTest.java      |   57 +-
 .../parser/OS400FTPEntryParserAdditionalTest.java  |  108 +-
 .../net/ftp/parser/OS400FTPEntryParserTest.java    |  125 +-
 .../net/ftp/parser/UnixFTPEntryParserTest.java     |  159 +-
 .../net/ftp/parser/VMSFTPEntryParserTest.java      |  256 +-
 .../java/org/apache/commons/net/imap/IMAPTest.java |    9 +-
 .../net/io/DotTerminatedMessageReaderTest.java     |   50 +-
 .../commons/net/io/ToNetASCIIInputStreamTest.java  |   32 +-
 .../org/apache/commons/net/ntp/TestNtpClient.java  |    9 +-
 .../org/apache/commons/net/ntp/TestNtpPacket.java  |   24 +-
 .../org/apache/commons/net/ntp/TestTimeInfo.java   |   14 +-
 .../commons/net/pop3/POP3ClientCommandsTest.java   |  262 +-
 .../apache/commons/net/pop3/POP3ClientTest.java    |   82 +-
 .../org/apache/commons/net/pop3/POP3Constants.java |   25 +-
 .../commons/net/pop3/POP3ConstructorTest.java      |   65 +-
 .../commons/net/smtp/SimpleSMTPHeaderTestCase.java |   12 +-
 .../commons/net/telnet/EchoOptionHandlerTest.java  |   27 +-
 .../telnet/InvalidTelnetOptionExceptionTest.java   |   11 +-
 .../net/telnet/SimpleOptionHandlerTest.java        |   27 +-
 .../net/telnet/SuppressGAOptionHandlerTest.java    |   27 +-
 .../net/telnet/TelnetClientFunctionalTest.java     |   40 +-
 .../commons/net/telnet/TelnetClientTest.java       |  587 ++--
 .../telnet/TelnetOptionHandlerTestAbstract.java    |   38 +-
 .../commons/net/telnet/TelnetOptionTest.java       |    9 +-
 .../commons/net/telnet/TelnetTestResponder.java    |   52 +-
 .../commons/net/telnet/TelnetTestSimpleServer.java |   99 +-
 .../net/telnet/TerminalTypeOptionHandlerTest.java  |   49 +-
 .../net/telnet/WindowSizeOptionHandlerTest.java    |   45 +-
 .../org/apache/commons/net/tftp/TFTPServer.java    |  572 ++--
 .../apache/commons/net/tftp/TFTPServerMain.java    |  102 +-
 .../commons/net/tftp/TFTPServerPathTest.java       |   29 +-
 .../java/org/apache/commons/net/tftp/TFTPTest.java |   83 +-
 .../apache/commons/net/time/TimeTCPClientTest.java |   59 +-
 .../commons/net/time/TimeTestSimpleServer.java     |   97 +-
 .../org/apache/commons/net/util/Base64Test.java    |   79 +-
 .../java/org/apache/commons/net/util/UtilTest.java |   69 +-
 247 files changed, 11407 insertions(+), 19649 deletions(-)

diff --git a/src/main/java/org/apache/commons/net/DatagramSocketClient.java b/src/main/java/org/apache/commons/net/DatagramSocketClient.java
index 2b081e59..9f906f9b 100644
--- a/src/main/java/org/apache/commons/net/DatagramSocketClient.java
+++ b/src/main/java/org/apache/commons/net/DatagramSocketClient.java
@@ -23,38 +23,24 @@ import java.net.SocketException;
 import java.nio.charset.Charset;
 
 /**
- * The DatagramSocketClient provides the basic operations that are required
- * of client objects accessing datagram sockets.  It is meant to be
- * subclassed to avoid having to rewrite the same code over and over again
- * to open a socket, close a socket, set timeouts, etc.  Of special note
- * is the {@link #setDatagramSocketFactory  setDatagramSocketFactory }
- * method, which allows you to control the type of DatagramSocket the
- * DatagramSocketClient creates for network communications.  This is
- * especially useful for adding things like proxy support as well as better
- * support for applets.  For
- * example, you could create a
- * {@link org.apache.commons.net.DatagramSocketFactory}
- *  that
- * requests browser security capabilities before creating a socket.
- * All classes derived from DatagramSocketClient should use the
- * {@link #_socketFactory_  _socketFactory_ } member variable to
- * create DatagramSocket instances rather than instantiating
- * them by directly invoking a constructor.  By honoring this contract
- * you guarantee that a user will always be able to provide his own
- * Socket implementations by substituting his own SocketFactory.
+ * The DatagramSocketClient provides the basic operations that are required of client objects accessing datagram sockets. It is meant to be subclassed to avoid
+ * having to rewrite the same code over and over again to open a socket, close a socket, set timeouts, etc. Of special note is the
+ * {@link #setDatagramSocketFactory setDatagramSocketFactory } method, which allows you to control the type of DatagramSocket the DatagramSocketClient creates
+ * for network communications. This is especially useful for adding things like proxy support as well as better support for applets. For example, you could
+ * create a {@link org.apache.commons.net.DatagramSocketFactory} that requests browser security capabilities before creating a socket. All classes derived from
+ * DatagramSocketClient should use the {@link #_socketFactory_ _socketFactory_ } member variable to create DatagramSocket instances rather than instantiating
+ * them by directly invoking a constructor. By honoring this contract you guarantee that a user will always be able to provide his own Socket implementations by
+ * substituting his own SocketFactory.
  *
  *
  * @see DatagramSocketFactory
  */
 
-public abstract class DatagramSocketClient
-{
+public abstract class DatagramSocketClient {
     /**
-     * The default DatagramSocketFactory shared by all DatagramSocketClient
-     * instances.
+     * The default DatagramSocketFactory shared by all DatagramSocketClient instances.
      */
-    private static final DatagramSocketFactory DEFAULT_SOCKET_FACTORY =
-        new DefaultDatagramSocketFactory();
+    private static final DatagramSocketFactory DEFAULT_SOCKET_FACTORY = new DefaultDatagramSocketFactory();
 
     /**
      * Charset to use for byte IO.
@@ -76,26 +62,20 @@ public abstract class DatagramSocketClient
     protected DatagramSocketFactory _socketFactory_;
 
     /**
-     * Default constructor for DatagramSocketClient.  Initializes
-     * _socket_ to null, _timeout_ to 0, and _isOpen_ to false.
+     * Default constructor for DatagramSocketClient. Initializes _socket_ to null, _timeout_ to 0, and _isOpen_ to false.
      */
-    public DatagramSocketClient()
-    {
+    public DatagramSocketClient() {
         _socket_ = null;
         _timeout_ = 0;
         _isOpen_ = false;
         _socketFactory_ = DEFAULT_SOCKET_FACTORY;
     }
 
-
     /**
-     * Closes the DatagramSocket used for the connection.
-     * You should call this method after you've finished using the class
-     * instance and also before you call {@link #open open() }
-     * again.   _isOpen_ is set to false and  _socket_ is set to null.
+     * Closes the DatagramSocket used for the connection. You should call this method after you've finished using the class instance and also before you call
+     * {@link #open open() } again. _isOpen_ is set to false and _socket_ is set to null.
      */
-    public void close()
-    {
+    public void close() {
         if (_socket_ != null) {
             _socket_.close();
         }
@@ -103,7 +83,6 @@ public abstract class DatagramSocketClient
         _isOpen_ = false;
     }
 
-
     /**
      * Gets the charset.
      *
@@ -114,7 +93,6 @@ public abstract class DatagramSocketClient
         return charset;
     }
 
-
     /**
      * Gets the charset name.
      *
@@ -127,134 +105,100 @@ public abstract class DatagramSocketClient
         return charset.name();
     }
 
-
-
     /**
-     * Returns the default timeout in milliseconds that is used when
-     * opening a socket.
+     * Returns the default timeout in milliseconds that is used when opening a socket.
      *
-     * @return The default timeout in milliseconds that is used when
-     *         opening a socket.
+     * @return The default timeout in milliseconds that is used when opening a socket.
      */
-    public int getDefaultTimeout()
-    {
+    public int getDefaultTimeout() {
         return _timeout_;
     }
 
-
     /**
-     * Returns the local address to which the client's socket is bound.
-     * If you call this method when the client socket is not open, a
-     * NullPointerException is thrown.
+     * Returns the local address to which the client's socket is bound. If you call this method when the client socket is not open, a NullPointerException is
+     * thrown.
      *
      * @return The local address to which the client's socket is bound.
      */
-    public InetAddress getLocalAddress()
-    {
+    public InetAddress getLocalAddress() {
         return _socket_.getLocalAddress();
     }
 
-
     /**
-     * Returns the port number of the open socket on the local host used
-     * for the connection.  If you call this method when the client socket
-     * is not open, a NullPointerException is thrown.
+     * Returns the port number of the open socket on the local host used for the connection. If you call this method when the client socket is not open, a
+     * NullPointerException is thrown.
      *
-     * @return The port number of the open socket on the local host used
-     *         for the connection.
+     * @return The port number of the open socket on the local host used for the connection.
      */
-    public int getLocalPort()
-    {
+    public int getLocalPort() {
         return _socket_.getLocalPort();
     }
 
-
     /**
-     * Returns the timeout in milliseconds of the currently opened socket.
-     * If you call this method when the client socket is not open,
-     * a NullPointerException is thrown.
+     * Returns the timeout in milliseconds of the currently opened socket. If you call this method when the client socket is not open, a NullPointerException is
+     * thrown.
      *
      * @return The timeout in milliseconds of the currently opened socket.
      * @throws SocketException if an error getting the timeout
      */
-    public int getSoTimeout() throws SocketException
-    {
+    public int getSoTimeout() throws SocketException {
         return _socket_.getSoTimeout();
     }
 
-
     /**
      * Returns true if the client has a currently open socket.
      *
      * @return True if the client has a currently open socket, false otherwise.
      */
-    public boolean isOpen()
-    {
+    public boolean isOpen() {
         return _isOpen_;
     }
 
-
     /**
-     * Opens a DatagramSocket on the local host at the first available port.
-     * Also sets the timeout on the socket to the default timeout set
-     * by {@link #setDefaultTimeout  setDefaultTimeout() }.
+     * Opens a DatagramSocket on the local host at the first available port. Also sets the timeout on the socket to the default timeout set by
+     * {@link #setDefaultTimeout setDefaultTimeout() }.
      * <p>
-     * _isOpen_ is set to true after calling this method and _socket_
-     * is set to the newly opened socket.
+     * _isOpen_ is set to true after calling this method and _socket_ is set to the newly opened socket.
      *
-     * @throws SocketException If the socket could not be opened or the
-     *   timeout could not be set.
+     * @throws SocketException If the socket could not be opened or the timeout could not be set.
      */
-    public void open() throws SocketException
-    {
+    public void open() throws SocketException {
         _socket_ = _socketFactory_.createDatagramSocket();
         _socket_.setSoTimeout(_timeout_);
         _isOpen_ = true;
     }
 
-
     /**
-     * Opens a DatagramSocket on the local host at a specified port.
-     * Also sets the timeout on the socket to the default timeout set
-     * by {@link #setDefaultTimeout  setDefaultTimeout() }.
+     * Opens a DatagramSocket on the local host at a specified port. Also sets the timeout on the socket to the default timeout set by {@link #setDefaultTimeout
+     * setDefaultTimeout() }.
      * <p>
-     * _isOpen_ is set to true after calling this method and _socket_
-     * is set to the newly opened socket.
+     * _isOpen_ is set to true after calling this method and _socket_ is set to the newly opened socket.
      *
      * @param port The port to use for the socket.
-     * @throws SocketException If the socket could not be opened or the
-     *   timeout could not be set.
+     * @throws SocketException If the socket could not be opened or the timeout could not be set.
      */
-    public void open(final int port) throws SocketException
-    {
+    public void open(final int port) throws SocketException {
         _socket_ = _socketFactory_.createDatagramSocket(port);
         _socket_.setSoTimeout(_timeout_);
         _isOpen_ = true;
     }
 
-
     /**
-     * Opens a DatagramSocket at the specified address on the local host
-     * at a specified port.
-     * Also sets the timeout on the socket to the default timeout set
-     * by {@link #setDefaultTimeout  setDefaultTimeout() }.
+     * Opens a DatagramSocket at the specified address on the local host at a specified port. Also sets the timeout on the socket to the default timeout set by
+     * {@link #setDefaultTimeout setDefaultTimeout() }.
      * <p>
-     * _isOpen_ is set to true after calling this method and _socket_
-     * is set to the newly opened socket.
+     * _isOpen_ is set to true after calling this method and _socket_ is set to the newly opened socket.
      *
-     * @param port The port to use for the socket.
-     * @param laddr  The local address to use.
-     * @throws SocketException If the socket could not be opened or the
-     *   timeout could not be set.
+     * @param port  The port to use for the socket.
+     * @param laddr The local address to use.
+     * @throws SocketException If the socket could not be opened or the timeout could not be set.
      */
-    public void open(final int port, final InetAddress laddr) throws SocketException
-    {
+    public void open(final int port, final InetAddress laddr) throws SocketException {
         _socket_ = _socketFactory_.createDatagramSocket(port, laddr);
         _socket_.setSoTimeout(_timeout_);
         _isOpen_ = true;
     }
 
-
     /**
      * Sets the charset.
      *
@@ -266,16 +210,12 @@ public abstract class DatagramSocketClient
     }
 
     /**
-     * Sets the DatagramSocketFactory used by the DatagramSocketClient
-     * to open DatagramSockets.  If the factory value is null, then a default
-     * factory is used (only do this to reset the factory after having
-     * previously altered it).
+     * Sets the DatagramSocketFactory used by the DatagramSocketClient to open DatagramSockets. If the factory value is null, then a default factory is used
+     * (only do this to reset the factory after having previously altered it).
      *
-     * @param factory  The new DatagramSocketFactory the DatagramSocketClient
-     * should use.
+     * @param factory The new DatagramSocketFactory the DatagramSocketClient should use.
      */
-    public void setDatagramSocketFactory(final DatagramSocketFactory factory)
-    {
+    public void setDatagramSocketFactory(final DatagramSocketFactory factory) {
         if (factory == null) {
             _socketFactory_ = DEFAULT_SOCKET_FACTORY;
         } else {
@@ -284,32 +224,23 @@ public abstract class DatagramSocketClient
     }
 
     /**
-     * Set the default timeout in milliseconds to use when opening a socket.
-     * After a call to open, the timeout for the socket is set using this value.
-     * This method should be used prior to a call to {@link #open open()}
-     * and should not be confused with {@link #setSoTimeout setSoTimeout()}
-     * which operates on the currently open socket.  _timeout_ contains
-     * the new timeout value.
+     * Set the default timeout in milliseconds to use when opening a socket. After a call to open, the timeout for the socket is set using this value. This
+     * method should be used prior to a call to {@link #open open()} and should not be confused with {@link #setSoTimeout setSoTimeout()} which operates on the
+     * currently open socket. _timeout_ contains the new timeout value.
      *
-     * @param timeout  The timeout in milliseconds to use for the datagram socket
-     *                 connection.
+     * @param timeout The timeout in milliseconds to use for the datagram socket connection.
      */
-    public void setDefaultTimeout(final int timeout)
-    {
+    public void setDefaultTimeout(final int timeout) {
         _timeout_ = timeout;
     }
 
     /**
-     * Set the timeout in milliseconds of a currently open connection.
-     * Only call this method after a connection has been opened
-     * by {@link #open open()}.
+     * Set the timeout in milliseconds of a currently open connection. Only call this method after a connection has been opened by {@link #open open()}.
      *
-     * @param timeout  The timeout in milliseconds to use for the currently
-     *                 open datagram socket connection.
+     * @param timeout The timeout in milliseconds to use for the currently open datagram socket connection.
      * @throws SocketException if an error setting the timeout
      */
-    public void setSoTimeout(final int timeout) throws SocketException
-    {
+    public void setSoTimeout(final int timeout) throws SocketException {
         _socket_.setSoTimeout(timeout);
     }
 }
diff --git a/src/main/java/org/apache/commons/net/DatagramSocketFactory.java b/src/main/java/org/apache/commons/net/DatagramSocketFactory.java
index e260b705..ba48bf6e 100644
--- a/src/main/java/org/apache/commons/net/DatagramSocketFactory.java
+++ b/src/main/java/org/apache/commons/net/DatagramSocketFactory.java
@@ -22,24 +22,18 @@ import java.net.InetAddress;
 import java.net.SocketException;
 
 /**
- * The DatagramSocketFactory interface provides a means for the
- * programmer to control the creation of datagram sockets and
- * provide his own DatagramSocket implementations for use by all
- * classes derived from
- * {@link org.apache.commons.net.DatagramSocketClient}
- * .
- * This allows you to provide your own DatagramSocket implementations and
- * to perform security checks or browser capability requests before
- * creating a DatagramSocket.
+ * The DatagramSocketFactory interface provides a means for the programmer to control the creation of datagram sockets and provide his own DatagramSocket
+ * implementations for use by all classes derived from {@link org.apache.commons.net.DatagramSocketClient} . This allows you to provide your own DatagramSocket
+ * implementations and to perform security checks or browser capability requests before creating a DatagramSocket.
  *
  *
  */
 
-public interface DatagramSocketFactory
-{
+public interface DatagramSocketFactory {
 
     /**
      * Creates a DatagramSocket on the local host at the first available port.
+     *
      * @return the socket
      *
      * @throws SocketException If the socket could not be created.
@@ -56,14 +50,12 @@ public interface DatagramSocketFactory
     DatagramSocket createDatagramSocket(int port) throws SocketException;
 
     /**
-     * Creates a DatagramSocket at the specified address on the local host
-     * at a specified port.
+     * Creates a DatagramSocket at the specified address on the local host at a specified port.
      *
-     * @param port The port to use for the socket.
-     * @param laddr  The local address to use.
+     * @param port  The port to use for the socket.
+     * @param laddr The local address to use.
      * @return the socket
      * @throws SocketException If the socket could not be created.
      */
-    DatagramSocket createDatagramSocket(int port, InetAddress laddr)
-    throws SocketException;
+    DatagramSocket createDatagramSocket(int port, InetAddress laddr) throws SocketException;
 }
diff --git a/src/main/java/org/apache/commons/net/DefaultDatagramSocketFactory.java b/src/main/java/org/apache/commons/net/DefaultDatagramSocketFactory.java
index 1f9d75a1..62154bad 100644
--- a/src/main/java/org/apache/commons/net/DefaultDatagramSocketFactory.java
+++ b/src/main/java/org/apache/commons/net/DefaultDatagramSocketFactory.java
@@ -22,11 +22,8 @@ import java.net.InetAddress;
 import java.net.SocketException;
 
 /**
- * DefaultDatagramSocketFactory implements the DatagramSocketFactory
- * interface by simply wrapping the java.net.DatagramSocket
- * constructors.  It is the default DatagramSocketFactory used by
- * {@link org.apache.commons.net.DatagramSocketClient}
- *  implementations.
+ * DefaultDatagramSocketFactory implements the DatagramSocketFactory interface by simply wrapping the java.net.DatagramSocket constructors. It is the default
+ * DatagramSocketFactory used by {@link org.apache.commons.net.DatagramSocketClient} implementations.
  *
  *
  * @see DatagramSocketFactory
@@ -34,17 +31,16 @@ import java.net.SocketException;
  * @see DatagramSocketClient#setDatagramSocketFactory
  */
 
-public class DefaultDatagramSocketFactory implements DatagramSocketFactory
-{
+public class DefaultDatagramSocketFactory implements DatagramSocketFactory {
 
     /**
      * Creates a DatagramSocket on the local host at the first available port.
+     *
      * @return a new DatagramSocket
      * @throws SocketException If the socket could not be created.
      */
     @Override
-    public DatagramSocket createDatagramSocket() throws SocketException
-    {
+    public DatagramSocket createDatagramSocket() throws SocketException {
         return new DatagramSocket();
     }
 
@@ -56,24 +52,20 @@ public class DefaultDatagramSocketFactory implements DatagramSocketFactory
      * @throws SocketException If the socket could not be created.
      */
     @Override
-    public DatagramSocket createDatagramSocket(final int port) throws SocketException
-    {
+    public DatagramSocket createDatagramSocket(final int port) throws SocketException {
         return new DatagramSocket(port);
     }
 
     /**
-     * Creates a DatagramSocket at the specified address on the local host
-     * at a specified port.
+     * Creates a DatagramSocket at the specified address on the local host at a specified port.
      *
-     * @param port The port to use for the socket.
-     * @param laddr  The local address to use.
+     * @param port  The port to use for the socket.
+     * @param laddr The local address to use.
      * @return a new DatagramSocket
      * @throws SocketException If the socket could not be created.
      */
     @Override
-    public DatagramSocket createDatagramSocket(final int port, final InetAddress laddr)
-    throws SocketException
-    {
+    public DatagramSocket createDatagramSocket(final int port, final InetAddress laddr) throws SocketException {
         return new DatagramSocket(port, laddr);
     }
 }
diff --git a/src/main/java/org/apache/commons/net/DefaultSocketFactory.java b/src/main/java/org/apache/commons/net/DefaultSocketFactory.java
index 82141652..c466209d 100644
--- a/src/main/java/org/apache/commons/net/DefaultSocketFactory.java
+++ b/src/main/java/org/apache/commons/net/DefaultSocketFactory.java
@@ -28,11 +28,8 @@ import java.net.UnknownHostException;
 import javax.net.SocketFactory;
 
 /**
- * DefaultSocketFactory implements the SocketFactory interface by
- * simply wrapping the java.net.Socket and java.net.ServerSocket
- * constructors.  It is the default SocketFactory used by
- * {@link org.apache.commons.net.SocketClient}
- * implementations.
+ * DefaultSocketFactory implements the SocketFactory interface by simply wrapping the java.net.Socket and java.net.ServerSocket constructors. It is the default
+ * SocketFactory used by {@link org.apache.commons.net.SocketClient} implementations.
  *
  *
  * @see SocketFactory
@@ -40,16 +37,14 @@ import javax.net.SocketFactory;
  * @see SocketClient#setSocketFactory
  */
 
-public class DefaultSocketFactory extends SocketFactory
-{
+public class DefaultSocketFactory extends SocketFactory {
     /** The proxy to use when creating new sockets. */
     private final Proxy connProxy;
 
     /**
      * The default constructor.
      */
-    public DefaultSocketFactory()
-    {
+    public DefaultSocketFactory() {
         this(null);
     }
 
@@ -59,59 +54,45 @@ public class DefaultSocketFactory extends SocketFactory
      * @param proxy The Proxy to use when creating new Sockets.
      * @since 3.2
      */
-    public DefaultSocketFactory(final Proxy proxy)
-    {
+    public DefaultSocketFactory(final Proxy proxy) {
         connProxy = proxy;
     }
 
     /**
-     * Creates a ServerSocket bound to a specified port.  A port
-     * of 0 will create the ServerSocket on a system-determined free port.
+     * Creates a ServerSocket bound to a specified port. A port of 0 will create the ServerSocket on a system-determined free port.
      *
-     * @param port  The port on which to listen, or 0 to use any free port.
+     * @param port The port on which to listen, or 0 to use any free port.
      * @return A ServerSocket that will listen on a specified port.
-     * @throws IOException If an I/O error occurs while creating
-     *                        the ServerSocket.
+     * @throws IOException If an I/O error occurs while creating the ServerSocket.
      */
-    public ServerSocket createServerSocket(final int port) throws IOException
-    {
+    public ServerSocket createServerSocket(final int port) throws IOException {
         return new ServerSocket(port);
     }
 
     /**
-     * Creates a ServerSocket bound to a specified port with a given
-     * maximum queue length for incoming connections.  A port of 0 will
-     * create the ServerSocket on a system-determined free port.
+     * Creates a ServerSocket bound to a specified port with a given maximum queue length for incoming connections. A port of 0 will create the ServerSocket on
+     * a system-determined free port.
      *
-     * @param port  The port on which to listen, or 0 to use any free port.
-     * @param backlog  The maximum length of the queue for incoming connections.
+     * @param port    The port on which to listen, or 0 to use any free port.
+     * @param backlog The maximum length of the queue for incoming connections.
      * @return A ServerSocket that will listen on a specified port.
-     * @throws IOException If an I/O error occurs while creating
-     *                        the ServerSocket.
+     * @throws IOException If an I/O error occurs while creating the ServerSocket.
      */
-    public ServerSocket createServerSocket(final int port, final int backlog)
-    throws IOException
-    {
+    public ServerSocket createServerSocket(final int port, final int backlog) throws IOException {
         return new ServerSocket(port, backlog);
     }
 
     /**
-     * Creates a ServerSocket bound to a specified port on a given local
-     * address with a given maximum queue length for incoming connections.
-     * A port of 0 will
+     * Creates a ServerSocket bound to a specified port on a given local address with a given maximum queue length for incoming connections. A port of 0 will
      * create the ServerSocket on a system-determined free port.
      *
-     * @param port  The port on which to listen, or 0 to use any free port.
+     * @param port     The port on which to listen, or 0 to use any free port.
      * @param backlog  The maximum length of the queue for incoming connections.
-     * @param bindAddr  The local address to which the ServerSocket should bind.
+     * @param bindAddr The local address to which the ServerSocket should bind.
      * @return A ServerSocket that will listen on a specified port.
-     * @throws IOException If an I/O error occurs while creating
-     *                        the ServerSocket.
+     * @throws IOException If an I/O error occurs while creating the ServerSocket.
      */
-    public ServerSocket createServerSocket(final int port, final int backlog,
-                                           final InetAddress bindAddr)
-    throws IOException
-    {
+    public ServerSocket createServerSocket(final int port, final int backlog, final InetAddress bindAddr) throws IOException {
         return new ServerSocket(port, backlog, bindAddr);
     }
 
@@ -123,10 +104,8 @@ public class DefaultSocketFactory extends SocketFactory
      * @since 3.2
      */
     @Override
-    public Socket createSocket() throws IOException
-    {
-        if (connProxy != null)
-        {
+    public Socket createSocket() throws IOException {
+        if (connProxy != null) {
             return new Socket(connProxy);
         }
         return new Socket();
@@ -136,16 +115,13 @@ public class DefaultSocketFactory extends SocketFactory
      * Creates a Socket connected to the given host and port.
      *
      * @param address The address of the host to connect to.
-     * @param port The port to connect to.
+     * @param port    The port to connect to.
      * @return A Socket connected to the given host and port.
      * @throws IOException If an I/O error occurs while creating the Socket.
      */
     @Override
-    public Socket createSocket(final InetAddress address, final int port)
-    throws IOException
-    {
-        if (connProxy != null)
-        {
+    public Socket createSocket(final InetAddress address, final int port) throws IOException {
+        if (connProxy != null) {
             final Socket s = new Socket(connProxy);
             s.connect(new InetSocketAddress(address, port));
             return s;
@@ -154,23 +130,18 @@ public class DefaultSocketFactory extends SocketFactory
     }
 
     /**
-     * Creates a Socket connected to the given host and port and
-     * originating from the specified local address and port.
+     * Creates a Socket connected to the given host and port and originating from the specified local address and port.
      *
-     * @param address The address of the host to connect to.
-     * @param port The port to connect to.
-     * @param localAddr  The local address to use.
-     * @param localPort  The local port to use.
+     * @param address   The address of the host to connect to.
+     * @param port      The port to connect to.
+     * @param localAddr The local address to use.
+     * @param localPort The local port to use.
      * @return A Socket connected to the given host and port.
      * @throws IOException If an I/O error occurs while creating the Socket.
      */
     @Override
-    public Socket createSocket(final InetAddress address, final int port,
-                               final InetAddress localAddr, final int localPort)
-    throws IOException
-    {
-        if (connProxy != null)
-        {
+    public Socket createSocket(final InetAddress address, final int port, final InetAddress localAddr, final int localPort) throws IOException {
+        if (connProxy != null) {
             final Socket s = new Socket(connProxy);
             s.bind(new InetSocketAddress(localAddr, localPort));
             s.connect(new InetSocketAddress(address, port));
@@ -185,15 +156,12 @@ public class DefaultSocketFactory extends SocketFactory
      * @param host The hostname to connect to.
      * @param port The port to connect to.
      * @return A Socket connected to the given host and port.
-     * @throws UnknownHostException  If the hostname cannot be resolved.
-     * @throws IOException If an I/O error occurs while creating the Socket.
+     * @throws UnknownHostException If the hostname cannot be resolved.
+     * @throws IOException          If an I/O error occurs while creating the Socket.
      */
     @Override
-    public Socket createSocket(final String host, final int port)
-    throws UnknownHostException, IOException
-    {
-        if (connProxy != null)
-        {
+    public Socket createSocket(final String host, final int port) throws UnknownHostException, IOException {
+        if (connProxy != null) {
             final Socket s = new Socket(connProxy);
             s.connect(new InetSocketAddress(host, port));
             return s;
@@ -202,24 +170,19 @@ public class DefaultSocketFactory extends SocketFactory
     }
 
     /**
-     * Creates a Socket connected to the given host and port and
-     * originating from the specified local address and port.
+     * Creates a Socket connected to the given host and port and originating from the specified local address and port.
      *
-     * @param host The hostname to connect to.
-     * @param port The port to connect to.
-     * @param localAddr  The local address to use.
-     * @param localPort  The local port to use.
+     * @param host      The hostname to connect to.
+     * @param port      The port to connect to.
+     * @param localAddr The local address to use.
+     * @param localPort The local port to use.
      * @return A Socket connected to the given host and port.
-     * @throws UnknownHostException  If the hostname cannot be resolved.
-     * @throws IOException If an I/O error occurs while creating the Socket.
+     * @throws UnknownHostException If the hostname cannot be resolved.
+     * @throws IOException          If an I/O error occurs while creating the Socket.
      */
     @Override
-    public Socket createSocket(final String host, final int port,
-                               final InetAddress localAddr, final int localPort)
-    throws UnknownHostException, IOException
-    {
-        if (connProxy != null)
-        {
+    public Socket createSocket(final String host, final int port, final InetAddress localAddr, final int localPort) throws UnknownHostException, IOException {
+        if (connProxy != null) {
             final Socket s = new Socket(connProxy);
             s.bind(new InetSocketAddress(localAddr, localPort));
             s.connect(new InetSocketAddress(host, port));
diff --git a/src/main/java/org/apache/commons/net/MalformedServerReplyException.java b/src/main/java/org/apache/commons/net/MalformedServerReplyException.java
index f405ca9f..abe85744 100644
--- a/src/main/java/org/apache/commons/net/MalformedServerReplyException.java
+++ b/src/main/java/org/apache/commons/net/MalformedServerReplyException.java
@@ -20,35 +20,28 @@ package org.apache.commons.net;
 import java.io.IOException;
 
 /**
- * This exception is used to indicate that the reply from a server
- * could not be interpreted.  Most of the NetComponents classes attempt
- * to be as lenient as possible when receiving server replies.  Many
- * server implementations deviate from IETF protocol specifications, making
- * it necessary to be as flexible as possible.  However, there will be
- * certain situations where it is not possible to continue an operation
- * because the server reply could not be interpreted in a meaningful manner.
- * In these cases, a MalformedServerReplyException should be thrown.
+ * This exception is used to indicate that the reply from a server could not be interpreted. Most of the NetComponents classes attempt to be as lenient as
+ * possible when receiving server replies. Many server implementations deviate from IETF protocol specifications, making it necessary to be as flexible as
+ * possible. However, there will be certain situations where it is not possible to continue an operation because the server reply could not be interpreted in a
+ * meaningful manner. In these cases, a MalformedServerReplyException should be thrown.
  *
  *
  */
 
-public class MalformedServerReplyException extends IOException
-{
+public class MalformedServerReplyException extends IOException {
 
     private static final long serialVersionUID = 6006765264250543945L;
 
     /** Constructs a MalformedServerReplyException with no message */
-    public MalformedServerReplyException()
-    {
+    public MalformedServerReplyException() {
     }
 
     /**
      * Constructs a MalformedServerReplyException with a specified message.
      *
-     * @param message  The message explaining the reason for the exception.
+     * @param message The message explaining the reason for the exception.
      */
-    public MalformedServerReplyException(final String message)
-    {
+    public MalformedServerReplyException(final String message) {
         super(message);
     }
 
diff --git a/src/main/java/org/apache/commons/net/PrintCommandListener.java b/src/main/java/org/apache/commons/net/PrintCommandListener.java
index c3f4d76d..364eeae2 100644
--- a/src/main/java/org/apache/commons/net/PrintCommandListener.java
+++ b/src/main/java/org/apache/commons/net/PrintCommandListener.java
@@ -21,15 +21,13 @@ import java.io.PrintStream;
 import java.io.PrintWriter;
 
 /**
- * This is a support class for some of the example programs.  It is
- * a sample implementation of the ProtocolCommandListener interface
- * which just prints out to a specified stream all command/reply traffic.
+ * This is a support class for some of the example programs. It is a sample implementation of the ProtocolCommandListener interface which just prints out to a
+ * specified stream all command/reply traffic.
  *
  * @since 2.0
  */
 
-public class PrintCommandListener implements ProtocolCommandListener
-{
+public class PrintCommandListener implements ProtocolCommandListener {
     private final PrintWriter writer;
     private final boolean nologin;
     private final char eolMarker;
@@ -38,20 +36,17 @@ public class PrintCommandListener implements ProtocolCommandListener
     /**
      * Create the default instance which prints everything.
      *
-     * @param stream where to write the commands and responses
-     * e.g. System.out
+     * @param stream where to write the commands and responses e.g. System.out
      * @since 3.0
      */
-    public PrintCommandListener(final PrintStream stream)
-    {
+    public PrintCommandListener(final PrintStream stream) {
         this(new PrintWriter(stream));
     }
 
     /**
-     * Create an instance which optionally suppresses login command text
-     * and indicates where the EOL starts with the specified character.
+     * Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      *
-     * @param stream where to write the commands and responses
+     * @param stream        where to write the commands and responses
      * @param suppressLogin if {@code true}, only print command name for login
      *
      * @since 3.0
@@ -61,12 +56,11 @@ public class PrintCommandListener implements ProtocolCommandListener
     }
 
     /**
-     * Create an instance which optionally suppresses login command text
-     * and indicates where the EOL starts with the specified character.
+     * Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      *
-     * @param stream where to write the commands and responses
+     * @param stream        where to write the commands and responses
      * @param suppressLogin if {@code true}, only print command name for login
-     * @param eolMarker if non-zero, add a marker just before the EOL.
+     * @param eolMarker     if non-zero, add a marker just before the EOL.
      *
      * @since 3.0
      */
@@ -75,18 +69,16 @@ public class PrintCommandListener implements ProtocolCommandListener
     }
 
     /**
-     * Create an instance which optionally suppresses login command text
-     * and indicates where the EOL starts with the specified character.
+     * Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      *
-     * @param stream where to write the commands and responses
+     * @param stream        where to write the commands and responses
      * @param suppressLogin if {@code true}, only print command name for login
-     * @param eolMarker if non-zero, add a marker just before the EOL.
+     * @param eolMarker     if non-zero, add a marker just before the EOL.
      * @param showDirection if {@code true}, add {@code "> "} or {@code "< "} as appropriate to the output
      *
      * @since 3.0
      */
-    public PrintCommandListener(final PrintStream stream, final boolean suppressLogin, final char eolMarker,
-            final boolean showDirection) {
+    public PrintCommandListener(final PrintStream stream, final boolean suppressLogin, final char eolMarker, final boolean showDirection) {
         this(new PrintWriter(stream), suppressLogin, eolMarker, showDirection);
     }
 
@@ -95,66 +87,60 @@ public class PrintCommandListener implements ProtocolCommandListener
      *
      * @param writer where to write the commands and responses
      */
-    public PrintCommandListener(final PrintWriter writer)
-    {
+    public PrintCommandListener(final PrintWriter writer) {
         this(writer, false);
     }
 
     /**
      * Create an instance which optionally suppresses login command text.
      *
-     * @param writer where to write the commands and responses
+     * @param writer        where to write the commands and responses
      * @param suppressLogin if {@code true}, only print command name for login
      *
      * @since 3.0
      */
-    public PrintCommandListener(final PrintWriter writer, final boolean suppressLogin)
-    {
+    public PrintCommandListener(final PrintWriter writer, final boolean suppressLogin) {
         this(writer, suppressLogin, (char) 0);
     }
 
     /**
-     * Create an instance which optionally suppresses login command text
-     * and indicates where the EOL starts with the specified character.
+     * Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      *
-     * @param writer where to write the commands and responses
+     * @param writer        where to write the commands and responses
      * @param suppressLogin if {@code true}, only print command name for login
-     * @param eolMarker if non-zero, add a marker just before the EOL.
+     * @param eolMarker     if non-zero, add a marker just before the EOL.
      *
      * @since 3.0
      */
-    public PrintCommandListener(final PrintWriter writer, final boolean suppressLogin, final char eolMarker)
-    {
+    public PrintCommandListener(final PrintWriter writer, final boolean suppressLogin, final char eolMarker) {
         this(writer, suppressLogin, eolMarker, false);
     }
 
     /**
-     * Create an instance which optionally suppresses login command text
-     * and indicates where the EOL starts with the specified character.
+     * Create an instance which optionally suppresses login command text and indicates where the EOL starts with the specified character.
      *
-     * @param writer where to write the commands and responses
+     * @param writer        where to write the commands and responses
      * @param suppressLogin if {@code true}, only print command name for login
-     * @param eolMarker if non-zero, add a marker just before the EOL.
+     * @param eolMarker     if non-zero, add a marker just before the EOL.
      * @param showDirection if {@code true}, add {@code ">} " or {@code "< "} as appropriate to the output
      *
      * @since 3.0
      */
-    public PrintCommandListener(final PrintWriter writer, final boolean suppressLogin, final char eolMarker,
-            final boolean showDirection) {
+    public PrintCommandListener(final PrintWriter writer, final boolean suppressLogin, final char eolMarker, final boolean showDirection) {
         this.writer = writer;
         this.nologin = suppressLogin;
         this.eolMarker = eolMarker;
         this.directionMarker = showDirection;
     }
 
-    private String getPrintableString(final String msg){
+    private String getPrintableString(final String msg) {
         if (eolMarker == 0) {
             return msg;
         }
         final int pos = msg.indexOf(SocketClient.NETASCII_EOL);
         if (pos > 0) {
             final StringBuilder sb = new StringBuilder();
-            sb.append(msg.substring(0,pos));
+            sb.append(msg.substring(0, pos));
             sb.append(eolMarker);
             sb.append(msg.substring(pos));
             return sb.toString();
@@ -163,8 +149,7 @@ public class PrintCommandListener implements ProtocolCommandListener
     }
 
     @Override
-    public void protocolCommandSent(final ProtocolCommandEvent event)
-    {
+    public void protocolCommandSent(final ProtocolCommandEvent event) {
         if (directionMarker) {
             writer.print("> ");
         }
@@ -177,7 +162,7 @@ public class PrintCommandListener implements ProtocolCommandListener
                 final String IMAP_LOGIN = "LOGIN";
                 if (IMAP_LOGIN.equalsIgnoreCase(cmd)) { // IMAP
                     String msg = event.getMessage();
-                    msg=msg.substring(0, msg.indexOf(IMAP_LOGIN)+IMAP_LOGIN.length());
+                    msg = msg.substring(0, msg.indexOf(IMAP_LOGIN) + IMAP_LOGIN.length());
                     writer.print(msg);
                     writer.println(" *******"); // Don't bother with EOL marker for this!
                 } else {
@@ -191,8 +176,7 @@ public class PrintCommandListener implements ProtocolCommandListener
     }
 
     @Override
-    public void protocolReplyReceived(final ProtocolCommandEvent event)
-    {
+    public void protocolReplyReceived(final ProtocolCommandEvent event) {
         if (directionMarker) {
             writer.print("< ");
         }
@@ -200,4 +184,3 @@ public class PrintCommandListener implements ProtocolCommandListener
         writer.flush();
     }
 }
-
diff --git a/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java b/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
index 5cb74919..7330cf8c 100644
--- a/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
+++ b/src/main/java/org/apache/commons/net/ProtocolCommandEvent.java
@@ -16,24 +16,20 @@
  */
 
 package org.apache.commons.net;
+
 import java.util.EventObject;
 
 /**
- * There exists a large class of IETF protocols that work by sending an
- * ASCII text command and arguments to a server, and then receiving an
- * ASCII text reply.  For debugging and other purposes, it is extremely
- * useful to log or keep track of the contents of the protocol messages.
- * The ProtocolCommandEvent class coupled with the
- * {@link org.apache.commons.net.ProtocolCommandListener}
- *  interface facilitate this process.
+ * There exists a large class of IETF protocols that work by sending an ASCII text command and arguments to a server, and then receiving an ASCII text reply.
+ * For debugging and other purposes, it is extremely useful to log or keep track of the contents of the protocol messages. The ProtocolCommandEvent class
+ * coupled with the {@link org.apache.commons.net.ProtocolCommandListener} interface facilitate this process.
  *
  *
  * @see ProtocolCommandListener
  * @see ProtocolCommandSupport
  */
 
-public class ProtocolCommandEvent extends EventObject
-{
+public class ProtocolCommandEvent extends EventObject {
     private static final long serialVersionUID = 403743538418947240L;
 
     private final int replyCode;
@@ -41,21 +37,16 @@ public class ProtocolCommandEvent extends EventObject
     private final String message, command;
 
     /**
-     * Creates a ProtocolCommandEvent signalling a reply to a command was
-     * received.  ProtocolCommandEvents created with this constructor
-     * should only be sent after a complete command reply has been received
-     * fromt a server.
+     * Creates a ProtocolCommandEvent signalling a reply to a command was received. ProtocolCommandEvents created with this constructor should only be sent
+     * after a complete command reply has been received fromt a server.
      *
-     * @param source  The source of the event.
-     * @param replyCode The integer code indicating the natureof the reply.
-     *   This will be the protocol integer value for protocols
-     *   that use integer reply codes, or the reply class constant
-     *   corresponding to the reply for protocols like POP3 that use
-     *   strings like OK rather than integer codes (i.e., POP3Repy.OK).
-     * @param message The entire reply as received from the server.
+     * @param source    The source of the event.
+     * @param replyCode The integer code indicating the natureof the reply. This will be the protocol integer value for protocols that use integer reply codes,
+     *                  or the reply class constant corresponding to the reply for protocols like POP3 that use strings like OK rather than integer codes (i.e.,
+     *                  POP3Repy.OK).
+     * @param message   The entire reply as received from the server.
      */
-    public ProtocolCommandEvent(final Object source, final int replyCode, final String message)
-    {
+    public ProtocolCommandEvent(final Object source, final int replyCode, final String message) {
         super(source);
         this.replyCode = replyCode;
         this.message = message;
@@ -63,21 +54,15 @@ public class ProtocolCommandEvent extends EventObject
         this.command = null;
     }
 
-
     /**
-     * Creates a ProtocolCommandEvent signalling a command was sent to
-     * the server.  ProtocolCommandEvents created with this constructor
-     * should only be sent after a command has been sent, but before the
-     * reply has been received.
+     * Creates a ProtocolCommandEvent signalling a command was sent to the server. ProtocolCommandEvents created with this constructor should only be sent after
+     * a command has been sent, but before the reply has been received.
      *
      * @param source  The source of the event.
-     * @param command The string representation of the command type sent, not
-     *      including the arguments (e.g., "STAT" or "GET").
-     * @param message The entire command string verbatim as sent to the server,
-     *        including all arguments.
+     * @param command The string representation of the command type sent, not including the arguments (e.g., "STAT" or "GET").
+     * @param message The entire command string verbatim as sent to the server, including all arguments.
      */
-    public ProtocolCommandEvent(final Object source, final String command, final String message)
-    {
+    public ProtocolCommandEvent(final Object source, final String command, final String message) {
         super(source);
         this.replyCode = 0;
         this.message = message;
@@ -86,63 +71,47 @@ public class ProtocolCommandEvent extends EventObject
     }
 
     /**
-     * Returns the string representation of the command type sent (e.g., "STAT"
-     * or "GET").  If the ProtocolCommandEvent is a reply event, then null
-     * is returned.
+     * Returns the string representation of the command type sent (e.g., "STAT" or "GET"). If the ProtocolCommandEvent is a reply event, then null is returned.
      *
-     * @return The string representation of the command type sent, or null
-     *         if this is a reply event.
+     * @return The string representation of the command type sent, or null if this is a reply event.
      */
-    public String getCommand()
-    {
+    public String getCommand() {
         return command;
     }
 
-
     /**
-     * Returns the entire message sent to or received from the server.
-     * Includes the line terminator.
+     * Returns the entire message sent to or received from the server. Includes the line terminator.
      *
      * @return The entire message sent to or received from the server.
      */
-    public String getMessage()
-    {
+    public String getMessage() {
         return message;
     }
 
     /**
-     * Returns the reply code of the received server reply.  Undefined if
-     * this is not a reply event.
+     * Returns the reply code of the received server reply. Undefined if this is not a reply event.
      *
-     * @return The reply code of the received server reply.  Undefined if
-     *         not a reply event.
+     * @return The reply code of the received server reply. Undefined if not a reply event.
      */
-    public int getReplyCode()
-    {
+    public int getReplyCode() {
         return replyCode;
     }
 
     /**
-     * Returns true if the ProtocolCommandEvent was generated as a result
-     * of sending a command.
+     * Returns true if the ProtocolCommandEvent was generated as a result of sending a command.
      *
-     * @return true If the ProtocolCommandEvent was generated as a result
-     * of sending a command.  False otherwise.
+     * @return true If the ProtocolCommandEvent was generated as a result of sending a command. False otherwise.
      */
-    public boolean isCommand()
-    {
+    public boolean isCommand() {
         return isCommand;
     }
 
     /**
-     * Returns true if the ProtocolCommandEvent was generated as a result
-     * of receiving a reply.
+     * Returns true if the ProtocolCommandEvent was generated as a result of receiving a reply.
      *
-     * @return true If the ProtocolCommandEvent was generated as a result
-     * of receiving a reply.  False otherwise.
+     * @return true If the ProtocolCommandEvent was generated as a result of receiving a reply. False otherwise.
      */
-    public boolean isReply()
-    {
+    public boolean isReply() {
         return !isCommand();
     }
 }
diff --git a/src/main/java/org/apache/commons/net/ProtocolCommandListener.java b/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
index 19db6169..36f06a24 100644
--- a/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
+++ b/src/main/java/org/apache/commons/net/ProtocolCommandListener.java
@@ -16,40 +16,33 @@
  */
 
 package org.apache.commons.net;
+
 import java.util.EventListener;
 
 /**
- * There exists a large class of IETF protocols that work by sending an
- * ASCII text command and arguments to a server, and then receiving an
- * ASCII text reply.  For debugging and other purposes, it is extremely
- * useful to log or keep track of the contents of the protocol messages.
- * The ProtocolCommandListener interface coupled with the
- * {@link ProtocolCommandEvent} class facilitate this process.
+ * There exists a large class of IETF protocols that work by sending an ASCII text command and arguments to a server, and then receiving an ASCII text reply.
+ * For debugging and other purposes, it is extremely useful to log or keep track of the contents of the protocol messages. The ProtocolCommandListener interface
+ * coupled with the {@link ProtocolCommandEvent} class facilitate this process.
  * <p>
- * To receive ProtocolCommandEvents, you merely implement the
- * ProtocolCommandListener interface and register the class as a listener
- * with a ProtocolCommandEvent source such as
- * {@link org.apache.commons.net.ftp.FTPClient}.
+ * To receive ProtocolCommandEvents, you merely implement the ProtocolCommandListener interface and register the class as a listener with a ProtocolCommandEvent
+ * source such as {@link org.apache.commons.net.ftp.FTPClient}.
  *
  *
  * @see ProtocolCommandEvent
  * @see ProtocolCommandSupport
  */
 
-public interface ProtocolCommandListener extends EventListener
-{
+public interface ProtocolCommandListener extends EventListener {
 
     /**
-     * This method is invoked by a ProtocolCommandEvent source after
-     * sending a protocol command to a server.
+     * This method is invoked by a ProtocolCommandEvent source after sending a protocol command to a server.
      *
      * @param event The ProtocolCommandEvent fired.
      */
     void protocolCommandSent(ProtocolCommandEvent event);
 
     /**
-     * This method is invoked by a ProtocolCommandEvent source after
-     * receiving a reply from a server.
+     * This method is invoked by a ProtocolCommandEvent source after receiving a reply from a server.
      *
      * @param event The ProtocolCommandEvent fired.
      */
diff --git a/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java b/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
index 0e842007..869748c5 100644
--- a/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
+++ b/src/main/java/org/apache/commons/net/ProtocolCommandSupport.java
@@ -24,90 +24,71 @@ import java.util.EventListener;
 import org.apache.commons.net.util.ListenerList;
 
 /**
- * ProtocolCommandSupport is a convenience class for managing a list of
- * ProtocolCommandListeners and firing ProtocolCommandEvents.  You can
- * simply delegate ProtocolCommandEvent firing and listener
- * registering/unregistering tasks to this class.
+ * ProtocolCommandSupport is a convenience class for managing a list of ProtocolCommandListeners and firing ProtocolCommandEvents. You can simply delegate
+ * ProtocolCommandEvent firing and listener registering/unregistering tasks to this class.
  *
  *
  * @see ProtocolCommandEvent
  * @see ProtocolCommandListener
  */
 
-public class ProtocolCommandSupport implements Serializable
-{
+public class ProtocolCommandSupport implements Serializable {
     private static final long serialVersionUID = -8017692739988399978L;
 
     private final Object source;
     private final ListenerList listeners;
 
     /**
-     * Creates a ProtocolCommandSupport instance using the indicated source
-     * as the source of ProtocolCommandEvents.
+     * Creates a ProtocolCommandSupport instance using the indicated source as the source of ProtocolCommandEvents.
      *
-     * @param source  The source to use for all generated ProtocolCommandEvents.
+     * @param source The source to use for all generated ProtocolCommandEvents.
      */
-    public ProtocolCommandSupport(final Object source)
-    {
+    public ProtocolCommandSupport(final Object source) {
         this.listeners = new ListenerList();
         this.source = source;
     }
 
-
     /**
      * Adds a ProtocolCommandListener.
      *
-     * @param listener  The ProtocolCommandListener to add.
+     * @param listener The ProtocolCommandListener to add.
      */
-    public void addProtocolCommandListener(final ProtocolCommandListener listener)
-    {
+    public void addProtocolCommandListener(final ProtocolCommandListener listener) {
         listeners.addListener(listener);
     }
 
     /**
-     * Fires a ProtocolCommandEvent signalling the sending of a command to all
-     * registered listeners, invoking their
-     * {@link org.apache.commons.net.ProtocolCommandListener#protocolCommandSent protocolCommandSent() }
-     *  methods.
+     * Fires a ProtocolCommandEvent signalling the sending of a command to all registered listeners, invoking their
+     * {@link org.apache.commons.net.ProtocolCommandListener#protocolCommandSent protocolCommandSent() } methods.
      *
-     * @param command The string representation of the command type sent, not
-     *      including the arguments (e.g., "STAT" or "GET").
-     * @param message The entire command string verbatim as sent to the server,
-     *        including all arguments.
+     * @param command The string representation of the command type sent, not including the arguments (e.g., "STAT" or "GET").
+     * @param message The entire command string verbatim as sent to the server, including all arguments.
      */
-    public void fireCommandSent(final String command, final String message)
-    {
+    public void fireCommandSent(final String command, final String message) {
         final ProtocolCommandEvent event;
 
         event = new ProtocolCommandEvent(source, command, message);
 
-        for (final EventListener listener : listeners)
-        {
-           ((ProtocolCommandListener)listener).protocolCommandSent(event);
+        for (final EventListener listener : listeners) {
+            ((ProtocolCommandListener) listener).protocolCommandSent(event);
         }
     }
 
     /**
-     * Fires a ProtocolCommandEvent signalling the reception of a command reply
-     * to all registered listeners, invoking their
-     * {@link org.apache.commons.net.ProtocolCommandListener#protocolReplyReceived protocolReplyReceived() }
-     *  methods.
+     * Fires a ProtocolCommandEvent signalling the reception of a command reply to all registered listeners, invoking their
+     * {@link org.apache.commons.net.ProtocolCommandListener#protocolReplyReceived protocolReplyReceived() } methods.
      *
-     * @param replyCode The integer code indicating the natureof the reply.
-     *   This will be the protocol integer value for protocols
-     *   that use integer reply codes, or the reply class constant
-     *   corresponding to the reply for protocols like POP3 that use
-     *   strings like OK rather than integer codes (i.e., POP3Repy.OK).
-     * @param message The entire reply as received from the server.
+     * @param replyCode The integer code indicating the natureof the reply. This will be the protocol integer value for protocols that use integer reply codes,
+     *                  or the reply class constant corresponding to the reply for protocols like POP3 that use strings like OK rather than integer codes (i.e.,
+     *                  POP3Repy.OK).
+     * @param message   The entire reply as received from the server.
      */
-    public void fireReplyReceived(final int replyCode, final String message)
-    {
+    public void fireReplyReceived(final int replyCode, final String message) {
         final ProtocolCommandEvent event;
         event = new ProtocolCommandEvent(source, replyCode, message);
 
-        for (final EventListener listener : listeners)
-        {
-            ((ProtocolCommandListener)listener).protocolReplyReceived(event);
+        for (final EventListener listener : listeners) {
+            ((ProtocolCommandListener) listener).protocolReplyReceived(event);
         }
     }
 
@@ -116,34 +97,28 @@ public class ProtocolCommandSupport implements Serializable
      *
      * @return The number of ProtocolCommandListeners currently registered.
      */
-    public int getListenerCount()
-    {
+    public int getListenerCount() {
         return listeners.getListenerCount();
     }
 
-
     /**
      * Removes a ProtocolCommandListener.
      *
-     * @param listener  The ProtocolCommandListener to remove.
+     * @param listener The ProtocolCommandListener to remove.
      */
-    public void removeProtocolCommandListener(final ProtocolCommandListener listener)
-    {
+    public void removeProtocolCommandListener(final ProtocolCommandListener listener) {
         listeners.removeListener(listener);
     }
 
     /*
-        Serialization is unnecessary for this class.
-        Reject attempts to do so until such time as the Serializable attribute can be dropped.
+     * Serialization is unnecessary for this class. Reject attempts to do so until such time as the Serializable attribute can be dropped.
      */
 
-    private void writeObject(final java.io.ObjectOutputStream out) throws IOException
-    {
+    private void writeObject(final java.io.ObjectOutputStream out) throws IOException {
         throw new UnsupportedOperationException("Serialization is not supported");
     }
 
-    private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
-    {
+    private void readObject(final java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
         throw new UnsupportedOperationException("Serialization is not supported");
     }
 
diff --git a/src/main/java/org/apache/commons/net/SocketClient.java b/src/main/java/org/apache/commons/net/SocketClient.java
index f3037d3a..a1291baa 100644
--- a/src/main/java/org/apache/commons/net/SocketClient.java
+++ b/src/main/java/org/apache/commons/net/SocketClient.java
@@ -31,49 +31,34 @@ import java.nio.charset.Charset;
 import javax.net.ServerSocketFactory;
 import javax.net.SocketFactory;
 
-
 /**
- * The SocketClient provides the basic operations that are required of
- * client objects accessing sockets.  It is meant to be
- * subclassed to avoid having to rewrite the same code over and over again
- * to open a socket, close a socket, set timeouts, etc.  Of special note
- * is the {@link #setSocketFactory  setSocketFactory }
- * method, which allows you to control the type of Socket the SocketClient
- * creates for initiating network connections.  This is especially useful
- * for adding SSL or proxy support as well as better support for applets.  For
- * example, you could create a
- * {@link javax.net.SocketFactory} that
- * requests browser security capabilities before creating a socket.
- * All classes derived from SocketClient should use the
- * {@link #_socketFactory_  _socketFactory_ } member variable to
- * create Socket and ServerSocket instances rather than instantiating
- * them by directly invoking a constructor.  By honoring this contract
- * you guarantee that a user will always be able to provide his own
- * Socket implementations by substituting his own SocketFactory.
+ * The SocketClient provides the basic operations that are required of client objects accessing sockets. It is meant to be subclassed to avoid having to rewrite
+ * the same code over and over again to open a socket, close a socket, set timeouts, etc. Of special note is the {@link #setSocketFactory setSocketFactory }
+ * method, which allows you to control the type of Socket the SocketClient creates for initiating network connections. This is especially useful for adding SSL
+ * or proxy support as well as better support for applets. For example, you could create a {@link javax.net.SocketFactory} that requests browser security
+ * capabilities before creating a socket. All classes derived from SocketClient should use the {@link #_socketFactory_ _socketFactory_ } member variable to
+ * create Socket and ServerSocket instances rather than instantiating them by directly invoking a constructor. By honoring this contract you guarantee that a
+ * user will always be able to provide his own Socket implementations by substituting his own SocketFactory.
+ *
  * @see SocketFactory
  */
-public abstract class SocketClient
-{
+public abstract class SocketClient {
     /**
-     * The end of line character sequence used by most IETF protocols.  That
-     * is a carriage return followed by a newline: "\r\n"
+     * The end of line character sequence used by most IETF protocols. That is a carriage return followed by a newline: "\r\n"
      */
     public static final String NETASCII_EOL = "\r\n";
 
     /** The default SocketFactory shared by all SocketClient instances. */
-    private static final SocketFactory DEFAULT_SOCKET_FACTORY =
-            SocketFactory.getDefault();
+    private static final SocketFactory DEFAULT_SOCKET_FACTORY = SocketFactory.getDefault();
 
     /** The default {@link ServerSocketFactory} */
-    private static final ServerSocketFactory DEFAULT_SERVER_SOCKET_FACTORY =
-            ServerSocketFactory.getDefault();
+    private static final ServerSocketFactory DEFAULT_SERVER_SOCKET_FACTORY = ServerSocketFactory.getDefault();
 
     /** The socket's connect timeout (0 = infinite timeout) */
     private static final int DEFAULT_CONNECT_TIMEOUT = 60000;
 
     /**
-     * A ProtocolCommandSupport object used to manage the registering of
-     * ProtocolCommandListeners and the firing of ProtocolCommandEvents.
+     * A ProtocolCommandSupport object used to manage the registering of ProtocolCommandListeners and the firing of ProtocolCommandEvents.
      */
     private ProtocolCommandSupport commandSupport;
 
@@ -118,14 +103,10 @@ public abstract class SocketClient
     private Charset charset = Charset.defaultCharset();
 
     /**
-     * Default constructor for SocketClient.  Initializes
-     * _socket_ to null, _timeout_ to 0, _defaultPort to 0,
-     * _isConnected_ to false, charset to {@code Charset.defaultCharset()}
-     * and _socketFactory_ to a shared instance of
-     * {@link org.apache.commons.net.DefaultSocketFactory}.
+     * Default constructor for SocketClient. Initializes _socket_ to null, _timeout_ to 0, _defaultPort to 0, _isConnected_ to false, charset to
+     * {@code Charset.defaultCharset()} and _socketFactory_ to a shared instance of {@link org.apache.commons.net.DefaultSocketFactory}.
      */
-    public SocketClient()
-    {
+    public SocketClient() {
         _socket_ = null;
         _hostname_ = null;
         _input_ = null;
@@ -136,11 +117,8 @@ public abstract class SocketClient
         _serverSocketFactory_ = DEFAULT_SERVER_SOCKET_FACTORY;
     }
 
-
     // helper method to allow code to be shared with connect(String,...) methods
-    private void _connect(final InetAddress host, final int port, final InetAddress localAddr, final int localPort)
-        throws SocketException, IOException
-    {
+    private void _connect(final InetAddress host, final int port, final InetAddress localAddr, final int localPort) throws SocketException, IOException {
         _socket_ = _socketFactory_.createSocket();
         if (receiveBufferSize != -1) {
             _socket_.setReceiveBufferSize(receiveBufferSize);
@@ -156,24 +134,19 @@ public abstract class SocketClient
     }
 
     /**
-     * Because there are so many connect() methods, the _connectAction_()
-     * method is provided as a means of performing some action immediately
-     * after establishing a connection, rather than reimplementing all
-     * of the connect() methods.  The last action performed by every
-     * connect() method after opening a socket is to call this method.
+     * Because there are so many connect() methods, the _connectAction_() method is provided as a means of performing some action immediately after establishing
+     * a connection, rather than reimplementing all of the connect() methods. The last action performed by every connect() method after opening a socket is to
+     * call this method.
      * <p>
-     * This method sets the timeout on the just opened socket to the default
-     * timeout set by {@link #setDefaultTimeout  setDefaultTimeout() },
-     * sets _input_ and _output_ to the socket's InputStream and OutputStream
-     * respectively, and sets _isConnected_ to true.
+     * This method sets the timeout on the just opened socket to the default timeout set by {@link #setDefaultTimeout setDefaultTimeout() }, sets _input_ and
+     * _output_ to the socket's InputStream and OutputStream respectively, and sets _isConnected_ to true.
      * <p>
-     * Subclasses overriding this method should start by calling
-     * <code> super._connectAction_() </code> first to ensure the
-     * initialization of the aforementioned protected variables.
+     * Subclasses overriding this method should start by calling <code> super._connectAction_() </code> first to ensure the initialization of the aforementioned
+     * protected variables.
+     *
      * @throws IOException (SocketException) if a problem occurs with the socket
      */
-    protected void _connectAction_() throws IOException
-    {
+    protected void _connectAction_() throws IOException {
         applySocketAttributes();
         _input_ = _socket_.getInputStream();
         _output_ = _socket_.getOutputStream();
@@ -182,7 +155,7 @@ public abstract class SocketClient
     /**
      * Adds a ProtocolCommandListener.
      *
-     * @param listener  The ProtocolCommandListener to add.
+     * @param listener The ProtocolCommandListener to add.
      * @since 3.0
      */
     public void addProtocolCommandListener(final ProtocolCommandListener listener) {
@@ -199,9 +172,8 @@ public abstract class SocketClient
         _socket_.setSoTimeout(_timeout_);
     }
 
-
-    private void closeQuietly(final Closeable close){
-        if (close != null){
+    private void closeQuietly(final Closeable close) {
+        if (close != null) {
             try {
                 close.close();
             } catch (final IOException e) {
@@ -211,7 +183,7 @@ public abstract class SocketClient
     }
 
     private void closeQuietly(final Socket socket) {
-        if (socket != null){
+        if (socket != null) {
             try {
                 socket.close();
             } catch (final IOException e) {
@@ -221,150 +193,113 @@ public abstract class SocketClient
     }
 
     /**
-     * Opens a Socket connected to a remote host at the current default port
-     * and originating from the current host at a system assigned port.
-     * Before returning, {@link #_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the current default port and originating from the current host at a system assigned port. Before returning,
+     * {@link #_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
-     * @param host  The remote host.
+     * @param host The remote host.
      * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @throws IOException     If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from
+     *                         it.
      */
-    public void connect(final InetAddress host) throws SocketException, IOException
-    {
+    public void connect(final InetAddress host) throws SocketException, IOException {
         _hostname_ = null;
         connect(host, _defaultPort_);
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the current host at a system assigned port.
-     * Before returning, {@link #_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the current host at a system assigned port. Before returning,
+     * {@link #_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
-     * @param host  The remote host.
-     * @param port  The port to connect to on the remote host.
+     * @param host The remote host.
+     * @param port The port to connect to on the remote host.
      * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @throws IOException     If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from
+     *                         it.
      */
-    public void connect(final InetAddress host, final int port)
-    throws SocketException, IOException
-    {
+    public void connect(final InetAddress host, final int port) throws SocketException, IOException {
         _hostname_ = null;
         _connect(host, port, null, -1);
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the specified local address and port.
-     * Before returning, {@link #_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the specified local address and port. Before returning,
+     * {@link #_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
-     * @param host  The remote host.
-     * @param port  The port to connect to on the remote host.
-     * @param localAddr  The local address to use.
-     * @param localPort  The local port to use.
+     * @param host      The remote host.
+     * @param port      The port to connect to on the remote host.
+     * @param localAddr The local address to use.
+     * @param localPort The local port to use.
      * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
-     */
-    public void connect(final InetAddress host, final int port,
-                        final InetAddress localAddr, final int localPort)
-    throws SocketException, IOException
-    {
+     * @throws IOException     If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from
+     *                         it.
+     */
+    public void connect(final InetAddress host, final int port, final InetAddress localAddr, final int localPort) throws SocketException, IOException {
         _hostname_ = null;
         _connect(host, port, localAddr, localPort);
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the current default
-     * port and originating from the current host at a system assigned port.
-     * Before returning, {@link #_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the current default port and originating from the current host at a system assigned port. Before returning,
+     * {@link #_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
-     * @param hostname  The name of the remote host.
-     * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @param hostname The name of the remote host.
+     * @throws SocketException               If the socket timeout could not be set.
+     * @throws IOException                   If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is
+     *                                       derived from it.
      * @throws java.net.UnknownHostException If the hostname cannot be resolved.
      */
-    public void connect(final String hostname) throws SocketException, IOException
-    {
+    public void connect(final String hostname) throws SocketException, IOException {
         connect(hostname, _defaultPort_);
     }
 
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the current host at a system assigned port.
-     * Before returning, {@link #_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the current host at a system assigned port. Before returning,
+     * {@link #_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
-     * @param hostname  The name of the remote host.
-     * @param port  The port to connect to on the remote host.
-     * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @param hostname The name of the remote host.
+     * @param port     The port to connect to on the remote host.
+     * @throws SocketException               If the socket timeout could not be set.
+     * @throws IOException                   If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is
+     *                                       derived from it.
      * @throws java.net.UnknownHostException If the hostname cannot be resolved.
      */
-    public void connect(final String hostname, final int port)
-    throws SocketException, IOException
-    {
+    public void connect(final String hostname, final int port) throws SocketException, IOException {
         _hostname_ = hostname;
         _connect(InetAddress.getByName(hostname), port, null, -1);
     }
 
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the specified local address and port.
-     * Before returning, {@link #_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the specified local address and port. Before returning,
+     * {@link #_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
      * @param hostname  The name of the remote host.
-     * @param port  The port to connect to on the remote host.
-     * @param localAddr  The local address to use.
-     * @param localPort  The local port to use.
-     * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @param port      The port to connect to on the remote host.
+     * @param localAddr The local address to use.
+     * @param localPort The local port to use.
+     * @throws SocketException               If the socket timeout could not be set.
+     * @throws IOException                   If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is
+     *                                       derived from it.
      * @throws java.net.UnknownHostException If the hostname cannot be resolved.
      */
-    public void connect(final String hostname, final int port,
-                        final InetAddress localAddr, final int localPort)
-    throws SocketException, IOException
-    {
+    public void connect(final String hostname, final int port, final InetAddress localAddr, final int localPort) throws SocketException, IOException {
         _hostname_ = hostname;
-       _connect(InetAddress.getByName(hostname), port, localAddr, localPort);
+        _connect(InetAddress.getByName(hostname), port, localAddr, localPort);
     }
+
     /**
      * Create the CommandSupport instance if required
      */
-    protected void createCommandSupport(){
+    protected void createCommandSupport() {
         commandSupport = new ProtocolCommandSupport(this);
     }
 
     /**
-     * Disconnects the socket connection.
-     * You should call this method after you've finished using the class
-     * instance and also before you call
-     * {@link #connect connect() }
-     * again.  _isConnected_ is set to false, _socket_ is set to null,
-     * _input_ is set to null, and _output_ is set to null.
+     * Disconnects the socket connection. You should call this method after you've finished using the class instance and also before you call {@link #connect
+     * connect() } again. _isConnected_ is set to false, _socket_ is set to null, _input_ is set to null, and _output_ is set to null.
      *
-     * @throws IOException  If there is an error closing the socket.
+     * @throws IOException If there is an error closing the socket.
      */
-    public void disconnect() throws IOException
-    {
+    public void disconnect() throws IOException {
         closeQuietly(_socket_);
         closeQuietly(_input_);
         closeQuietly(_output_);
@@ -391,7 +326,7 @@ public abstract class SocketClient
      * If there are any listeners, send them the reply details.
      *
      * @param replyCode the code extracted from the reply
-     * @param reply the full reply text
+     * @param reply     the full reply text
      * @since 3.0
      */
     protected void fireReplyReceived(final int replyCode, final String reply) {
@@ -400,7 +335,6 @@ public abstract class SocketClient
         }
     }
 
-
     /**
      * Gets the charset.
      *
@@ -411,7 +345,6 @@ public abstract class SocketClient
         return charset;
     }
 
-
     /**
      * Gets the charset name.
      *
@@ -424,10 +357,8 @@ public abstract class SocketClient
         return charset.name();
     }
 
-
     /**
-     * Subclasses can override this if they need to provide their own
-     * instance field for backwards compatibilty.
+     * Subclasses can override this if they need to provide their own instance field for backwards compatibilty.
      *
      * @return the CommandSupport instance, may be {@code null}
      * @since 3.0
@@ -436,9 +367,9 @@ public abstract class SocketClient
         return commandSupport;
     }
 
-
     /**
      * Get the underlying socket connection timeout.
+     *
      * @return timeout (in ms)
      * @since 2.0
      */
@@ -447,33 +378,28 @@ public abstract class SocketClient
     }
 
     /**
-     * Returns the current value of the default port (stored in
-     * {@link #_defaultPort_  _defaultPort_ }).
+     * Returns the current value of the default port (stored in {@link #_defaultPort_ _defaultPort_ }).
      *
      * @return The current value of the default port.
      */
-    public int getDefaultPort()
-    {
+    public int getDefaultPort() {
         return _defaultPort_;
     }
 
     /**
-     * Returns the default timeout in milliseconds that is used when
-     * opening a socket.
+     * Returns the default timeout in milliseconds that is used when opening a socket.
      *
-     * @return The default timeout in milliseconds that is used when
-     *         opening a socket.
+     * @return The default timeout in milliseconds that is used when opening a socket.
      */
-    public int getDefaultTimeout()
-    {
+    public int getDefaultTimeout() {
         return _timeout_;
     }
 
     /**
-     * Returns the current value of the SO_KEEPALIVE flag on the currently opened socket.
-     * Delegates to {@link Socket#getKeepAlive()}
+     * Returns the current value of the SO_KEEPALIVE flag on the currently opened socket. Delegates to {@link Socket#getKeepAlive()}
+     *
      * @return True if SO_KEEPALIVE is enabled.
-     * @throws SocketException if there is a problem with the socket
+     * @throws SocketException      if there is a problem with the socket
      * @throws NullPointerException if the socket is not currently open
      * @since 2.2
      */
@@ -482,34 +408,28 @@ public abstract class SocketClient
     }
 
     /**
-     * Returns the local address  to which the client's socket is bound.
-     * Delegates to {@link Socket#getLocalAddress()}
+     * Returns the local address to which the client's socket is bound. Delegates to {@link Socket#getLocalAddress()}
      *
      * @return The local address to which the client's socket is bound.
      * @throws NullPointerException if the socket is not currently open
      */
-    public InetAddress getLocalAddress()
-    {
+    public InetAddress getLocalAddress() {
         return _socket_.getLocalAddress();
     }
 
     /**
-     * Returns the port number of the open socket on the local host used
-     * for the connection.
-     * Delegates to {@link Socket#getLocalPort()}
+     * Returns the port number of the open socket on the local host used for the connection. Delegates to {@link Socket#getLocalPort()}
      *
-     * @return The port number of the open socket on the local host used
-     *         for the connection.
+     * @return The port number of the open socket on the local host used for the connection.
      * @throws NullPointerException if the socket is not currently open
      */
-    public int getLocalPort()
-    {
+    public int getLocalPort() {
         return _socket_.getLocalPort();
     }
 
-
     /**
      * Gets the proxy for use with all the connections.
+     *
      * @return the current proxy for connections.
      */
     public Proxy getProxy() {
@@ -518,50 +438,45 @@ public abstract class SocketClient
 
     /**
      * Get the current receivedBuffer size
+     *
      * @return the size, or -1 if not initialized
      * @since 3.0
      */
-    protected int getReceiveBufferSize(){
+    protected int getReceiveBufferSize() {
         return receiveBufferSize;
     }
 
     /**
-     * @return The remote address to which the client is connected.
-     * Delegates to {@link Socket#getInetAddress()}
+     * @return The remote address to which the client is connected. Delegates to {@link Socket#getInetAddress()}
      * @throws NullPointerException if the socket is not currently open
      */
-    public InetAddress getRemoteAddress()
-    {
+    public InetAddress getRemoteAddress() {
         return _socket_.getInetAddress();
     }
 
     /**
-     * Returns the port number of the remote host to which the client is
-     * connected.
-     * Delegates to {@link Socket#getPort()}
+     * Returns the port number of the remote host to which the client is connected. Delegates to {@link Socket#getPort()}
      *
-     * @return The port number of the remote host to which the client is
-     *         connected.
+     * @return The port number of the remote host to which the client is connected.
      * @throws NullPointerException if the socket is not currently open
      */
-    public int getRemotePort()
-    {
+    public int getRemotePort() {
         return _socket_.getPort();
     }
 
-
     /**
      * Get the current sendBuffer size
+     *
      * @return the size, or -1 if not initialized
      * @since 3.0
      */
-    protected int getSendBufferSize(){
+    protected int getSendBufferSize() {
         return sendBufferSize;
     }
 
-
     /**
      * Get the underlying {@link ServerSocketFactory}
+     *
      * @return The server socket factory
      * @since 2.2
      */
@@ -569,17 +484,14 @@ public abstract class SocketClient
         return _serverSocketFactory_;
     }
 
-
     /**
      * Returns the current SO_LINGER timeout of the currently opened socket.
      *
-     * @return The current SO_LINGER timeout.  If SO_LINGER is disabled returns
-     *         -1.
-     * @throws SocketException If the operation fails.
+     * @return The current SO_LINGER timeout. If SO_LINGER is disabled returns -1.
+     * @throws SocketException      If the operation fails.
      * @throws NullPointerException if the socket is not currently open
      */
-    public int getSoLinger() throws SocketException
-    {
+    public int getSoLinger() throws SocketException {
         return _socket_.getSoLinger();
     }
 
@@ -587,43 +499,35 @@ public abstract class SocketClient
      * Returns the timeout in milliseconds of the currently opened socket.
      *
      * @return The timeout in milliseconds of the currently opened socket.
-     * @throws SocketException If the operation fails.
+     * @throws SocketException      If the operation fails.
      * @throws NullPointerException if the socket is not currently open
      */
-    public int getSoTimeout() throws SocketException
-    {
+    public int getSoTimeout() throws SocketException {
         return _socket_.getSoTimeout();
     }
 
-
     /**
-     * Returns true if Nagle's algorithm is enabled on the currently opened
-     * socket.
+     * Returns true if Nagle's algorithm is enabled on the currently opened socket.
      *
-     * @return True if Nagle's algorithm is enabled on the currently opened
-     *        socket, false otherwise.
-     * @throws SocketException If the operation fails.
+     * @return True if Nagle's algorithm is enabled on the currently opened socket, false otherwise.
+     * @throws SocketException      If the operation fails.
      * @throws NullPointerException if the socket is not currently open
      */
-    public boolean getTcpNoDelay() throws SocketException
-    {
+    public boolean getTcpNoDelay() throws SocketException {
         return _socket_.getTcpNoDelay();
     }
 
-
     /**
-     * Make various checks on the socket to test if it is available for use.
-     * Note that the only sure test is to use it, but these checks may help
-     * in some cases.
+     * Make various checks on the socket to test if it is available for use. Note that the only sure test is to use it, but these checks may help in some cases.
+     *
      * @see <a href="https://issues.apache.org/jira/browse/NET-350">NET-350</a>
      * @return {@code true} if the socket appears to be available for use
      * @since 3.0
      */
     @SuppressWarnings("resource")
-    public boolean isAvailable(){
+    public boolean isAvailable() {
         if (isConnected()) {
-            try
-            {
+            try {
                 if (_socket_.getInetAddress() == null) {
                     return false;
                 }
@@ -636,9 +540,9 @@ public abstract class SocketClient
                 if (_socket_.isClosed()) {
                     return false;
                 }
-                /* these aren't exact checks (a Socket can be half-open),
-                   but since we usually require two-way data transfer,
-                   we check these here too: */
+                /*
+                 * these aren't exact checks (a Socket can be half-open), but since we usually require two-way data transfer, we check these here too:
+                 */
                 if (_socket_.isInputShutdown()) {
                     return false;
                 }
@@ -650,9 +554,7 @@ public abstract class SocketClient
                 _socket_.getInputStream();
                 // No need to close
                 _socket_.getOutputStream();
-            }
-            catch (final IOException ioex)
-            {
+            } catch (final IOException ioex) {
                 return false;
             }
             return true;
@@ -660,16 +562,14 @@ public abstract class SocketClient
         return false;
     }
 
-
     /**
      * Returns true if the client is currently connected to a server.
      *
      * Delegates to {@link Socket#isConnected()}
-     * @return True if the client is currently connected to a server,
-     *         false otherwise.
+     *
+     * @return True if the client is currently connected to a server, false otherwise.
      */
-    public boolean isConnected()
-    {
+    public boolean isConnected() {
         if (_socket_ == null) {
             return false;
         }
@@ -680,7 +580,7 @@ public abstract class SocketClient
     /**
      * Removes a ProtocolCommandListener.
      *
-     * @param listener  The ProtocolCommandListener to remove.
+     * @param listener The ProtocolCommandListener to remove.
      * @since 3.0
      */
     public void removeProtocolCommandListener(final ProtocolCommandListener listener) {
@@ -698,8 +598,8 @@ public abstract class SocketClient
     }
 
     /**
-     * Sets the connection timeout in milliseconds, which will be passed to the {@link Socket} object's
-     * connect() method.
+     * Sets the connection timeout in milliseconds, which will be passed to the {@link Socket} object's connect() method.
+     *
      * @param connectTimeout The connection timeout to use (in ms)
      * @since 2.0
      */
@@ -708,44 +608,33 @@ public abstract class SocketClient
     }
 
     /**
-     * Sets the default port the SocketClient should connect to when a port
-     * is not specified.  The {@link #_defaultPort_  _defaultPort_ }
-     * variable stores this value.  If never set, the default port is equal
-     * to zero.
+     * Sets the default port the SocketClient should connect to when a port is not specified. The {@link #_defaultPort_ _defaultPort_ } variable stores this
+     * value. If never set, the default port is equal to zero.
      *
-     * @param port  The default port to set.
+     * @param port The default port to set.
      */
-    public void setDefaultPort(final int port)
-    {
+    public void setDefaultPort(final int port) {
         _defaultPort_ = port;
     }
 
-
     /**
-     * Set the default timeout in milliseconds to use when opening a socket.
-     * This value is only used previous to a call to
-     * {@link #connect connect()}
-     * and should not be confused with {@link #setSoTimeout setSoTimeout()}
-     * which operates on an the currently opened socket.  _timeout_ contains
-     * the new timeout value.
+     * Set the default timeout in milliseconds to use when opening a socket. This value is only used previous to a call to {@link #connect connect()} and should
+     * not be confused with {@link #setSoTimeout setSoTimeout()} which operates on an the currently opened socket. _timeout_ contains the new timeout value.
      *
-     * @param timeout  The timeout in milliseconds to use for the socket
-     *                 connection.
+     * @param timeout The timeout in milliseconds to use for the socket connection.
      */
-    public void setDefaultTimeout(final int timeout)
-    {
+    public void setDefaultTimeout(final int timeout) {
         _timeout_ = timeout;
     }
 
     /**
      * Sets the SO_KEEPALIVE flag on the currently opened socket.
      *
-     * From the Javadocs, the default keepalive time is 2 hours (although this is
-     * implementation  dependent). It looks as though the Windows WSA sockets implementation
-     * allows a specific keepalive value to be set, although this seems not to be the case on
-     * other systems.
-     * @param  keepAlive If true, keepAlive is turned on
-     * @throws SocketException if there is a problem with the socket
+     * From the Javadocs, the default keepalive time is 2 hours (although this is implementation dependent). It looks as though the Windows WSA sockets
+     * implementation allows a specific keepalive value to be set, although this seems not to be the case on other systems.
+     *
+     * @param keepAlive If true, keepAlive is turned on
+     * @throws SocketException      if there is a problem with the socket
      * @throws NullPointerException if the socket is not currently open
      * @since 2.2
      */
@@ -754,9 +643,7 @@ public abstract class SocketClient
     }
 
     /**
-     * Sets the proxy for use with all the connections.
-     * The proxy is used for connections established after the
-     * call to this method.
+     * Sets the proxy for use with all the connections. The proxy is used for connections established after the call to this method.
      *
      * @param proxy the new proxy for connections.
      * @since 3.2
@@ -773,7 +660,7 @@ public abstract class SocketClient
      * @throws SocketException never (but subclasses may wish to do so)
      * @since 2.0
      */
-    public void setReceiveBufferSize(final int size) throws SocketException  {
+    public void setReceiveBufferSize(final int size) throws SocketException {
         receiveBufferSize = size;
     }
 
@@ -789,12 +676,10 @@ public abstract class SocketClient
     }
 
     /**
-     * Sets the ServerSocketFactory used by the SocketClient to open ServerSocket
-     * connections.  If the factory value is null, then a default
-     * factory is used (only do this to reset the factory after having
-     * previously altered it).
+     * Sets the ServerSocketFactory used by the SocketClient to open ServerSocket connections. If the factory value is null, then a default factory is used
+     * (only do this to reset the factory after having previously altered it).
      *
-     * @param factory  The new ServerSocketFactory the SocketClient should use.
+     * @param factory The new ServerSocketFactory the SocketClient should use.
      * @since 2.0
      */
     public void setServerSocketFactory(final ServerSocketFactory factory) {
@@ -806,16 +691,12 @@ public abstract class SocketClient
     }
 
     /**
-     * Sets the SocketFactory used by the SocketClient to open socket
-     * connections.  If the factory value is null, then a default
-     * factory is used (only do this to reset the factory after having
-     * previously altered it).
-     * Any proxy setting is discarded.
+     * Sets the SocketFactory used by the SocketClient to open socket connections. If the factory value is null, then a default factory is used (only do this to
+     * reset the factory after having previously altered it). Any proxy setting is discarded.
      *
-     * @param factory  The new SocketFactory the SocketClient should use.
+     * @param factory The new SocketFactory the SocketClient should use.
      */
-    public void setSocketFactory(final SocketFactory factory)
-    {
+    public void setSocketFactory(final SocketFactory factory) {
         if (factory == null) {
             _socketFactory_ = DEFAULT_SOCKET_FACTORY;
         } else {
@@ -828,56 +709,46 @@ public abstract class SocketClient
      *
      * @param on  True if linger is to be enabled, false if not.
      * @param val The linger timeout (in hundredths of a second?)
-     * @throws SocketException If the operation fails.
+     * @throws SocketException      If the operation fails.
      * @throws NullPointerException if the socket is not currently open
      */
-    public void setSoLinger(final boolean on, final int val) throws SocketException
-    {
+    public void setSoLinger(final boolean on, final int val) throws SocketException {
         _socket_.setSoLinger(on, val);
     }
 
     /**
-     * Set the timeout in milliseconds of a currently open connection.
-     * Only call this method after a connection has been opened
-     * by {@link #connect connect()}.
+     * Set the timeout in milliseconds of a currently open connection. Only call this method after a connection has been opened by {@link #connect connect()}.
      * <p>
      * To set the initial timeout, use {@link #setDefaultTimeout(int)} instead.
      *
-     * @param timeout  The timeout in milliseconds to use for the currently
-     *                 open socket connection.
-     * @throws SocketException If the operation fails.
+     * @param timeout The timeout in milliseconds to use for the currently open socket connection.
+     * @throws SocketException      If the operation fails.
      * @throws NullPointerException if the socket is not currently open
      */
-    public void setSoTimeout(final int timeout) throws SocketException
-    {
+    public void setSoTimeout(final int timeout) throws SocketException {
         _socket_.setSoTimeout(timeout);
     }
 
     /**
-     * Enables or disables the Nagle's algorithm (TCP_NODELAY) on the
-     * currently opened socket.
+     * Enables or disables the Nagle's algorithm (TCP_NODELAY) on the currently opened socket.
      *
-     * @param on  True if Nagle's algorithm is to be enabled, false if not.
-     * @throws SocketException If the operation fails.
+     * @param on True if Nagle's algorithm is to be enabled, false if not.
+     * @throws SocketException      If the operation fails.
      * @throws NullPointerException if the socket is not currently open
      */
-    public void setTcpNoDelay(final boolean on) throws SocketException
-    {
+    public void setTcpNoDelay(final boolean on) throws SocketException {
         _socket_.setTcpNoDelay(on);
     }
 
     /**
-     * Verifies that the remote end of the given socket is connected to the
-     * the same host that the SocketClient is currently connected to.  This
-     * is useful for doing a quick security check when a client needs to
-     * accept a connection from a server, such as an FTP data connection or
-     * a BSD R command standard error stream.
+     * Verifies that the remote end of the given socket is connected to the the same host that the SocketClient is currently connected to. This is useful for
+     * doing a quick security check when a client needs to accept a connection from a server, such as an FTP data connection or a BSD R command standard error
+     * stream.
      *
      * @param socket the item to check against
      * @return True if the remote hosts are the same, false if not.
      */
-    public boolean verifyRemote(final Socket socket)
-    {
+    public boolean verifyRemote(final Socket socket) {
         final InetAddress host1;
         final InetAddress host2;
 
@@ -888,9 +759,7 @@ public abstract class SocketClient
     }
 
     /*
-     *  N.B. Fields cannot be pulled up into a super-class without breaking binary compatibility,
-     *  so the abstract method is needed to pass the instance to the methods which were moved here.
+     * N.B. Fields cannot be pulled up into a super-class without breaking binary compatibility, so the abstract method is needed to pass the instance to the
+     * methods which were moved here.
      */
 }
-
-
diff --git a/src/main/java/org/apache/commons/net/bsd/RCommandClient.java b/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
index e5ce9fef..c03f5c45 100644
--- a/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
+++ b/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
@@ -30,144 +30,96 @@ import java.nio.charset.StandardCharsets;
 import org.apache.commons.net.io.SocketInputStream;
 
 /**
- * RCommandClient is very similar to
- * {@link org.apache.commons.net.bsd.RExecClient},
- * from which it is derived, and implements the rcmd() facility that
- * first appeared in 4.2BSD Unix.  rcmd() is the facility used by the rsh
- * (rshell) and other commands to execute a command on another machine
- * from a trusted host without issuing a password.  The trust relationship
- * between two machines is established by the contents of a machine's
- * /etc/hosts.equiv file and a user's .rhosts file.  These files specify
- * from which hosts and accounts on those hosts rcmd() requests will be
- * accepted.  The only additional measure for establishing trust is that
- * all client connections must originate from a port between 512 and 1023.
- * Consequently, there is an upper limit to the number of rcmd connections
- * that can be running simultaneously.   The required ports are reserved
- * ports on Unix systems, and can only be bound by a
- * process running with root permissions (to accomplish this rsh, rlogin,
- * and related commands usualy have the suid bit set).  Therefore, on a
- * Unix system, you will only be able to successfully use the RCommandClient
- * class if the process runs as root.  However, there is no such restriction
- * on Windows95 and some other systems.  The security risks are obvious.
- * However, when carefully used, rcmd() can be very useful when used behind
- * a firewall.
+ * RCommandClient is very similar to {@link org.apache.commons.net.bsd.RExecClient}, from which it is derived, and implements the rcmd() facility that first
+ * appeared in 4.2BSD Unix. rcmd() is the facility used by the rsh (rshell) and other commands to execute a command on another machine from a trusted host
+ * without issuing a password. The trust relationship between two machines is established by the contents of a machine's /etc/hosts.equiv file and a user's
+ * .rhosts file. These files specify from which hosts and accounts on those hosts rcmd() requests will be accepted. The only additional measure for establishing
+ * trust is that all client connections must originate from a port between 512 and 1023. Consequently, there is an upper limit to the number of rcmd connections
+ * that can be running simultaneously. The required ports are reserved ports on Unix systems, and can only be bound by a process running with root permissions
+ * (to accomplish this rsh, rlogin, and related commands usualy have the suid bit set). Therefore, on a Unix system, you will only be able to successfully use
+ * the RCommandClient class if the process runs as root. However, there is no such restriction on Windows95 and some other systems. The security risks are
+ * obvious. However, when carefully used, rcmd() can be very useful when used behind a firewall.
  * <p>
- * As with virtually all of the client classes in org.apache.commons.net, this
- * class derives from SocketClient.  But it overrides most of its connection
- * methods so that the local Socket will originate from an acceptable
- * rshell port.  The way to use RCommandClient is to first connect
- * to the server, call the {@link #rcommand  rcommand() } method,
- * and then
- * fetch the connection's input, output, and optionally error streams.
- * Interaction with the remote command is controlled entirely through the
- * I/O streams.  Once you have finished processing the streams, you should
- * invoke {@link org.apache.commons.net.bsd.RExecClient#disconnect disconnect() }
- *  to clean up properly.
+ * As with virtually all of the client classes in org.apache.commons.net, this class derives from SocketClient. But it overrides most of its connection methods
+ * so that the local Socket will originate from an acceptable rshell port. The way to use RCommandClient is to first connect to the server, call the
+ * {@link #rcommand rcommand() } method, and then fetch the connection's input, output, and optionally error streams. Interaction with the remote command is
+ * controlled entirely through the I/O streams. Once you have finished processing the streams, you should invoke
+ * {@link org.apache.commons.net.bsd.RExecClient#disconnect disconnect() } to clean up properly.
  * <p>
- * By default the standard output and standard error streams of the
- * remote process are transmitted over the same connection, readable
- * from the input stream returned by
- * {@link org.apache.commons.net.bsd.RExecClient#getInputStream getInputStream() }
- * .  However, it is
- * possible to tell the rshd daemon to return the standard error
- * stream over a separate connection, readable from the input stream
- * returned by {@link org.apache.commons.net.bsd.RExecClient#getErrorStream getErrorStream() }
- * .  You
- * can specify that a separate connection should be created for standard
- * error by setting the boolean <code> separateErrorStream </code>
- * parameter of {@link #rcommand  rcommand() } to <code> true </code>.
- * The standard input of the remote process can be written to through
- * the output stream returned by
- * {@link org.apache.commons.net.bsd.RExecClient#getOutputStream getOutputStream() }
- * .
+ * By default the standard output and standard error streams of the remote process are transmitted over the same connection, readable from the input stream
+ * returned by {@link org.apache.commons.net.bsd.RExecClient#getInputStream getInputStream() } . However, it is possible to tell the rshd daemon to return the
+ * standard error stream over a separate connection, readable from the input stream returned by {@link org.apache.commons.net.bsd.RExecClient#getErrorStream
+ * getErrorStream() } . You can specify that a separate connection should be created for standard error by setting the boolean
+ * <code> separateErrorStream </code> parameter of {@link #rcommand rcommand() } to <code> true </code>. The standard input of the remote process can be written
+ * to through the output stream returned by {@link org.apache.commons.net.bsd.RExecClient#getOutputStream getOutputStream() } .
+ *
  * @see org.apache.commons.net.SocketClient
  * @see RExecClient
  * @see RLoginClient
  */
 
-public class RCommandClient extends RExecClient
-{
+public class RCommandClient extends RExecClient {
     /**
-     * The default rshell port.  Set to 514 in BSD Unix.
+     * The default rshell port. Set to 514 in BSD Unix.
      */
     public static final int DEFAULT_PORT = 514;
 
     /**
-     * The smallest port number an rcmd client may use.  By BSD convention
-     * this number is 512.
+     * The smallest port number an rcmd client may use. By BSD convention this number is 512.
      */
     public static final int MIN_CLIENT_PORT = 512;
 
     /**
-     * The largest port number an rcmd client may use.  By BSD convention
-     * this number is 1023.
+     * The largest port number an rcmd client may use. By BSD convention this number is 1023.
      */
     public static final int MAX_CLIENT_PORT = 1023;
 
     /**
-     * The default RCommandClient constructor.  Initializes the
-     * default port to <code> DEFAULT_PORT </code>.
+     * The default RCommandClient constructor. Initializes the default port to <code> DEFAULT_PORT </code>.
      */
-    public RCommandClient()
-    {
+    public RCommandClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the current host at a port in a range acceptable
-     * to the BSD rshell daemon.
-     * Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the current host at a port in a range acceptable to the BSD rshell
+     * daemon. Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_ _connectAction_() } is called to perform connection initialization
+     * actions.
      *
-     * @param host  The remote host.
-     * @param port  The port to connect to on the remote host.
+     * @param host The remote host.
+     * @param port The port to connect to on the remote host.
      * @throws SocketException If the socket timeout could not be set.
-     * @throws BindException If all acceptable rshell ports are in use.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @throws BindException   If all acceptable rshell ports are in use.
+     * @throws IOException     If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from
+     *                         it.
      */
     @Override
-    public void connect(final InetAddress host, final int port)
-    throws SocketException, IOException
-    {
+    public void connect(final InetAddress host, final int port) throws SocketException, IOException {
         connect(host, port, InetAddress.getLocalHost());
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the specified local address using a port in a range
-     * acceptable to the BSD rshell daemon.
-     * Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the specified local address using a port in a range acceptable to
+     * the BSD rshell daemon. Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_ _connectAction_() } is called to perform connection
+     * initialization actions.
      *
-     * @param host  The remote host.
-     * @param port  The port to connect to on the remote host.
-     * @param localAddr  The local address to use.
+     * @param host      The remote host.
+     * @param port      The port to connect to on the remote host.
+     * @param localAddr The local address to use.
      * @throws SocketException If the socket timeout could not be set.
-     * @throws BindException If all acceptable rshell ports are in use.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @throws BindException   If all acceptable rshell ports are in use.
+     * @throws IOException     If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from
+     *                         it.
      */
-    public void connect(final InetAddress host, final int port, final InetAddress localAddr)
-    throws SocketException, BindException, IOException
-    {
+    public void connect(final InetAddress host, final int port, final InetAddress localAddr) throws SocketException, BindException, IOException {
         int localPort;
 
         localPort = MAX_CLIENT_PORT;
 
-        for (localPort = MAX_CLIENT_PORT; localPort >= MIN_CLIENT_PORT; --localPort)
-        {
-            try
-            {
-                _socket_ =
-                    _socketFactory_.createSocket(host, port, localAddr, localPort);
-            }
-            catch (final SocketException e)
-            {
+        for (localPort = MAX_CLIENT_PORT; localPort >= MIN_CLIENT_PORT; --localPort) {
+            try {
+                _socket_ = _socketFactory_.createSocket(host, port, localAddr, localPort);
+            } catch (final SocketException e) {
                 continue;
             }
             break;
@@ -180,125 +132,92 @@ public class RCommandClient extends RExecClient
         _connectAction_();
     }
 
-
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the specified local address and port. The
-     * local port must lie between <code> MIN_CLIENT_PORT </code> and
-     * <code> MAX_CLIENT_PORT </code> or an IllegalArgumentException will
-     * be thrown.
-     * Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the specified local address and port. The local port must lie
+     * between <code> MIN_CLIENT_PORT </code> and <code> MAX_CLIENT_PORT </code> or an IllegalArgumentException will be thrown. Before returning,
+     * {@link org.apache.commons.net.SocketClient#_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
-     * @param host  The remote host.
-     * @param port  The port to connect to on the remote host.
-     * @param localAddr  The local address to use.
-     * @param localPort  The local port to use.
-     * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
-     * @throws IllegalArgumentException If an invalid local port number
-     *            is specified.
+     * @param host      The remote host.
+     * @param port      The port to connect to on the remote host.
+     * @param localAddr The local address to use.
+     * @param localPort The local port to use.
+     * @throws SocketException          If the socket timeout could not be set.
+     * @throws IOException              If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is
+     *                                  derived from it.
+     * @throws IllegalArgumentException If an invalid local port number is specified.
      */
     @Override
-    public void connect(final InetAddress host, final int port,
-                        final InetAddress localAddr, final int localPort)
-    throws SocketException, IOException, IllegalArgumentException
-    {
+    public void connect(final InetAddress host, final int port, final InetAddress localAddr, final int localPort)
+            throws SocketException, IOException, IllegalArgumentException {
         if (localPort < MIN_CLIENT_PORT || localPort > MAX_CLIENT_PORT) {
             throw new IllegalArgumentException("Invalid port number " + localPort);
         }
         super.connect(host, port, localAddr, localPort);
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the current host at a port in a range acceptable
-     * to the BSD rshell daemon.
-     * Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the current host at a port in a range acceptable to the BSD rshell
+     * daemon. Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_ _connectAction_() } is called to perform connection initialization
+     * actions.
      *
-     * @param hostname  The name of the remote host.
-     * @param port  The port to connect to on the remote host.
-     * @throws SocketException If the socket timeout could not be set.
-     * @throws BindException If all acceptable rshell ports are in use.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @param hostname The name of the remote host.
+     * @param port     The port to connect to on the remote host.
+     * @throws SocketException      If the socket timeout could not be set.
+     * @throws BindException        If all acceptable rshell ports are in use.
+     * @throws IOException          If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived
+     *                              from it.
      * @throws UnknownHostException If the hostname cannot be resolved.
      */
     @Override
-    public void connect(final String hostname, final int port)
-    throws SocketException, IOException, UnknownHostException
-    {
+    public void connect(final String hostname, final int port) throws SocketException, IOException, UnknownHostException {
         connect(InetAddress.getByName(hostname), port, InetAddress.getLocalHost());
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the specified local address using a port in a range
-     * acceptable to the BSD rshell daemon.
-     * Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the specified local address using a port in a range acceptable to
+     * the BSD rshell daemon. Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_ _connectAction_() } is called to perform connection
+     * initialization actions.
      *
      * @param hostname  The remote host.
-     * @param port  The port to connect to on the remote host.
-     * @param localAddr  The local address to use.
+     * @param port      The port to connect to on the remote host.
+     * @param localAddr The local address to use.
      * @throws SocketException If the socket timeout could not be set.
-     * @throws BindException If all acceptable rshell ports are in use.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
+     * @throws BindException   If all acceptable rshell ports are in use.
+     * @throws IOException     If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is derived from
+     *                         it.
      */
-    public void connect(final String hostname, final int port, final InetAddress localAddr)
-    throws SocketException, IOException
-    {
+    public void connect(final String hostname, final int port, final InetAddress localAddr) throws SocketException, IOException {
         connect(InetAddress.getByName(hostname), port, localAddr);
     }
 
-
     /**
-     * Opens a Socket connected to a remote host at the specified port and
-     * originating from the specified local address and port. The
-     * local port must lie between <code> MIN_CLIENT_PORT </code> and
-     * <code> MAX_CLIENT_PORT </code> or an IllegalArgumentException will
-     * be thrown.
-     * Before returning, {@link org.apache.commons.net.SocketClient#_connectAction_  _connectAction_() }
-     * is called to perform connection initialization actions.
+     * Opens a Socket connected to a remote host at the specified port and originating from the specified local address and port. The local port must lie
+     * between <code> MIN_CLIENT_PORT </code> and <code> MAX_CLIENT_PORT </code> or an IllegalArgumentException will be thrown. Before returning,
+     * {@link org.apache.commons.net.SocketClient#_connectAction_ _connectAction_() } is called to perform connection initialization actions.
      *
      * @param hostname  The name of the remote host.
-     * @param port  The port to connect to on the remote host.
-     * @param localAddr  The local address to use.
-     * @param localPort  The local port to use.
-     * @throws SocketException If the socket timeout could not be set.
-     * @throws IOException If the socket could not be opened.  In most
-     *  cases you will only want to catch IOException since SocketException is
-     *  derived from it.
-     * @throws UnknownHostException If the hostname cannot be resolved.
-     * @throws IllegalArgumentException If an invalid local port number
-     *            is specified.
+     * @param port      The port to connect to on the remote host.
+     * @param localAddr The local address to use.
+     * @param localPort The local port to use.
+     * @throws SocketException          If the socket timeout could not be set.
+     * @throws IOException              If the socket could not be opened. In most cases you will only want to catch IOException since SocketException is
+     *                                  derived from it.
+     * @throws UnknownHostException     If the hostname cannot be resolved.
+     * @throws IllegalArgumentException If an invalid local port number is specified.
      */
     @Override
-    public void connect(final String hostname, final int port,
-                        final InetAddress localAddr, final int localPort)
-    throws SocketException, IOException, IllegalArgumentException, UnknownHostException
-    {
+    public void connect(final String hostname, final int port, final InetAddress localAddr, final int localPort)
+            throws SocketException, IOException, IllegalArgumentException, UnknownHostException {
         if (localPort < MIN_CLIENT_PORT || localPort > MAX_CLIENT_PORT) {
             throw new IllegalArgumentException("Invalid port number " + localPort);
         }
         super.connect(hostname, port, localAddr, localPort);
     }
 
-
     // Overrides method in RExecClient in order to implement proper
     // port number limitations.
     @Override
-    InputStream createErrorStream() throws IOException
-    {
+    InputStream createErrorStream() throws IOException {
         int localPort;
         ServerSocket server;
         final Socket socket;
@@ -306,16 +225,11 @@ public class RCommandClient extends RExecClient
         localPort = MAX_CLIENT_PORT;
         server = null; // Keep compiler from barfing
 
-        for (localPort = MAX_CLIENT_PORT; localPort >= MIN_CLIENT_PORT; --localPort)
-        {
-            try
-            {
-                server = _serverSocketFactory_.createServerSocket(localPort, 1,
-                         getLocalAddress());
+        for (localPort = MAX_CLIENT_PORT; localPort >= MIN_CLIENT_PORT; --localPort) {
+            try {
+                server = _serverSocketFactory_.createServerSocket(localPort, 1, getLocalAddress());
                 break; // got a socket
-            }
-            catch (final SocketException e)
-            {
+            } catch (final SocketException e) {
                 continue;
             }
         }
@@ -331,76 +245,48 @@ public class RCommandClient extends RExecClient
         socket = server.accept();
         server.close();
 
-        if (isRemoteVerificationEnabled() && !verifyRemote(socket))
-        {
+        if (isRemoteVerificationEnabled() && !verifyRemote(socket)) {
             socket.close();
-            throw new IOException(
-                "Security violation: unexpected connection attempt by " +
-                socket.getInetAddress().getHostAddress());
+            throw new IOException("Security violation: unexpected connection attempt by " + socket.getInetAddress().getHostAddress());
         }
 
         return new SocketInputStream(socket, socket.getInputStream());
     }
 
-
     /**
-     * Same as
-     * <code> rcommand(localUsername, remoteUsername, command, false); </code>
-     * @param localUsername the local user
+     * Same as <code> rcommand(localUsername, remoteUsername, command, false); </code>
+     *
+     * @param localUsername  the local user
      * @param remoteUsername the remote user
-     * @param command the command
+     * @param command        the command
      * @throws IOException on error
      */
-    public void rcommand(final String localUsername, final String remoteUsername,
-                         final String command)
-    throws IOException
-    {
+    public void rcommand(final String localUsername, final String remoteUsername, final String command) throws IOException {
         rcommand(localUsername, remoteUsername, command, false);
     }
 
-
     /**
-     * Remotely executes a command through the rshd daemon on the server
-     * to which the RCommandClient is connected.  After calling this method,
-     * you may interact with the remote process through its standard input,
-     * output, and error streams.  You will typically be able to detect
-     * the termination of the remote process after reaching end of file
-     * on its standard output (accessible through
-     * {@link #getInputStream  getInputStream() }.  Disconnecting
-     * from the server or closing the process streams before reaching
-     * end of file will not necessarily terminate the remote process.
+     * Remotely executes a command through the rshd daemon on the server to which the RCommandClient is connected. After calling this method, you may interact
+     * with the remote process through its standard input, output, and error streams. You will typically be able to detect the termination of the remote process
+     * after reaching end of file on its standard output (accessible through {@link #getInputStream getInputStream() }. Disconnecting from the server or closing
+     * the process streams before reaching end of file will not necessarily terminate the remote process.
      * <p>
-     * If a separate error stream is requested, the remote server will
-     * connect to a local socket opened by RCommandClient, providing an
-     * independent stream through which standard error will be transmitted.
-     * The local socket must originate from a secure port (512 - 1023),
-     * and rcommand() ensures that this will be so.
-     * RCommandClient will also do a simple security check when it accepts a
-     * connection for this error stream.  If the connection does not originate
-     * from the remote server, an IOException will be thrown.  This serves as
-     * a simple protection against possible hijacking of the error stream by
-     * an attacker monitoring the rexec() negotiation.  You may disable this
-     * behavior with
-     * {@link org.apache.commons.net.bsd.RExecClient#setRemoteVerificationEnabled setRemoteVerificationEnabled()}
-     * .
+     * If a separate error stream is requested, the remote server will connect to a local socket opened by RCommandClient, providing an independent stream
+     * through which standard error will be transmitted. The local socket must originate from a secure port (512 - 1023), and rcommand() ensures that this will
+     * be so. RCommandClient will also do a simple security check when it accepts a connection for this error stream. If the connection does not originate from
+     * the remote server, an IOException will be thrown. This serves as a simple protection against possible hijacking of the error stream by an attacker
+     * monitoring the rexec() negotiation. You may disable this behavior with {@link org.apache.commons.net.bsd.RExecClient#setRemoteVerificationEnabled
+     * setRemoteVerificationEnabled()} .
      * <p>
-     * @param localUsername  The user account on the local machine that is
-     *        requesting the command execution.
-     * @param remoteUsername  The account name on the server through which to
-     *        execute the command.
-     * @param command   The command, including any arguments, to execute.
-     * @param separateErrorStream True if you would like the standard error
-     *        to be transmitted through a different stream than standard output.
-     *        False if not.
-     * @throws IOException If the rcommand() attempt fails.  The exception
-     *            will contain a message indicating the nature of the failure.
+     *
+     * @param localUsername       The user account on the local machine that is requesting the command execution.
+     * @param remoteUsername      The account name on the server through which to execute the command.
+     * @param command             The command, including any arguments, to execute.
+     * @param separateErrorStream True if you would like the standard error to be transmitted through a different stream than standard output. False if not.
+     * @throws IOException If the rcommand() attempt fails. The exception will contain a message indicating the nature of the failure.
      */
-    public void rcommand(final String localUsername, final String remoteUsername,
-                         final String command, final boolean separateErrorStream)
-    throws IOException
-    {
+    public void rcommand(final String localUsername, final String remoteUsername, final String command, final boolean separateErrorStream) throws IOException {
         rexec(localUsername, remoteUsername, command, separateErrorStream);
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/bsd/RExecClient.java b/src/main/java/org/apache/commons/net/bsd/RExecClient.java
index c099f21c..1c8ce930 100644
--- a/src/main/java/org/apache/commons/net/bsd/RExecClient.java
+++ b/src/main/java/org/apache/commons/net/bsd/RExecClient.java
@@ -29,78 +29,56 @@ import org.apache.commons.net.io.SocketInputStream;
 import org.apache.commons.net.util.NetConstants;
 
 /**
- * RExecClient implements the rexec() facility that first appeared in
- * 4.2BSD Unix.  This class will probably only be of use for connecting
- * to Unix systems and only when the rexecd daemon is configured to run,
- * which is a rarity these days because of the security risks involved.
- * However, rexec() can be very useful for performing administrative tasks
- * on a network behind a firewall.
+ * RExecClient implements the rexec() facility that first appeared in 4.2BSD Unix. This class will probably only be of use for connecting to Unix systems and
+ * only when the rexecd daemon is configured to run, which is a rarity these days because of the security risks involved. However, rexec() can be very useful
+ * for performing administrative tasks on a network behind a firewall.
  * <p>
- * As with virtually all of the client classes in org.apache.commons.net, this
- * class derives from SocketClient, inheriting its connection methods.
- * The way to use RExecClient is to first connect
- * to the server, call the {@link #rexec  rexec()} method, and then
- * fetch the connection's input, output, and optionally error streams.
- * Interaction with the remote command is controlled entirely through the
- * I/O streams.  Once you have finished processing the streams, you should
- * invoke {@link #disconnect  disconnect()} to clean up properly.
+ * As with virtually all of the client classes in org.apache.commons.net, this class derives from SocketClient, inheriting its connection methods. The way to
+ * use RExecClient is to first connect to the server, call the {@link #rexec rexec()} method, and then fetch the connection's input, output, and optionally
+ * error streams. Interaction with the remote command is controlled entirely through the I/O streams. Once you have finished processing the streams, you should
+ * invoke {@link #disconnect disconnect()} to clean up properly.
  * <p>
- * By default the standard output and standard error streams of the
- * remote process are transmitted over the same connection, readable
- * from the input stream returned by
- * {@link #getInputStream  getInputStream()}.  However, it is
- * possible to tell the rexecd daemon to return the standard error
- * stream over a separate connection, readable from the input stream
- * returned by {@link #getErrorStream  getErrorStream()}.  You
- * can specify that a separate connection should be created for standard
- * error by setting the boolean <code> separateErrorStream </code>
- * parameter of {@link #rexec  rexec()} to <code> true </code>.
- * The standard input of the remote process can be written to through
- * the output stream returned by
- * {@link #getOutputStream  getOutputSream()}.
+ * By default the standard output and standard error streams of the remote process are transmitted over the same connection, readable from the input stream
+ * returned by {@link #getInputStream getInputStream()}. However, it is possible to tell the rexecd daemon to return the standard error stream over a separate
+ * connection, readable from the input stream returned by {@link #getErrorStream getErrorStream()}. You can specify that a separate connection should be created
+ * for standard error by setting the boolean <code> separateErrorStream </code> parameter of {@link #rexec rexec()} to <code> true </code>. The standard input
+ * of the remote process can be written to through the output stream returned by {@link #getOutputStream getOutputSream()}.
  *
  * @see SocketClient
  * @see RCommandClient
  * @see RLoginClient
  */
 
-public class RExecClient extends SocketClient
-{
+public class RExecClient extends SocketClient {
     /**
      * @since 3.3
      */
     protected static final char NULL_CHAR = '\0';
 
     /**
-     * The default rexec port.  Set to 512 in BSD Unix.
+     * The default rexec port. Set to 512 in BSD Unix.
      */
     public static final int DEFAULT_PORT = 512;
 
     private boolean remoteVerificationEnabled;
 
     /**
-     * If a separate error stream is requested, <code>_errorStream_</code>
-     * will point to an InputStream from which the standard error of the
-     * remote process can be read (after a call to rexec()).  Otherwise,
-     * <code> _errorStream_ </code> will be null.
+     * If a separate error stream is requested, <code>_errorStream_</code> will point to an InputStream from which the standard error of the remote process can
+     * be read (after a call to rexec()). Otherwise, <code> _errorStream_ </code> will be null.
      */
     protected InputStream _errorStream_;
 
     /**
-     * The default RExecClient constructor.  Initializes the
-     * default port to <code> DEFAULT_PORT </code>.
+     * The default RExecClient constructor. Initializes the default port to <code> DEFAULT_PORT </code>.
      */
-    public RExecClient()
-    {
+    public RExecClient() {
         _errorStream_ = null;
         setDefaultPort(DEFAULT_PORT);
     }
 
-
     // This can be overridden in local package to implement port range
     // limitations of rcmd and rlogin
-    InputStream createErrorStream() throws IOException
-    {
+    InputStream createErrorStream() throws IOException {
         final ServerSocket server;
         final Socket socket;
 
@@ -113,27 +91,21 @@ public class RExecClient extends SocketClient
         socket = server.accept();
         server.close();
 
-        if (remoteVerificationEnabled && !verifyRemote(socket))
-        {
+        if (remoteVerificationEnabled && !verifyRemote(socket)) {
             socket.close();
-            throw new IOException(
-                "Security violation: unexpected connection attempt by " +
-                socket.getInetAddress().getHostAddress());
+            throw new IOException("Security violation: unexpected connection attempt by " + socket.getInetAddress().getHostAddress());
         }
 
         return new SocketInputStream(socket, socket.getInputStream());
     }
 
-
     /**
-     * Disconnects from the server, closing all associated open sockets and
-     * streams.
+     * Disconnects from the server, closing all associated open sockets and streams.
      *
      * @throws IOException If there an error occurs while disconnecting.
      */
     @Override
-    public void disconnect() throws IOException
-    {
+    public void disconnect() throws IOException {
         if (_errorStream_ != null) {
             _errorStream_.close();
         }
@@ -141,122 +113,83 @@ public class RExecClient extends SocketClient
         super.disconnect();
     }
 
-
     /**
-     * Returns the InputStream from which the standard error of the remote
-     * process can be read if a separate error stream is requested from
-     * the server.  Otherwise, null will be returned.  The error stream
-     * will only be set after a successful rexec() invocation.
+     * Returns the InputStream from which the standard error of the remote process can be read if a separate error stream is requested from the server.
+     * Otherwise, null will be returned. The error stream will only be set after a successful rexec() invocation.
      *
-     * @return The InputStream from which the standard error of the remote
-     * process can be read if a separate error stream is requested from
-     * the server.  Otherwise, null will be returned.
+     * @return The InputStream from which the standard error of the remote process can be read if a separate error stream is requested from the server.
+     *         Otherwise, null will be returned.
      */
-    public InputStream getErrorStream()
-    {
+    public InputStream getErrorStream() {
         return _errorStream_;
     }
 
-
     /**
-     * Returns the InputStream from which the standard output of the remote
-     * process can be read.  The input stream will only be set after a
-     * successful rexec() invocation.
+     * Returns the InputStream from which the standard output of the remote process can be read. The input stream will only be set after a successful rexec()
+     * invocation.
      *
-     * @return The InputStream from which the standard output of the remote
-     * process can be read.
+     * @return The InputStream from which the standard output of the remote process can be read.
      */
-    public InputStream getInputStream()
-    {
+    public InputStream getInputStream() {
         return _input_;
     }
 
-
     /**
-     * Returns the OutputStream through which the standard input of the remote
-     * process can be written.  The output stream will only be set after a
-     * successful rexec() invocation.
+     * Returns the OutputStream through which the standard input of the remote process can be written. The output stream will only be set after a successful
+     * rexec() invocation.
      *
-     * @return The OutputStream through which the standard input of the remote
-     * process can be written.
+     * @return The OutputStream through which the standard input of the remote process can be written.
      */
-    public OutputStream getOutputStream()
-    {
+    public OutputStream getOutputStream() {
         return _output_;
     }
 
-
     /**
-     * Return whether or not verification of the remote host providing a
-     * separate error stream is enabled.  The default behavior is for
-     * verification to be enabled.
+     * Return whether or not verification of the remote host providing a separate error stream is enabled. The default behavior is for verification to be
+     * enabled.
      *
      * @return True if verification is enabled, false if not.
      */
-    public final boolean isRemoteVerificationEnabled()
-    {
+    public final boolean isRemoteVerificationEnabled() {
         return remoteVerificationEnabled;
     }
 
     /**
      * Same as <code> rexec(username, password, command, false); </code>
+     *
      * @param username the user name
      * @param password the password
-     * @param command the command to run
+     * @param command  the command to run
      * @throws IOException if an error occurs
      */
-    public void rexec(final String username, final String password,
-                      final String command)
-    throws IOException
-    {
+    public void rexec(final String username, final String password, final String command) throws IOException {
         rexec(username, password, command, false);
     }
 
-
     /**
-     * Remotely executes a command through the rexecd daemon on the server
-     * to which the RExecClient is connected.  After calling this method,
-     * you may interact with the remote process through its standard input,
-     * output, and error streams.  You will typically be able to detect
-     * the termination of the remote process after reaching end of file
-     * on its standard output (accessible through
-     * {@link #getInputStream  getInputStream() }.    Disconnecting
-     * from the server or closing the process streams before reaching
-     * end of file will not necessarily terminate the remote process.
+     * Remotely executes a command through the rexecd daemon on the server to which the RExecClient is connected. After calling this method, you may interact
+     * with the remote process through its standard input, output, and error streams. You will typically be able to detect the termination of the remote process
+     * after reaching end of file on its standard output (accessible through {@link #getInputStream getInputStream() }. Disconnecting from the server or closing
+     * the process streams before reaching end of file will not necessarily terminate the remote process.
      * <p>
-     * If a separate error stream is requested, the remote server will
-     * connect to a local socket opened by RExecClient, providing an
-     * independent stream through which standard error will be transmitted.
-     * RExecClient will do a simple security check when it accepts a
-     * connection for this error stream.  If the connection does not originate
-     * from the remote server, an IOException will be thrown.  This serves as
-     * a simple protection against possible hijacking of the error stream by
-     * an attacker monitoring the rexec() negotiation.  You may disable this
-     * behavior with {@link #setRemoteVerificationEnabled setRemoteVerificationEnabled()}
-     * .
+     * If a separate error stream is requested, the remote server will connect to a local socket opened by RExecClient, providing an independent stream through
+     * which standard error will be transmitted. RExecClient will do a simple security check when it accepts a connection for this error stream. If the
+     * connection does not originate from the remote server, an IOException will be thrown. This serves as a simple protection against possible hijacking of the
+     * error stream by an attacker monitoring the rexec() negotiation. You may disable this behavior with {@link #setRemoteVerificationEnabled
+     * setRemoteVerificationEnabled()} .
      *
-     * @param username  The account name on the server through which to execute
-     *                  the command.
-     * @param password  The plain text password of the user account.
-     * @param command   The command, including any arguments, to execute.
-     * @param separateErrorStream True if you would like the standard error
-     *        to be transmitted through a different stream than standard output.
-     *        False if not.
-     * @throws IOException If the rexec() attempt fails.  The exception
-     *            will contain a message indicating the nature of the failure.
+     * @param username            The account name on the server through which to execute the command.
+     * @param password            The plain text password of the user account.
+     * @param command             The command, including any arguments, to execute.
+     * @param separateErrorStream True if you would like the standard error to be transmitted through a different stream than standard output. False if not.
+     * @throws IOException If the rexec() attempt fails. The exception will contain a message indicating the nature of the failure.
      */
-    public void rexec(final String username, final String password,
-                      final String command, final boolean separateErrorStream)
-    throws IOException
-    {
+    public void rexec(final String username, final String password, final String command, final boolean separateErrorStream) throws IOException {
         int ch;
 
-        if (separateErrorStream)
-        {
+        if (separateErrorStream) {
             _errorStream_ = createErrorStream();
-        }
-        else
-        {
+        } else {
             _output_.write(NULL_CHAR);
         }
 
@@ -273,7 +206,7 @@ public class RExecClient extends SocketClient
             final StringBuilder buffer = new StringBuilder();
 
             while ((ch = _input_.read()) != NetConstants.EOS && ch != '\n') {
-                buffer.append((char)ch);
+                buffer.append((char) ch);
             }
 
             throw new IOException(buffer.toString());
@@ -284,18 +217,13 @@ public class RExecClient extends SocketClient
     }
 
     /**
-     * Enable or disable verification that the remote host connecting to
-     * create a separate error stream is the same as the host to which
-     * the standard out stream is connected.  The default is for verification
-     * to be enabled.  You may set this value at any time, whether the
-     * client is currently connected or not.
+     * Enable or disable verification that the remote host connecting to create a separate error stream is the same as the host to which the standard out stream
+     * is connected. The default is for verification to be enabled. You may set this value at any time, whether the client is currently connected or not.
      *
      * @param enable True to enable verification, false to disable verification.
      */
-    public final void setRemoteVerificationEnabled(final boolean enable)
-    {
+    public final void setRemoteVerificationEnabled(final boolean enable) {
         remoteVerificationEnabled = enable;
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/bsd/RLoginClient.java b/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
index f7aa6ed1..8bcb57cf 100644
--- a/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
+++ b/src/main/java/org/apache/commons/net/bsd/RLoginClient.java
@@ -20,114 +20,72 @@ package org.apache.commons.net.bsd;
 import java.io.IOException;
 
 /**
- * RLoginClient is very similar to
- * {@link org.apache.commons.net.bsd.RCommandClient},
- * from which it is derived, and uses the rcmd() facility implemented
- * in RCommandClient to implement the functionality of the rlogin command that
- * first appeared in 4.2BSD Unix.  rlogin is a command used to login to
- * a remote machine from a trusted host, sometimes without issuing a
- * password.  The trust relationship is the same as described in
- * the documentation for
+ * RLoginClient is very similar to {@link org.apache.commons.net.bsd.RCommandClient}, from which it is derived, and uses the rcmd() facility implemented in
+ * RCommandClient to implement the functionality of the rlogin command that first appeared in 4.2BSD Unix. rlogin is a command used to login to a remote machine
+ * from a trusted host, sometimes without issuing a password. The trust relationship is the same as described in the documentation for
  * {@link org.apache.commons.net.bsd.RCommandClient}.
  * <p>
- * As with virtually all of the client classes in org.apache.commons.net, this
- * class derives from SocketClient.  But it relies on the connection
- * methods defined  in RcommandClient which ensure that the local Socket
- * will originate from an acceptable rshell port.  The way to use
- * RLoginClient is to first connect
- * to the server, call the {@link #rlogin  rlogin() } method,
- * and then
- * fetch the connection's input and output streams.
- * Interaction with the remote command is controlled entirely through the
- * I/O streams.  Once you have finished processing the streams, you should
- * invoke {@link org.apache.commons.net.bsd.RExecClient#disconnect disconnect() }
- *  to clean up properly.
+ * As with virtually all of the client classes in org.apache.commons.net, this class derives from SocketClient. But it relies on the connection methods defined
+ * in RcommandClient which ensure that the local Socket will originate from an acceptable rshell port. The way to use RLoginClient is to first connect to the
+ * server, call the {@link #rlogin rlogin() } method, and then fetch the connection's input and output streams. Interaction with the remote command is
+ * controlled entirely through the I/O streams. Once you have finished processing the streams, you should invoke
+ * {@link org.apache.commons.net.bsd.RExecClient#disconnect disconnect() } to clean up properly.
  * <p>
- * The standard output and standard error streams of the
- * remote process are transmitted over the same connection, readable
- * from the input stream returned by
+ * The standard output and standard error streams of the remote process are transmitted over the same connection, readable from the input stream returned by
  * {@link org.apache.commons.net.bsd.RExecClient#getInputStream getInputStream() }
  * <p>
- * Unlike RExecClient and RCommandClient, it is
- * not possible to tell the rlogind daemon to return the standard error
- * stream over a separate connection.
- * {@link org.apache.commons.net.bsd.RExecClient#getErrorStream getErrorStream() }
- *  will always return null.
- * The standard input of the remote process can be written to through
- * the output stream returned by
- * {@link org.apache.commons.net.bsd.RExecClient#getOutputStream getOutputSream() }
+ * Unlike RExecClient and RCommandClient, it is not possible to tell the rlogind daemon to return the standard error stream over a separate connection.
+ * {@link org.apache.commons.net.bsd.RExecClient#getErrorStream getErrorStream() } will always return null. The standard input of the remote process can be
+ * written to through the output stream returned by {@link org.apache.commons.net.bsd.RExecClient#getOutputStream getOutputSream() }
  *
  * @see org.apache.commons.net.SocketClient
  * @see RExecClient
  * @see RCommandClient
  */
 
-public class RLoginClient extends RCommandClient
-{
+public class RLoginClient extends RCommandClient {
     /**
-     * The default rlogin port.  Set to 513 in BSD Unix and according
-     * to RFC 1282.
+     * The default rlogin port. Set to 513 in BSD Unix and according to RFC 1282.
      */
     public static final int DEFAULT_PORT = 513;
 
     /**
-     * The default RLoginClient constructor.  Initializes the
-     * default port to <code> DEFAULT_PORT </code>.
+     * The default RLoginClient constructor. Initializes the default port to <code> DEFAULT_PORT </code>.
      */
-    public RLoginClient()
-    {
+    public RLoginClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
-
     /**
      * Same as the other rlogin method, but no terminal speed is defined.
-     * @param localUsername the local user
+     *
+     * @param localUsername  the local user
      * @param remoteUsername the remote user
-     * @param terminalType the terminal type
+     * @param terminalType   the terminal type
      * @throws IOException on error
      */
-    public void rlogin(final String localUsername, final String remoteUsername,
-                       final String terminalType)
-    throws IOException
-    {
+    public void rlogin(final String localUsername, final String remoteUsername, final String terminalType) throws IOException {
         rexec(localUsername, remoteUsername, terminalType, false);
     }
 
     /**
-     * Logins into a remote machine through the rlogind daemon on the server
-     * to which the RLoginClient is connected.  After calling this method,
-     * you may interact with the remote login shell through its standard input
-     * and output streams.  Standard error is sent over the same stream as
-     * standard output.  You will typically be able to detect
-     * the termination of the remote login shell after reaching end of file
-     * on its standard output (accessible through
-     * {@link #getInputStream  getInputStream() }.  Disconnecting
-     * from the server or closing the process streams before reaching
-     * end of file will terminate the remote login shell in most cases.
+     * Logins into a remote machine through the rlogind daemon on the server to which the RLoginClient is connected. After calling this method, you may interact
+     * with the remote login shell through its standard input and output streams. Standard error is sent over the same stream as standard output. You will
+     * typically be able to detect the termination of the remote login shell after reaching end of file on its standard output (accessible through
+     * {@link #getInputStream getInputStream() }. Disconnecting from the server or closing the process streams before reaching end of file will terminate the
+     * remote login shell in most cases.
      * <p>
-     * If user authentication fails, the rlogind daemon will request that
-     * a password be entered interactively.  You will be able to read the
-     * prompt from the output stream of the RLoginClient and write the
-     * password to the input stream of the RLoginClient.
+     * If user authentication fails, the rlogind daemon will request that a password be entered interactively. You will be able to read the prompt from the
+     * output stream of the RLoginClient and write the password to the input stream of the RLoginClient.
      *
-     * @param localUsername  The user account on the local machine that is
-     *        trying to login to the remote host.
-     * @param remoteUsername  The account name on the server that is
-     *        being logged in to.
-     * @param terminalType   The name of the user's terminal (e.g., "vt100",
-     *        "network", etc.)
-     * @param terminalSpeed  The speed of the user's terminal, expressed
-     *        as a baud rate or bps (e.g., 9600 or 38400)
-     * @throws IOException If the rlogin() attempt fails.  The exception
-     *            will contain a message indicating the nature of the failure.
+     * @param localUsername  The user account on the local machine that is trying to login to the remote host.
+     * @param remoteUsername The account name on the server that is being logged in to.
+     * @param terminalType   The name of the user's terminal (e.g., "vt100", "network", etc.)
+     * @param terminalSpeed  The speed of the user's terminal, expressed as a baud rate or bps (e.g., 9600 or 38400)
+     * @throws IOException If the rlogin() attempt fails. The exception will contain a message indicating the nature of the failure.
      */
-    public void rlogin(final String localUsername, final String remoteUsername,
-                       final String terminalType, final int terminalSpeed)
-    throws IOException
-    {
-        rexec(localUsername, remoteUsername, terminalType + "/" + terminalSpeed,
-              false);
+    public void rlogin(final String localUsername, final String remoteUsername, final String terminalType, final int terminalSpeed) throws IOException {
+        rexec(localUsername, remoteUsername, terminalType + "/" + terminalSpeed, false);
     }
 
 }
diff --git a/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java b/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java
index 998aa320..3a710e5a 100644
--- a/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java
+++ b/src/main/java/org/apache/commons/net/chargen/CharGenTCPClient.java
@@ -22,28 +22,19 @@ import java.io.InputStream;
 import org.apache.commons.net.SocketClient;
 
 /**
- * The CharGenTCPClient class is a TCP implementation of a client for the
- * character generator protocol described in RFC 864.  It can also be
- * used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
- * (port 15).  All of these protocols involve connecting to the appropriate
- * port, and reading data from an input stream.  The chargen protocol
- * actually sends data until the receiving end closes the connection.  All
- * of the others send only a fixed amount of data and then close the
- * connection.
+ * The CharGenTCPClient class is a TCP implementation of a client for the character generator protocol described in RFC 864. It can also be used for Systat (RFC
+ * 866), Quote of the Day (RFC 865), and netstat (port 15). All of these protocols involve connecting to the appropriate port, and reading data from an input
+ * stream. The chargen protocol actually sends data until the receiving end closes the connection. All of the others send only a fixed amount of data and then
+ * close the connection.
  * <p>
- * To use the CharGenTCPClient class, just establish a
- * connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link #getInputStream  getInputStream() } to access
- * the data.  Don't close the input stream when you're done with it.  Rather,
- * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to clean up properly.
+ * To use the CharGenTCPClient class, just establish a connection with {@link org.apache.commons.net.SocketClient#connect connect } and call
+ * {@link #getInputStream getInputStream() } to access the data. Don't close the input stream when you're done with it. Rather, call
+ * {@link org.apache.commons.net.SocketClient#disconnect disconnect } to clean up properly.
  *
  * @see CharGenUDPClient
  */
 
-public final class CharGenTCPClient extends SocketClient
-{
+public final class CharGenTCPClient extends SocketClient {
     /** The systat port value of 11 according to RFC 866. */
     public static final int SYSTAT_PORT = 11;
     /** The netstat port value of 19. */
@@ -52,33 +43,23 @@ public final class CharGenTCPClient extends SocketClient
     public static final int QUOTE_OF_DAY_PORT = 17;
     /** The character generator port value of 19 according to RFC 864. */
     public static final int CHARGEN_PORT = 19;
-    /** The default chargen port.  It is set to 19 according to RFC 864. */
+    /** The default chargen port. It is set to 19 according to RFC 864. */
     public static final int DEFAULT_PORT = 19;
 
     /**
-     * The default constructor for CharGenTCPClient.  It merely sets the
-     * default port to <code> DEFAULT_PORT </code>.
+     * The default constructor for CharGenTCPClient. It merely sets the default port to <code> DEFAULT_PORT </code>.
      */
-    public CharGenTCPClient ()
-    {
+    public CharGenTCPClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
     /**
-     * Returns an InputStream from which the server generated data can be
-     * read.  You should NOT close the InputStream when you're finished
-     * reading from it.  Rather, you should call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * to clean up properly.
+     * Returns an InputStream from which the server generated data can be read. You should NOT close the InputStream when you're finished reading from it.
+     * Rather, you should call {@link org.apache.commons.net.SocketClient#disconnect disconnect } to clean up properly.
      *
      * @return An InputStream from which the server generated data can be read.
      */
-    public InputStream getInputStream()
-    {
+    public InputStream getInputStream() {
         return _input_;
     }
 }
-
-
-
-
diff --git a/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java b/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
index 25a5a77a..834a836e 100644
--- a/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
+++ b/src/main/java/org/apache/commons/net/chargen/CharGenUDPClient.java
@@ -25,33 +25,20 @@ import org.apache.commons.net.DatagramSocketClient;
 import org.apache.commons.net.util.NetConstants;
 
 /**
- * The CharGenUDPClient class is a UDP implementation of a client for the
- * character generator protocol described in RFC 864.  It can also be
- * used for Systat (RFC 866), Quote of the Day (RFC 865), and netstat
- * (port 15).  All of these protocols involve sending a datagram to the
- * appropriate port, and reading data contained in one or more reply
- * datagrams.  The chargen and quote of the day protocols only send
- * one reply datagram containing 512 bytes or less of data.  The other
- * protocols may reply with more than one datagram, in which case you
- * must wait for a timeout to determine that all reply datagrams have
- * been sent.
+ * The CharGenUDPClient class is a UDP implementation of a client for the character generator protocol described in RFC 864. It can also be used for Systat (RFC
+ * 866), Quote of the Day (RFC 865), and netstat (port 15). All of these protocols involve sending a datagram to the appropriate port, and reading data
+ * contained in one or more reply datagrams. The chargen and quote of the day protocols only send one reply datagram containing 512 bytes or less of data. The
+ * other protocols may reply with more than one datagram, in which case you must wait for a timeout to determine that all reply datagrams have been sent.
  * <p>
- * To use the CharGenUDPClient class, just open a local UDP port
- * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #send  send } to send the datagram that will
- * initiate the data reply.  For chargen or quote of the day, just
- * call {@link #receive  receive }, and you're done.  For netstat and
- * systat, call receive in a while loop, and catch a SocketException and
- * InterruptedIOException to detect a timeout (don't forget to set the
- * timeout duration beforehand).  Don't forget to call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
- * to clean up properly.
+ * To use the CharGenUDPClient class, just open a local UDP port with {@link org.apache.commons.net.DatagramSocketClient#open open } and call {@link #send send
+ * } to send the datagram that will initiate the data reply. For chargen or quote of the day, just call {@link #receive receive }, and you're done. For netstat
+ * and systat, call receive in a while loop, and catch a SocketException and InterruptedIOException to detect a timeout (don't forget to set the timeout
+ * duration beforehand). Don't forget to call {@link org.apache.commons.net.DatagramSocketClient#close close() } to clean up properly.
  *
  * @see CharGenTCPClient
  */
 
-public final class CharGenUDPClient extends DatagramSocketClient
-{
+public final class CharGenUDPClient extends DatagramSocketClient {
     /** The systat port value of 11 according to RFC 866. */
     public static final int SYSTAT_PORT = 11;
     /** The netstat port value of 19. */
@@ -60,7 +47,7 @@ public final class CharGenUDPClient extends DatagramSocketClient
     public static final int QUOTE_OF_DAY_PORT = 17;
     /** The character generator port value of 19 according to RFC 864. */
     public static final int CHARGEN_PORT = 19;
-    /** The default chargen port.  It is set to 19 according to RFC 864. */
+    /** The default chargen port. It is set to 19 according to RFC 864. */
     public static final int DEFAULT_PORT = 19;
 
     private final byte[] receiveData;
@@ -68,29 +55,24 @@ public final class CharGenUDPClient extends DatagramSocketClient
     private final DatagramPacket sendPacket;
 
     /**
-     * The default CharGenUDPClient constructor.  It initializes some internal
-     * data structures for sending and receiving the necessary datagrams for
-     * the chargen and related protocols.
+     * The default CharGenUDPClient constructor. It initializes some internal data structures for sending and receiving the necessary datagrams for the chargen
+     * and related protocols.
      */
-    public CharGenUDPClient()
-    {
+    public CharGenUDPClient() {
         // CharGen return packets have a maximum length of 512
         receiveData = new byte[512];
         receivePacket = new DatagramPacket(receiveData, receiveData.length);
         sendPacket = new DatagramPacket(NetConstants.EMPTY_BTYE_ARRAY, 0);
     }
 
-
     /**
-     * Receive the reply data from the server.  This will always be 512 bytes
-     * or less.  Chargen and quote of the day only return one packet.  Netstat
-     * and systat require multiple calls to receive() with timeout detection.
+     * Receive the reply data from the server. This will always be 512 bytes or less. Chargen and quote of the day only return one packet. Netstat and systat
+     * require multiple calls to receive() with timeout detection.
      *
      * @return The reply data from the server.
      * @throws IOException If an error occurs while receiving the datagram.
      */
-    public byte[] receive() throws IOException
-    {
+    public byte[] receive() throws IOException {
         final int length;
         final byte[] result;
 
@@ -102,30 +84,27 @@ public final class CharGenUDPClient extends DatagramSocketClient
         return result;
     }
 
-    /** Same as <code>send(host, CharGenUDPClient.DEFAULT_PORT);</code>
+    /**
+     * Same as <code>send(host, CharGenUDPClient.DEFAULT_PORT);</code>
+     *
      * @param host the destination host
      * @throws IOException on error
      */
-    public void send(final InetAddress host) throws IOException
-    {
+    public void send(final InetAddress host) throws IOException {
         send(host, DEFAULT_PORT);
     }
 
     /**
-     * Sends the data initiation datagram.  This data in the packet is ignored
-     * by the server, and merely serves to signal that the server should send
-     * its reply.
+     * Sends the data initiation datagram. This data in the packet is ignored by the server, and merely serves to signal that the server should send its reply.
      *
      * @param host The address of the server.
      * @param port The port of the service.
      * @throws IOException If an error occurs while sending the datagram.
      */
-    public void send(final InetAddress host, final int port) throws IOException
-    {
+    public void send(final InetAddress host, final int port) throws IOException {
         sendPacket.setAddress(host);
         sendPacket.setPort(port);
         _socket_.send(sendPacket);
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java b/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
index 2080e0fa..5c51b0d0 100644
--- a/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
+++ b/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
@@ -24,19 +24,14 @@ import java.io.InputStreamReader;
 import org.apache.commons.net.SocketClient;
 
 /**
- * The DaytimeTCPClient class is a TCP implementation of a client for the
- * Daytime protocol described in RFC 867.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link #getTime  getTime() } to retrieve the daytime
- * string, then
- * call {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to close the connection properly.
+ * The DaytimeTCPClient class is a TCP implementation of a client for the Daytime protocol described in RFC 867. To use the class, merely establish a connection
+ * with {@link org.apache.commons.net.SocketClient#connect connect } and call {@link #getTime getTime() } to retrieve the daytime string, then call
+ * {@link org.apache.commons.net.SocketClient#disconnect disconnect } to close the connection properly.
+ *
  * @see DaytimeUDPClient
  */
-public final class DaytimeTCPClient extends SocketClient
-{
-    /** The default daytime port.  It is set to 13 according to RFC 867. */
+public final class DaytimeTCPClient extends SocketClient {
+    /** The default daytime port. It is set to 13 according to RFC 867. */
     public static final int DEFAULT_PORT = 13;
 
     // Received dates will likely be less than 64 characters.
@@ -44,37 +39,28 @@ public final class DaytimeTCPClient extends SocketClient
     private final char[] buffer = new char[64];
 
     /**
-     * The default DaytimeTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
+     * The default DaytimeTCPClient constructor. It merely sets the default port to <code> DEFAULT_PORT </code>.
      */
-    public DaytimeTCPClient ()
-    {
+    public DaytimeTCPClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
     /**
-     * Retrieves the time string from the server and returns it.  The
-     * server will have closed the connection at this point, so you should
-     * call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * after calling this method.  To retrieve another time, you must
-     * initiate another connection with
-     * {@link org.apache.commons.net.SocketClient#connect  connect }
-     * before calling <code> getTime() </code> again.
+     * Retrieves the time string from the server and returns it. The server will have closed the connection at this point, so you should call
+     * {@link org.apache.commons.net.SocketClient#disconnect disconnect } after calling this method. To retrieve another time, you must initiate another
+     * connection with {@link org.apache.commons.net.SocketClient#connect connect } before calling <code> getTime() </code> again.
      *
      * @return The time string retrieved from the server.
-     * @throws IOException  If an error occurs while fetching the time string.
+     * @throws IOException If an error occurs while fetching the time string.
      */
-    public String getTime() throws IOException
-    {
+    public String getTime() throws IOException {
         int read;
         final StringBuilder result = new StringBuilder(buffer.length);
         final BufferedReader reader;
 
         reader = new BufferedReader(new InputStreamReader(_input_, getCharset()));
 
-        while (true)
-        {
+        while (true) {
             read = reader.read(buffer, 0, buffer.length);
             if (read <= 0) {
                 break;
@@ -86,4 +72,3 @@ public final class DaytimeTCPClient extends SocketClient
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java b/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
index a41a7ee3..deb439ac 100644
--- a/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
+++ b/src/main/java/org/apache/commons/net/daytime/DaytimeUDPClient.java
@@ -24,55 +24,46 @@ import java.net.InetAddress;
 import org.apache.commons.net.DatagramSocketClient;
 
 /**
- * The DaytimeUDPClient class is a UDP implementation of a client for the
- * Daytime protocol described in RFC 867.  To use the class, merely
- * open a local datagram socket with
- * {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #getTime  getTime } to retrieve the daytime
- * string, then
- * call {@link org.apache.commons.net.DatagramSocketClient#close  close }
- * to close the connection properly.  Unlike
- * {@link org.apache.commons.net.daytime.DaytimeTCPClient},
- * successive calls to {@link #getTime  getTime } are permitted
- * without re-establishing a connection.  That is because UDP is a
- * connectionless protocol and the Daytime protocol is stateless.
+ * The DaytimeUDPClient class is a UDP implementation of a client for the Daytime protocol described in RFC 867. To use the class, merely open a local datagram
+ * socket with {@link org.apache.commons.net.DatagramSocketClient#open open } and call {@link #getTime getTime } to retrieve the daytime string, then call
+ * {@link org.apache.commons.net.DatagramSocketClient#close close } to close the connection properly. Unlike
+ * {@link org.apache.commons.net.daytime.DaytimeTCPClient}, successive calls to {@link #getTime getTime } are permitted without re-establishing a connection.
+ * That is because UDP is a connectionless protocol and the Daytime protocol is stateless.
+ *
  * @see DaytimeTCPClient
  */
-public final class DaytimeUDPClient extends DatagramSocketClient
-{
-    /** The default daytime port.  It is set to 13 according to RFC 867. */
+public final class DaytimeUDPClient extends DatagramSocketClient {
+    /** The default daytime port. It is set to 13 according to RFC 867. */
     public static final int DEFAULT_PORT = 13;
 
     private final byte[] dummyData = new byte[1];
     // Received dates should be less than 256 bytes
     private final byte[] timeData = new byte[256];
 
-    /** Same as <code>getTime(host, DaytimeUDPClient.DEFAULT_PORT);</code>
+    /**
+     * Same as <code>getTime(host, DaytimeUDPClient.DEFAULT_PORT);</code>
+     *
      * @param host the host
-     * @return  the time
+     * @return the time
      * @throws IOException on error
      */
-    public String getTime(final InetAddress host) throws IOException
-    {
+    public String getTime(final InetAddress host) throws IOException {
         return getTime(host, DEFAULT_PORT);
     }
 
     /**
-     * Retrieves the time string from the specified server and port and
-     * returns it.
+     * Retrieves the time string from the specified server and port and returns it.
      *
      * @param host The address of the server.
      * @param port The port of the service.
      * @return The time string.
      * @throws IOException If an error occurs while retrieving the time.
      */
-    public String getTime(final InetAddress host, final int port) throws IOException
-    {
+    public String getTime(final InetAddress host, final int port) throws IOException {
         final DatagramPacket sendPacket;
         final DatagramPacket receivePacket;
 
-        sendPacket =
-            new DatagramPacket(dummyData, dummyData.length, host, port);
+        sendPacket = new DatagramPacket(dummyData, dummyData.length, host, port);
         receivePacket = new DatagramPacket(timeData, timeData.length);
 
         _socket_.send(sendPacket);
@@ -82,4 +73,3 @@ public final class DaytimeUDPClient extends DatagramSocketClient
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java b/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java
index 9d3c2349..669d8e43 100644
--- a/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java
+++ b/src/main/java/org/apache/commons/net/discard/DiscardTCPClient.java
@@ -22,44 +22,32 @@ import java.io.OutputStream;
 import org.apache.commons.net.SocketClient;
 
 /**
- * The DiscardTCPClient class is a TCP implementation of a client for the
- * Discard protocol described in RFC 863.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link #getOutputStream  getOutputStream() } to
- * retrieve the discard output stream.  Don't close the output stream
- * when you're done writing to it.  Rather, call
- * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to clean up properly.
+ * The DiscardTCPClient class is a TCP implementation of a client for the Discard protocol described in RFC 863. To use the class, merely establish a connection
+ * with {@link org.apache.commons.net.SocketClient#connect connect } and call {@link #getOutputStream getOutputStream() } to retrieve the discard output stream.
+ * Don't close the output stream when you're done writing to it. Rather, call {@link org.apache.commons.net.SocketClient#disconnect disconnect } to clean up
+ * properly.
  *
  * @see DiscardUDPClient
  */
 
-public class DiscardTCPClient extends SocketClient
-{
-    /** The default discard port.  It is set to 9 according to RFC 863. */
+public class DiscardTCPClient extends SocketClient {
+    /** The default discard port. It is set to 9 according to RFC 863. */
     public static final int DEFAULT_PORT = 9;
 
     /**
-     * The default DiscardTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
+     * The default DiscardTCPClient constructor. It merely sets the default port to <code> DEFAULT_PORT </code>.
      */
-    public DiscardTCPClient ()
-    {
+    public DiscardTCPClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
     /**
-     * Returns an OutputStream through which you may write data to the server.
-     * You should NOT close the OutputStream when you're finished
-     * reading from it.  Rather, you should call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * to clean up properly.
+     * Returns an OutputStream through which you may write data to the server. You should NOT close the OutputStream when you're finished reading from it.
+     * Rather, you should call {@link org.apache.commons.net.SocketClient#disconnect disconnect } to clean up properly.
      *
      * @return An OutputStream through which you can write data to the server.
      */
-    public OutputStream getOutputStream()
-    {
+    public OutputStream getOutputStream() {
         return _output_;
     }
 }
diff --git a/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java b/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java
index b6b46101..5fb9f409 100644
--- a/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java
+++ b/src/main/java/org/apache/commons/net/discard/DiscardUDPClient.java
@@ -25,75 +25,58 @@ import org.apache.commons.net.DatagramSocketClient;
 import org.apache.commons.net.util.NetConstants;
 
 /**
- * The DiscardUDPClient class is a UDP implementation of a client for the
- * Discard protocol described in RFC 863.  To use the class,
- * just open a local UDP port
- * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #send  send } to send datagrams to the server
- * After you're done sending discard data, call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
- * to clean up properly.
+ * The DiscardUDPClient class is a UDP implementation of a client for the Discard protocol described in RFC 863. To use the class, just open a local UDP port
+ * with {@link org.apache.commons.net.DatagramSocketClient#open open } and call {@link #send send } to send datagrams to the server After you're done sending
+ * discard data, call {@link org.apache.commons.net.DatagramSocketClient#close close() } to clean up properly.
  *
  * @see DiscardTCPClient
  */
 
-public class DiscardUDPClient extends DatagramSocketClient
-{
-    /** The default discard port.  It is set to 9 according to RFC 863. */
+public class DiscardUDPClient extends DatagramSocketClient {
+    /** The default discard port. It is set to 9 according to RFC 863. */
     public static final int DEFAULT_PORT = 9;
 
     private final DatagramPacket sendPacket;
 
-    public DiscardUDPClient()
-    {
+    public DiscardUDPClient() {
         sendPacket = new DatagramPacket(NetConstants.EMPTY_BTYE_ARRAY, 0);
     }
 
-
     /**
-     * Same as
-     * <code>send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
+     * Same as <code>send(data, data.length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
+     *
      * @param data the buffer to send
      * @param host the target host
      * @see #send(byte[], int, InetAddress, int)
      * @throws IOException if an error occurs
      */
-    public void send(final byte[] data, final InetAddress host) throws IOException
-    {
+    public void send(final byte[] data, final InetAddress host) throws IOException {
         send(data, data.length, host, DEFAULT_PORT);
     }
 
-
     /**
-     * Same as
-     * <code>send(data, length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
-     * @param data the buffer to send
+     * Same as <code>send(data, length, host. DiscardUDPClient.DEFAULT_PORT)</code>.
+     *
+     * @param data   the buffer to send
      * @param length the length of the data in the buffer
-     * @param host the target host
+     * @param host   the target host
      * @see #send(byte[], int, InetAddress, int)
      * @throws IOException if an error occurs
      */
-    public void send(final byte[] data, final int length, final InetAddress host)
-    throws IOException
-    {
+    public void send(final byte[] data, final int length, final InetAddress host) throws IOException {
         send(data, length, host, DEFAULT_PORT);
     }
 
-
     /**
      * Sends the specified data to the specified server at the specified port.
      *
-     * @param data  The discard data to send.
-     * @param length  The length of the data to send.  Should be less than
-     *    or equal to the length of the data byte array.
-     * @param host  The address of the server.
-     * @param port  The service port.
-     * @throws IOException If an error occurs during the datagram send
-     *            operation.
+     * @param data   The discard data to send.
+     * @param length The length of the data to send. Should be less than or equal to the length of the data byte array.
+     * @param host   The address of the server.
+     * @param port   The service port.
+     * @throws IOException If an error occurs during the datagram send operation.
      */
-    public void send(final byte[] data, final int length, final InetAddress host, final int port)
-    throws IOException
-    {
+    public void send(final byte[] data, final int length, final InetAddress host, final int port) throws IOException {
         sendPacket.setData(data);
         sendPacket.setLength(length);
         sendPacket.setAddress(host);
@@ -102,4 +85,3 @@ public class DiscardUDPClient extends DatagramSocketClient
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java b/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java
index 48f33000..77d22ab0 100644
--- a/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java
+++ b/src/main/java/org/apache/commons/net/echo/EchoTCPClient.java
@@ -22,48 +22,33 @@ import java.io.InputStream;
 import org.apache.commons.net.discard.DiscardTCPClient;
 
 /**
- * The EchoTCPClient class is a TCP implementation of a client for the
- * Echo protocol described in RFC 862.  To use the class, merely
- * establish a connection with
- * {@link org.apache.commons.net.SocketClient#connect  connect }
- * and call {@link DiscardTCPClient#getOutputStream  getOutputStream() } to
- * retrieve the echo output stream and
- * {@link #getInputStream getInputStream() }
- *  to get the echo input stream.
- * Don't close either stream when you're done using them.  Rather, call
- * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
- * to clean up properly.
+ * The EchoTCPClient class is a TCP implementation of a client for the Echo protocol described in RFC 862. To use the class, merely establish a connection with
+ * {@link org.apache.commons.net.SocketClient#connect connect } and call {@link DiscardTCPClient#getOutputStream getOutputStream() } to retrieve the echo output
+ * stream and {@link #getInputStream getInputStream() } to get the echo input stream. Don't close either stream when you're done using them. Rather, call
+ * {@link org.apache.commons.net.SocketClient#disconnect disconnect } to clean up properly.
  *
  * @see EchoUDPClient
  * @see DiscardTCPClient
  */
 
-public final class EchoTCPClient extends DiscardTCPClient
-{
-    /** The default echo port.  It is set to 7 according to RFC 862. */
+public final class EchoTCPClient extends DiscardTCPClient {
+    /** The default echo port. It is set to 7 according to RFC 862. */
     public static final int DEFAULT_PORT = 7;
 
     /**
-     * The default EchoTCPClient constructor.  It merely sets the default
-     * port to <code> DEFAULT_PORT </code>.
+     * The default EchoTCPClient constructor. It merely sets the default port to <code> DEFAULT_PORT </code>.
      */
-    public EchoTCPClient ()
-    {
+    public EchoTCPClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
     /**
-     * Returns an InputStream from which you may read echoed data from
-     * the server.  You should NOT close the InputStream when you're finished
-     * reading from it.  Rather, you should call
-     * {@link org.apache.commons.net.SocketClient#disconnect  disconnect }
-     * to clean up properly.
+     * Returns an InputStream from which you may read echoed data from the server. You should NOT close the InputStream when you're finished reading from it.
+     * Rather, you should call {@link org.apache.commons.net.SocketClient#disconnect disconnect } to clean up properly.
      *
-     * @return An InputStream from which you can read echoed data from the
-     *         server.
+     * @return An InputStream from which you can read echoed data from the server.
      */
-    public InputStream getInputStream()
-    {
+    public InputStream getInputStream() {
         return _input_;
     }
 
diff --git a/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java b/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
index 902616e6..fb4caa55 100644
--- a/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
+++ b/src/main/java/org/apache/commons/net/echo/EchoUDPClient.java
@@ -25,82 +25,65 @@ import org.apache.commons.net.discard.DiscardUDPClient;
 import org.apache.commons.net.util.NetConstants;
 
 /**
- * The EchoUDPClient class is a UDP implementation of a client for the
- * Echo protocol described in RFC 862.  To use the class,
- * just open a local UDP port
- * with {@link org.apache.commons.net.DatagramSocketClient#open  open }
- * and call {@link #send  send } to send datagrams to the server,
- * then call {@link #receive  receive } to receive echoes.
- * After you're done echoing data, call
- * {@link org.apache.commons.net.DatagramSocketClient#close  close() }
- * to clean up properly.
+ * The EchoUDPClient class is a UDP implementation of a client for the Echo protocol described in RFC 862. To use the class, just open a local UDP port with
+ * {@link org.apache.commons.net.DatagramSocketClient#open open } and call {@link #send send } to send datagrams to the server, then call {@link #receive
+ * receive } to receive echoes. After you're done echoing data, call {@link org.apache.commons.net.DatagramSocketClient#close close() } to clean up properly.
  *
  * @see EchoTCPClient
  * @see DiscardUDPClient
  */
 
-public final class EchoUDPClient extends DiscardUDPClient
-{
-    /** The default echo port.  It is set to 7 according to RFC 862. */
+public final class EchoUDPClient extends DiscardUDPClient {
+    /** The default echo port. It is set to 7 according to RFC 862. */
     public static final int DEFAULT_PORT = 7;
 
     private final DatagramPacket receivePacket = new DatagramPacket(NetConstants.EMPTY_BTYE_ARRAY, 0);
 
-    /** Same as <code> receive(data, data.length)</code>
+    /**
+     * Same as <code> receive(data, data.length)</code>
+     *
      * @param data the buffer to receive the input
      * @return the number of bytes
      * @throws IOException on error
      */
-    public int receive(final byte[] data) throws IOException
-    {
+    public int receive(final byte[] data) throws IOException {
         return receive(data, data.length);
     }
 
-
     /**
-     * Receives echoed data and returns its length.  The data may be divided
-     * up among multiple datagrams, requiring multiple calls to receive.
-     * Also, the UDP packets will not necessarily arrive in the same order
-     * they were sent.
-     * @param  data the buffer to receive the input
-     * @param length  of the buffer
+     * Receives echoed data and returns its length. The data may be divided up among multiple datagrams, requiring multiple calls to receive. Also, the UDP
+     * packets will not necessarily arrive in the same order they were sent.
      *
-     * @return  Length of actual data received.
+     * @param data   the buffer to receive the input
+     * @param length of the buffer
+     *
+     * @return Length of actual data received.
      * @throws IOException If an error occurs while receiving the data.
      */
-    public int receive(final byte[] data, final int length) throws IOException
-    {
+    public int receive(final byte[] data, final int length) throws IOException {
         receivePacket.setData(data);
         receivePacket.setLength(length);
         _socket_.receive(receivePacket);
         return receivePacket.getLength();
     }
 
-
     /** Same as <code> send(data, data.length, host) </code> */
     @Override
-    public void send(final byte[] data, final InetAddress host) throws IOException
-    {
+    public void send(final byte[] data, final InetAddress host) throws IOException {
         send(data, data.length, host, DEFAULT_PORT);
     }
 
     /**
-     * Sends the specified data to the specified server at the default echo
-     * port.
+     * Sends the specified data to the specified server at the default echo port.
      *
-     * @param data  The echo data to send.
-     * @param length  The length of the data to send.  Should be less than
-     *    or equal to the length of the data byte array.
-     * @param host  The address of the server.
-     * @throws IOException If an error occurs during the datagram send
-     *     operation.
+     * @param data   The echo data to send.
+     * @param length The length of the data to send. Should be less than or equal to the length of the data byte array.
+     * @param host   The address of the server.
+     * @throws IOException If an error occurs during the datagram send operation.
      */
     @Override
-    public void send(final byte[] data, final int length, final InetAddress host)
-    throws IOException
-    {
+    public void send(final byte[] data, final int length, final InetAddress host) throws IOException {
         send(data, length, host, DEFAULT_PORT);
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/Main.java b/src/main/java/org/apache/commons/net/examples/Main.java
index 4e2fe92a..c1ee0c22 100644
--- a/src/main/java/org/apache/commons/net/examples/Main.java
+++ b/src/main/java/org/apache/commons/net/examples/Main.java
@@ -33,23 +33,20 @@ public class Main {
 
     private static boolean fromJar() {
         final CodeSource codeSource = Main.class.getProtectionDomain().getCodeSource();
-        if ( codeSource != null) {
+        if (codeSource != null) {
             return codeSource.getLocation().getFile().endsWith(".jar");
         }
         return false; // No idea if this can happen
     }
 
     /**
-     * Helper application for example classes.
-     * Lists available classes, and provides shorthand invocation.
-     * For example:<br>
+     * Helper application for example classes. Lists available classes, and provides shorthand invocation. For example:<br>
      * <code>java -jar commons-net-examples-m.n.jar FTPClientExample -l host user password</code>
      *
-     * @param args the first argument is used to name the class; remaining arguments
-     * are passed to the target class.
+     * @param args the first argument is used to name the class; remaining arguments are passed to the target class.
      * @throws Throwable if an error occurs
      */
-    public static void main(final String[] args) throws Throwable  {
+    public static void main(final String[] args) throws Throwable {
         final Properties fp = new Properties();
         final InputStream ras = Main.class.getResourceAsStream("examples.properties");
         if (ras != null) {
@@ -59,27 +56,24 @@ public class Main {
         }
         if (args.length == 0) {
             if (Thread.currentThread().getStackTrace().length > 2) { // called by Maven
-                System.out.println("Usage: mvn -q exec:java  -Dexec.arguments=<alias or" +
-                                    " exampleClass>,<exampleClass parameters> (comma-separated, no spaces)");
-                System.out.println("Or   : mvn -q exec:java  -Dexec.args=\"<alias" +
-                                    " or exampleClass> <exampleClass parameters>\" (space separated)");
-            } else if (fromJar()) {
                 System.out.println(
-                    "Usage: java -jar commons-net-examples-m.n.jar <alias or exampleClass> <exampleClass parameters>");
+                        "Usage: mvn -q exec:java  -Dexec.arguments=<alias or" + " exampleClass>,<exampleClass parameters> (comma-separated, no spaces)");
+                System.out.println("Or   : mvn -q exec:java  -Dexec.args=\"<alias" + " or exampleClass> <exampleClass parameters>\" (space separated)");
+            } else if (fromJar()) {
+                System.out.println("Usage: java -jar commons-net-examples-m.n.jar <alias or exampleClass> <exampleClass parameters>");
             } else {
-                System.out.println("Usage: java -cp target/classes org.apache.commons.net.examples.Main" +
-                                   " <alias or exampleClass> <exampleClass parameters>");
+                System.out
+                        .println("Usage: java -cp target/classes org.apache.commons.net.examples.Main" + " <alias or exampleClass> <exampleClass parameters>");
             }
             @SuppressWarnings("unchecked") // property names are Strings
-            final
-            List<String> l = (List<String>) Collections.list(fp.propertyNames());
+            final List<String> l = (List<String>) Collections.list(fp.propertyNames());
             if (l.isEmpty()) {
                 return;
             }
             l.sort(null);
             System.out.println("\nAliases and their classes:");
-            for(final String s : l) {
-                System.out.printf("%-25s %s%n",s,fp.getProperty(s));
+            for (final String s : l) {
+                System.out.printf("%-25s %s%n", s, fp.getProperty(s));
             }
             return;
         }
@@ -92,10 +86,10 @@ public class Main {
         try {
             final Class<?> clazz = Class.forName(fullName);
             final Method m = clazz.getDeclaredMethod("main", args.getClass());
-            final String[] args2 = new String[args.length-1];
+            final String[] args2 = new String[args.length - 1];
             System.arraycopy(args, 1, args2, 0, args2.length);
             try {
-                m.invoke(null, (Object)args2);
+                m.invoke(null, (Object) args2);
             } catch (final InvocationTargetException ite) {
                 final Throwable cause = ite.getCause();
                 if (cause != null) {
diff --git a/src/main/java/org/apache/commons/net/examples/cidr/SubnetUtilsExample.java b/src/main/java/org/apache/commons/net/examples/cidr/SubnetUtilsExample.java
index 67869935..61399b41 100644
--- a/src/main/java/org/apache/commons/net/examples/cidr/SubnetUtilsExample.java
+++ b/src/main/java/org/apache/commons/net/examples/cidr/SubnetUtilsExample.java
@@ -35,22 +35,16 @@ public class SubnetUtilsExample {
 
         System.out.printf("Subnet Information for %s:%n", subnet);
         System.out.println("--------------------------------------");
-        System.out.printf("IP Address:\t\t\t%s\t[%s]%n", info.getAddress(),
-                Integer.toBinaryString(info.asInteger(info.getAddress())));
-        System.out.printf("Netmask:\t\t\t%s\t[%s]%n", info.getNetmask(),
-                Integer.toBinaryString(info.asInteger(info.getNetmask())));
+        System.out.printf("IP Address:\t\t\t%s\t[%s]%n", info.getAddress(), Integer.toBinaryString(info.asInteger(info.getAddress())));
+        System.out.printf("Netmask:\t\t\t%s\t[%s]%n", info.getNetmask(), Integer.toBinaryString(info.asInteger(info.getNetmask())));
         System.out.printf("CIDR Representation:\t\t%s%n%n", info.getCidrSignature());
 
         System.out.printf("Supplied IP Address:\t\t%s%n%n", info.getAddress());
 
-        System.out.printf("Network Address:\t\t%s\t[%s]%n", info.getNetworkAddress(),
-                Integer.toBinaryString(info.asInteger(info.getNetworkAddress())));
-        System.out.printf("Broadcast Address:\t\t%s\t[%s]%n", info.getBroadcastAddress(),
-                Integer.toBinaryString(info.asInteger(info.getBroadcastAddress())));
-        System.out.printf("Low Address:\t\t\t%s\t[%s]%n", info.getLowAddress(),
-                Integer.toBinaryString(info.asInteger(info.getLowAddress())));
-        System.out.printf("High Address:\t\t\t%s\t[%s]%n", info.getHighAddress(),
-                Integer.toBinaryString(info.asInteger(info.getHighAddress())));
+        System.out.printf("Network Address:\t\t%s\t[%s]%n", info.getNetworkAddress(), Integer.toBinaryString(info.asInteger(info.getNetworkAddress())));
+        System.out.printf("Broadcast Address:\t\t%s\t[%s]%n", info.getBroadcastAddress(), Integer.toBinaryString(info.asInteger(info.getBroadcastAddress())));
+        System.out.printf("Low Address:\t\t\t%s\t[%s]%n", info.getLowAddress(), Integer.toBinaryString(info.asInteger(info.getLowAddress())));
+        System.out.printf("High Address:\t\t\t%s\t[%s]%n", info.getHighAddress(), Integer.toBinaryString(info.asInteger(info.getHighAddress())));
 
         System.out.printf("Total usable addresses: \t%d%n", Long.valueOf(info.getAddressCountLong()));
         System.out.printf("Address List: %s%n%n", Arrays.toString(info.getAllAddresses()));
@@ -60,8 +54,7 @@ public class SubnetUtilsExample {
         try (final Scanner scanner = new Scanner(System.in)) {
             while (scanner.hasNextLine()) {
                 final String address = scanner.nextLine();
-                System.out.println("The IP address [" + address + "] is " + (info.isInRange(address) ? "" : "not ")
-                        + "within the subnet [" + subnet + "]");
+                System.out.println("The IP address [" + address + "] is " + (info.isInRange(address) ? "" : "not ") + "within the subnet [" + subnet + "]");
                 System.out.println(prompt);
             }
         }
diff --git a/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java b/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java
index aaf5029c..ac0d91e0 100644
--- a/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java
+++ b/src/main/java/org/apache/commons/net/examples/ftp/FTPClientExample.java
@@ -42,54 +42,38 @@ import org.apache.commons.net.io.CopyStreamListener;
 import org.apache.commons.net.util.TrustManagerUtils;
 
 /**
- * This is an example program demonstrating how to use the FTPClient class.
- * This program connects to an FTP server and retrieves the specified
- * file.  If the -s flag is used, it stores the local file at the FTP server.
- * Just so you can see what's happening, all reply strings are printed.
- * If the -b flag is used, a binary transfer is assumed (default is ASCII).
- * See below for further options.
+ * This is an example program demonstrating how to use the FTPClient class. This program connects to an FTP server and retrieves the specified file. If the -s
+ * flag is used, it stores the local file at the FTP server. Just so you can see what's happening, all reply strings are printed. If the -b flag is used, a
+ * binary transfer is assumed (default is ASCII). See below for further options.
  */
-public final class FTPClientExample
-{
-
-    public static final String USAGE =
-        "Expected Parameters: [options] <hostname> <username> <password> [<remote file> [<local file>]]\n" +
-        "\nDefault behavior is to download a file and use ASCII transfer mode.\n" +
-        "\t-a - use local active mode (default is local passive)\n" +
-        "\t-A - anonymous login (omit username and password parameters)\n" +
-        "\t-b - use binary transfer mode\n" +
-        "\t-c cmd - issue arbitrary command (remote is used as a parameter if provided) \n" +
-        "\t-d - list directory details using MLSD (remote is used as the pathname if provided)\n" +
-        "\t-e - use EPSV with IPv4 (default false)\n" +
-        "\t-E - encoding to use for control channel\n" +
-        "\t-f - issue FEAT command (remote and local files are ignored)\n" +
-        "\t-h - list hidden files (applies to -l and -n only)\n" +
-        "\t-i - issue SIZE command for a file\n" +
-        "\t-k secs - use keep-alive timer (setControlKeepAliveTimeout)\n" +
-        "\t-l - list files using LIST (remote is used as the pathname if provided)\n" +
-        "\t     Files are listed twice: first in raw mode, then as the formatted parsed data.\n" +
-        "\t     N.B. if the wrong server-type is used, output may be lost. Use -U or -S as necessary.\n" +
-        "\t-L - use lenient future dates (server dates may be up to 1 day into future)\n" +
-        "\t-m - list file details using MDTM (remote is used as the pathname if provided)\n" +
-        "\t-n - list file names using NLST (remote is used as the pathname if provided)\n" +
-        "\t-p true|false|protocol[,true|false] - use FTPSClient with the specified protocol and/or isImplicit setting\n" +
-        "\t-s - store file on server (upload)\n" +
-        "\t-S - systemType set server system type (e.g. UNIX VMS WINDOWS)\n" +
-        "\t-t - list file details using MLST (remote is used as the pathname if provided)\n" +
-        "\t-U - save unparseable responses\n" +
-        "\t-w msec - wait time for keep-alive reply (setControlKeepAliveReplyTimeout)\n" +
-        "\t-T  all|valid|none - use one of the built-in TrustManager implementations (none = JVM default)\n" +
-        "\t-y format - set default date format string\n" +
-        "\t-Y format - set recent date format string\n" +
-        "\t-Z timezone - set the server time zone for parsing LIST responses\n" +
-        "\t-z timezone - set the time zone for displaying MDTM, LIST, MLSD, MLST responses\n" +
-        "\t-PrH server[:port] - HTTP Proxy host and optional port[80] \n" +
-        "\t-PrU user - HTTP Proxy server username\n" +
-        "\t-PrP password - HTTP Proxy server password\n" +
-        "\t-# - add hash display during transfers\n";
-
-    private static CopyStreamListener createListener(){
-        return new CopyStreamListener(){
+public final class FTPClientExample {
+
+    public static final String USAGE = "Expected Parameters: [options] <hostname> <username> <password> [<remote file> [<local file>]]\n"
+            + "\nDefault behavior is to download a file and use ASCII transfer mode.\n" + "\t-a - use local active mode (default is local passive)\n"
+            + "\t-A - anonymous login (omit username and password parameters)\n" + "\t-b - use binary transfer mode\n"
+            + "\t-c cmd - issue arbitrary command (remote is used as a parameter if provided) \n"
+            + "\t-d - list directory details using MLSD (remote is used as the pathname if provided)\n" + "\t-e - use EPSV with IPv4 (default false)\n"
+            + "\t-E - encoding to use for control channel\n" + "\t-f - issue FEAT command (remote and local files are ignored)\n"
+            + "\t-h - list hidden files (applies to -l and -n only)\n" + "\t-i - issue SIZE command for a file\n"
+            + "\t-k secs - use keep-alive timer (setControlKeepAliveTimeout)\n" + "\t-l - list files using LIST (remote is used as the pathname if provided)\n"
+            + "\t     Files are listed twice: first in raw mode, then as the formatted parsed data.\n"
+            + "\t     N.B. if the wrong server-type is used, output may be lost. Use -U or -S as necessary.\n"
+            + "\t-L - use lenient future dates (server dates may be up to 1 day into future)\n"
+            + "\t-m - list file details using MDTM (remote is used as the pathname if provided)\n"
+            + "\t-n - list file names using NLST (remote is used as the pathname if provided)\n"
+            + "\t-p true|false|protocol[,true|false] - use FTPSClient with the specified protocol and/or isImplicit setting\n"
+            + "\t-s - store file on server (upload)\n" + "\t-S - systemType set server system type (e.g. UNIX VMS WINDOWS)\n"
+            + "\t-t - list file details using MLST (remote is used as the pathname if provided)\n" + "\t-U - save unparseable responses\n"
+            + "\t-w msec - wait time for keep-alive reply (setControlKeepAliveReplyTimeout)\n"
+            + "\t-T  all|valid|none - use one of the built-in TrustManager implementations (none = JVM default)\n"
+            + "\t-y format - set default date format string\n" + "\t-Y format - set recent date format string\n"
+            + "\t-Z timezone - set the server time zone for parsing LIST responses\n"
+            + "\t-z timezone - set the time zone for displaying MDTM, LIST, MLSD, MLST responses\n"
+            + "\t-PrH server[:port] - HTTP Proxy host and optional port[80] \n" + "\t-PrU user - HTTP Proxy server username\n"
+            + "\t-PrP password - HTTP Proxy server password\n" + "\t-# - add hash display during transfers\n";
+
+    private static CopyStreamListener createListener() {
+        return new CopyStreamListener() {
             private long megsTotal;
 
             @Override
@@ -98,8 +82,7 @@ public final class FTPClientExample
             }
 
             @Override
-            public void bytesTransferred(final long totalBytesTransferred,
-                    final int bytesTransferred, final long streamSize) {
+            public void bytesTransferred(final long totalBytesTransferred, final int bytesTransferred, final long streamSize) {
                 final long megs = totalBytesTransferred / 1000000;
                 for (long l = megsTotal; l < megs; l++) {
                     System.err.print("#");
@@ -109,8 +92,7 @@ public final class FTPClientExample
         };
     }
 
-    public static void main(final String[] args) throws UnknownHostException
-    {
+    public static void main(final String[] args) throws UnknownHostException {
         boolean storeFile = false, binaryTransfer = false, error = false, listFiles = false, listNames = false, hidden = false;
         boolean localActive = false, useEpsvWithIPv4 = false, feat = false, printHash = false;
         boolean mlst = false, mlsd = false, mdtm = false, saveUnparseable = false;
@@ -135,115 +117,83 @@ public final class FTPClientExample
         String defaultDateFormat = null;
         String recentDateFormat = null;
 
-
         int base = 0;
-        for (base = 0; base < args.length; base++)
-        {
+        for (base = 0; base < args.length; base++) {
             if (args[base].equals("-s")) {
                 storeFile = true;
-            }
-            else if (args[base].equals("-a")) {
+            } else if (args[base].equals("-a")) {
                 localActive = true;
-            }
-            else if (args[base].equals("-A")) {
+            } else if (args[base].equals("-A")) {
                 username = "anonymous";
-                password = System.getProperty("user.name")+"@"+InetAddress.getLocalHost().getHostName();
-            }
-            else if (args[base].equals("-b")) {
+                password = System.getProperty("user.name") + "@" + InetAddress.getLocalHost().getHostName();
+            } else if (args[base].equals("-b")) {
                 binaryTransfer = true;
-            }
-            else if (args[base].equals("-c")) {
+            } else if (args[base].equals("-c")) {
                 doCommand = args[++base];
                 minParams = 3;
-            }
-            else if (args[base].equals("-d")) {
+            } else if (args[base].equals("-d")) {
                 mlsd = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-e")) {
+            } else if (args[base].equals("-e")) {
                 useEpsvWithIPv4 = true;
-            }
-            else if (args[base].equals("-E")) {
+            } else if (args[base].equals("-E")) {
                 encoding = args[++base];
-            }
-            else if (args[base].equals("-f")) {
+            } else if (args[base].equals("-f")) {
                 feat = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-h")) {
+            } else if (args[base].equals("-h")) {
                 hidden = true;
-            }
-            else if (args[base].equals("-i")) {
+            } else if (args[base].equals("-i")) {
                 size = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-k")) {
+            } else if (args[base].equals("-k")) {
                 keepAliveTimeoutSeconds = Long.parseLong(args[++base]);
-            }
-            else if (args[base].equals("-l")) {
+            } else if (args[base].equals("-l")) {
                 listFiles = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-m")) {
+            } else if (args[base].equals("-m")) {
                 mdtm = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-L")) {
+            } else if (args[base].equals("-L")) {
                 lenient = true;
-            }
-            else if (args[base].equals("-n")) {
+            } else if (args[base].equals("-n")) {
                 listNames = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-p")) {
+            } else if (args[base].equals("-p")) {
                 protocol = args[++base];
-            }
-            else if (args[base].equals("-S")) {
+            } else if (args[base].equals("-S")) {
                 serverType = args[++base];
-            }
-            else if (args[base].equals("-t")) {
+            } else if (args[base].equals("-t")) {
                 mlst = true;
                 minParams = 3;
-            }
-            else if (args[base].equals("-U")) {
+            } else if (args[base].equals("-U")) {
                 saveUnparseable = true;
-            }
-            else if (args[base].equals("-w")) {
+            } else if (args[base].equals("-w")) {
                 controlKeepAliveReplyTimeoutMillis = Integer.parseInt(args[++base]);
-            }
-            else if (args[base].equals("-T")) {
+            } else if (args[base].equals("-T")) {
                 trustmgr = args[++base];
-            }
-            else if (args[base].equals("-y")) {
+            } else if (args[base].equals("-y")) {
                 defaultDateFormat = args[++base];
-            }
-            else if (args[base].equals("-Y")) {
+            } else if (args[base].equals("-Y")) {
                 recentDateFormat = args[++base];
-            }
-            else if (args[base].equals("-Z")) {
+            } else if (args[base].equals("-Z")) {
                 serverTimeZoneId = args[++base];
-            }
-            else if (args[base].equals("-z")) {
+            } else if (args[base].equals("-z")) {
                 displayTimeZoneId = args[++base];
-            }
-            else if (args[base].equals("-PrH")) {
+            } else if (args[base].equals("-PrH")) {
                 proxyHost = args[++base];
                 final String parts[] = proxyHost.split(":");
-                if (parts.length == 2){
-                    proxyHost=parts[0];
-                    proxyPort=Integer.parseInt(parts[1]);
+                if (parts.length == 2) {
+                    proxyHost = parts[0];
+                    proxyPort = Integer.parseInt(parts[1]);
                 }
-            }
-            else if (args[base].equals("-PrU")) {
+            } else if (args[base].equals("-PrU")) {
                 proxyUser = args[++base];
-            }
-            else if (args[base].equals("-PrP")) {
+            } else if (args[base].equals("-PrP")) {
                 proxyPassword = args[++base];
-            }
-            else if (args[base].equals("-#")) {
+            } else if (args[base].equals("-#")) {
                 printHash = true;
-            }
-            else {
+            } else {
                 break;
             }
         }
@@ -264,9 +214,9 @@ public final class FTPClientExample
         String server = args[base++];
         int port = 0;
         final String parts[] = server.split(":");
-        if (parts.length == 2){
-            server=parts[0];
-            port=Integer.parseInt(parts[1]);
+        if (parts.length == 2) {
+            server = parts[0];
+            port = Integer.parseInt(parts[1]);
         }
         if (username == null) {
             username = args[base++];
@@ -284,12 +234,11 @@ public final class FTPClientExample
         }
 
         final FTPClient ftp;
-        if (protocol == null ) {
-            if(proxyHost !=null) {
+        if (protocol == null) {
+            if (proxyHost != null) {
                 System.out.println("Using HTTP proxy server: " + proxyHost);
                 ftp = new FTPHTTPClient(proxyHost, proxyPort, proxyUser, proxyPassword);
-            }
-            else {
+            } else {
                 ftp = new FTPClient();
             }
         } else {
@@ -348,37 +297,29 @@ public final class FTPClientExample
         }
         ftp.configure(config);
 
-        try
-        {
+        try {
             final int reply;
             if (port > 0) {
                 ftp.connect(server, port);
             } else {
                 ftp.connect(server);
             }
-            System.out.println("Connected to " + server + " on " + (port>0 ? port : ftp.getDefaultPort()));
+            System.out.println("Connected to " + server + " on " + (port > 0 ? port : ftp.getDefaultPort()));
 
             // After connection attempt, you should check the reply code to verify
             // success.
             reply = ftp.getReplyCode();
 
-            if (!FTPReply.isPositiveCompletion(reply))
-            {
+            if (!FTPReply.isPositiveCompletion(reply)) {
                 ftp.disconnect();
                 System.err.println("FTP server refused connection.");
                 System.exit(1);
             }
-        }
-        catch (final IOException e)
-        {
-            if (ftp.isConnected())
-            {
-                try
-                {
+        } catch (final IOException e) {
+            if (ftp.isConnected()) {
+                try {
                     ftp.disconnect();
-                }
-                catch (final IOException f)
-                {
+                } catch (final IOException f) {
                     // do nothing
                 }
             }
@@ -387,11 +328,8 @@ public final class FTPClientExample
             System.exit(1);
         }
 
-__main:
-        try
-        {
-            if (!ftp.login(username, password))
-            {
+        __main: try {
+            if (!ftp.login(username, password)) {
                 ftp.logout();
                 error = true;
                 break __main;
@@ -417,8 +355,7 @@ __main:
 
             ftp.setUseEPSVwithIPv4(useEpsvWithIPv4);
 
-            if (storeFile)
-            {
+            if (storeFile) {
                 try (final InputStream input = new FileInputStream(local)) {
                     ftp.storeFile(remote, input);
                 }
@@ -428,8 +365,7 @@ __main:
                 }
             }
             // Allow multiple list types for single invocation
-            else if (listFiles || mlsd || mdtm || mlst || listNames || size)
-            {
+            else if (listFiles || mlsd || mdtm || mlst || listNames || size) {
                 if (mlsd) {
                     for (final FTPFile f : ftp.mlistDir(remote)) {
                         System.out.println(f.getRawListing());
@@ -447,7 +383,7 @@ __main:
                 }
                 if (mlst) {
                     final FTPFile f = ftp.mlistFile(remote);
-                    if (f != null){
+                    if (f != null) {
                         System.out.println(f.toFormattedString(displayTimeZoneId));
                     }
                 }
@@ -457,7 +393,7 @@ __main:
                     }
                 }
                 if (size) {
-                    System.out.println("Size="+ftp.getSize(remote));
+                    System.out.println("Size=" + ftp.getSize(remote));
                 }
                 // Do this last because it changes the client
                 if (listFiles) {
@@ -466,7 +402,7 @@ __main:
                         if (serverTimeZoneId != null) {
                             config.setServerTimeZoneId(serverTimeZoneId);
                         }
-                        ftp.configure(config );
+                        ftp.configure(config);
                     }
 
                     for (final FTPFile f : ftp.listFiles(remote)) {
@@ -474,49 +410,43 @@ __main:
                         System.out.println(f.toFormattedString(displayTimeZoneId));
                     }
                 }
-            }
-            else if (feat)
-            {
+            } else if (feat) {
                 // boolean feature check
                 if (remote != null) { // See if the command is present
                     if (ftp.hasFeature(remote)) {
-                        System.out.println("Has feature: "+remote);
+                        System.out.println("Has feature: " + remote);
                     } else if (FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
-                        System.out.println("FEAT "+remote+" was not detected");
+                        System.out.println("FEAT " + remote + " was not detected");
                     } else {
-                        System.out.println("Command failed: "+ftp.getReplyString());
+                        System.out.println("Command failed: " + ftp.getReplyString());
                     }
 
                     // Strings feature check
-                    final String []features = ftp.featureValues(remote);
+                    final String[] features = ftp.featureValues(remote);
                     if (features != null) {
-                        for(final String f : features) {
-                            System.out.println("FEAT "+remote+"="+f+".");
+                        for (final String f : features) {
+                            System.out.println("FEAT " + remote + "=" + f + ".");
                         }
                     } else if (FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
-                        System.out.println("FEAT "+remote+" is not present");
+                        System.out.println("FEAT " + remote + " is not present");
                     } else {
-                        System.out.println("Command failed: "+ftp.getReplyString());
+                        System.out.println("Command failed: " + ftp.getReplyString());
                     }
                 } else if (ftp.features()) {
 //                        Command listener has already printed the output
                 } else {
-                    System.out.println("Failed: "+ftp.getReplyString());
+                    System.out.println("Failed: " + ftp.getReplyString());
                 }
-            }
-            else if (doCommand != null)
-            {
+            } else if (doCommand != null) {
                 if (ftp.doCommand(doCommand, remote)) {
 //                  Command listener has already printed the output
 //                    for(String s : ftp.getReplyStrings()) {
 //                        System.out.println(s);
 //                    }
                 } else {
-                    System.out.println("Failed: "+ftp.getReplyString());
+                    System.out.println("Failed: " + ftp.getReplyString());
                 }
-            }
-            else
-            {
+            } else {
                 try (final OutputStream output = new FileOutputStream(local)) {
                     ftp.retrieveFile(remote, output);
                 }
@@ -529,28 +459,18 @@ __main:
             ftp.noop(); // check that control connection is working OK
 
             ftp.logout();
-        }
-        catch (final FTPConnectionClosedException e)
-        {
+        } catch (final FTPConnectionClosedException e) {
             error = true;
             System.err.println("Server closed connection.");
             e.printStackTrace();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             error = true;
             e.printStackTrace();
-        }
-        finally
-        {
-            if (ftp.isConnected())
-            {
-                try
-                {
+        } finally {
+            if (ftp.isConnected()) {
+                try {
                     ftp.disconnect();
-                }
-                catch (final IOException f)
-                {
+                } catch (final IOException f) {
                     // do nothing
                 }
             }
@@ -561,10 +481,8 @@ __main:
 
     private static void showCslStats(final FTPClient ftp) {
         @SuppressWarnings("deprecation") // debug code
-        final
-        int []stats = ftp.getCslDebug();
-        System.out.println("CslDebug="+Arrays.toString(stats));
+        final int[] stats = ftp.getCslDebug();
+        System.out.println("CslDebug=" + Arrays.toString(stats));
 
     }
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/ftp/ServerToServerFTP.java b/src/main/java/org/apache/commons/net/examples/ftp/ServerToServerFTP.java
index 908deade..86631d3a 100644
--- a/src/main/java/org/apache/commons/net/examples/ftp/ServerToServerFTP.java
+++ b/src/main/java/org/apache/commons/net/examples/ftp/ServerToServerFTP.java
@@ -27,20 +27,15 @@ import org.apache.commons.net.ftp.FTPClient;
 import org.apache.commons.net.ftp.FTPReply;
 
 /**
- * This is an example program demonstrating how to use the FTPClient class.
- * This program arranges a server to server file transfer that transfers
- * a file from host1 to host2.  Keep in mind, this program might only work
- * if host2 is the same as the host you run it on (for security reasons,
- * some ftp servers only allow PORT commands to be issued with a host
- * argument equal to the client host).
+ * This is an example program demonstrating how to use the FTPClient class. This program arranges a server to server file transfer that transfers a file from
+ * host1 to host2. Keep in mind, this program might only work if host2 is the same as the host you run it on (for security reasons, some ftp servers only allow
+ * PORT commands to be issued with a host argument equal to the client host).
  * <p>
  * Usage: ftp <host1> <user1> <pass1> <file1> <host2> <user2> <pass2> <file2>
  */
-public final class ServerToServerFTP
-{
+public final class ServerToServerFTP {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         String server1;
         final String username1;
         final String password1;
@@ -49,24 +44,21 @@ public final class ServerToServerFTP
         final String username2;
         final String password2;
         final String file2;
-        String [] parts;
-        int port1=0, port2=0;
+        String[] parts;
+        int port1 = 0, port2 = 0;
         final FTPClient ftp1;
         final FTPClient ftp2;
         final ProtocolCommandListener listener;
 
-        if (args.length < 8)
-        {
-            System.err.println(
-                "Usage: ftp <host1> <user1> <pass1> <file1> <host2> <user2> <pass2> <file2>"
-            );
+        if (args.length < 8) {
+            System.err.println("Usage: ftp <host1> <user1> <pass1> <file1> <host2> <user2> <pass2> <file2>");
             System.exit(1);
         }
 
         server1 = args[0];
         parts = server1.split(":");
         if (parts.length == 2) {
-            server1=parts[0];
+            server1 = parts[0];
             port1 = Integer.parseInt(parts[1]);
         }
         username1 = args[1];
@@ -75,7 +67,7 @@ public final class ServerToServerFTP
         server2 = args[4];
         parts = server2.split(":");
         if (parts.length == 2) {
-            server2=parts[0];
+            server2 = parts[0];
             port2 = Integer.parseInt(parts[1]);
         }
         username2 = args[5];
@@ -88,8 +80,7 @@ public final class ServerToServerFTP
         ftp2 = new FTPClient();
         ftp2.addProtocolCommandListener(listener);
 
-        try
-        {
+        try {
             final int reply;
             if (port1 > 0) {
                 ftp1.connect(server1, port1);
@@ -100,23 +91,16 @@ public final class ServerToServerFTP
 
             reply = ftp1.getReplyCode();
 
-            if (!FTPReply.isPositiveCompletion(reply))
-            {
+            if (!FTPReply.isPositiveCompletion(reply)) {
                 ftp1.disconnect();
                 System.err.println("FTP server1 refused connection.");
                 System.exit(1);
             }
-        }
-        catch (final IOException e)
-        {
-            if (ftp1.isConnected())
-            {
-                try
-                {
+        } catch (final IOException e) {
+            if (ftp1.isConnected()) {
+                try {
                     ftp1.disconnect();
-                }
-                catch (final IOException f)
-                {
+                } catch (final IOException f) {
                     // do nothing
                 }
             }
@@ -125,8 +109,7 @@ public final class ServerToServerFTP
             System.exit(1);
         }
 
-        try
-        {
+        try {
             final int reply;
             if (port2 > 0) {
                 ftp2.connect(server2, port2);
@@ -137,23 +120,16 @@ public final class ServerToServerFTP
 
             reply = ftp2.getReplyCode();
 
-            if (!FTPReply.isPositiveCompletion(reply))
-            {
+            if (!FTPReply.isPositiveCompletion(reply)) {
                 ftp2.disconnect();
                 System.err.println("FTP server2 refused connection.");
                 System.exit(1);
             }
-        }
-        catch (final IOException e)
-        {
-            if (ftp2.isConnected())
-            {
-                try
-                {
+        } catch (final IOException e) {
+            if (ftp2.isConnected()) {
+                try {
                     ftp2.disconnect();
-                }
-                catch (final IOException f)
-                {
+                } catch (final IOException f) {
                     // do nothing
                 }
             }
@@ -162,17 +138,13 @@ public final class ServerToServerFTP
             System.exit(1);
         }
 
-__main:
-        try
-        {
-            if (!ftp1.login(username1, password1))
-            {
+        __main: try {
+            if (!ftp1.login(username1, password1)) {
                 System.err.println("Could not login to " + server1);
                 break __main;
             }
 
-            if (!ftp2.login(username2, password2))
-            {
+            if (!ftp2.login(username2, password2)) {
                 System.err.println("Could not login to " + server2);
                 break __main;
             }
@@ -180,57 +152,43 @@ __main:
             // Let's just assume success for now.
             ftp2.enterRemotePassiveMode();
 
-            ftp1.enterRemoteActiveMode(InetAddress.getByName(ftp2.getPassiveHost()),
-                                       ftp2.getPassivePort());
+            ftp1.enterRemoteActiveMode(InetAddress.getByName(ftp2.getPassiveHost()), ftp2.getPassivePort());
 
             // Although you would think the store command should be sent to server2
             // first, in reality, ftp servers like wu-ftpd start accepting data
-            // connections right after entering passive mode.  Additionally, they
+            // connections right after entering passive mode. Additionally, they
             // don't even send the positive preliminary reply until after the
             // transfer is completed (in the case of passive mode transfers).
             // Therefore, calling store first would hang waiting for a preliminary
             // reply.
             if (!ftp1.remoteRetrieve(file1) || !ftp2.remoteStoreUnique(file2)) {
-                System.err.println(
-                    "Couldn't initiate transfer. Check that file names are valid.");
+                System.err.println("Couldn't initiate transfer. Check that file names are valid.");
                 break __main;
             }
-            //      if(ftp1.remoteRetrieve(file1) && ftp2.remoteStore(file2)) {
+            // if(ftp1.remoteRetrieve(file1) && ftp2.remoteStore(file2)) {
             // We have to fetch the positive completion reply.
             ftp1.completePendingCommand();
             ftp2.completePendingCommand();
 
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
-        }
-        finally
-        {
-            try
-            {
-                if (ftp1.isConnected())
-                {
+        } finally {
+            try {
+                if (ftp1.isConnected()) {
                     ftp1.logout();
                     ftp1.disconnect();
                 }
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 // do nothing
             }
 
-            try
-            {
-                if (ftp2.isConnected())
-                {
+            try {
+                if (ftp2.isConnected()) {
                     ftp2.logout();
                     ftp2.disconnect();
                 }
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 // do nothing
             }
         }
diff --git a/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java b/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java
index e89936c0..bb0455b0 100644
--- a/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java
+++ b/src/main/java/org/apache/commons/net/examples/ftp/TFTPExample.java
@@ -30,52 +30,29 @@ import org.apache.commons.net.tftp.TFTPClient;
 import org.apache.commons.net.tftp.TFTPPacket;
 
 /**
- * This is an example of a simple Java tftp client.
- * Notice how all of the code is really just argument processing and
- * error handling.
+ * This is an example of a simple Java tftp client. Notice how all of the code is really just argument processing and error handling.
  * <p>
- * Usage: tftp [options] hostname localfile remotefile
- * hostname   - The name of the remote host, with optional :port
- * localfile  - The name of the local file to send or the name to use for
- *              the received file
- * remotefile - The name of the remote file to receive or the name for
- *              the remote server to use to name the local file being sent.
- * options: (The default is to assume -r -b)
- *        -s Send a local file
- *        -r Receive a remote file
- *        -a Use ASCII transfer mode
- *        -b Use binary transfer mode
+ * Usage: tftp [options] hostname localfile remotefile hostname - The name of the remote host, with optional :port localfile - The name of the local file to
+ * send or the name to use for the received file remotefile - The name of the remote file to receive or the name for the remote server to use to name the local
+ * file being sent. options: (The default is to assume -r -b) -s Send a local file -r Receive a remote file -a Use ASCII transfer mode -b Use binary transfer
+ * mode
  */
-public final class TFTPExample
-{
-    static final String USAGE =
-        "Usage: tftp [options] hostname localfile remotefile\n\n" +
-        "hostname   - The name of the remote host [:port]\n" +
-        "localfile  - The name of the local file to send or the name to use for\n" +
-        "\tthe received file\n" +
-        "remotefile - The name of the remote file to receive or the name for\n" +
-        "\tthe remote server to use to name the local file being sent.\n\n" +
-        "options: (The default is to assume -r -b)\n" +
-        "\t-t timeout in seconds (default 60s)\n" +
-        "\t-s Send a local file\n" +
-        "\t-r Receive a remote file\n" +
-        "\t-a Use ASCII transfer mode\n" +
-        "\t-b Use binary transfer mode\n" +
-        "\t-v Verbose (trace packets)\n"
-        ;
+public final class TFTPExample {
+    static final String USAGE = "Usage: tftp [options] hostname localfile remotefile\n\n" + "hostname   - The name of the remote host [:port]\n"
+            + "localfile  - The name of the local file to send or the name to use for\n" + "\tthe received file\n"
+            + "remotefile - The name of the remote file to receive or the name for\n" + "\tthe remote server to use to name the local file being sent.\n\n"
+            + "options: (The default is to assume -r -b)\n" + "\t-t timeout in seconds (default 60s)\n" + "\t-s Send a local file\n"
+            + "\t-r Receive a remote file\n" + "\t-a Use ASCII transfer mode\n" + "\t-b Use binary transfer mode\n" + "\t-v Verbose (trace packets)\n";
 
     private static boolean close(final TFTPClient tftp, final Closeable output) {
         boolean closed;
         tftp.close();
-        try
-        {
+        try {
             if (output != null) {
                 output.close();
             }
             closed = true;
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             closed = false;
             System.err.println("Error: error closing file.");
             System.err.println(e.getMessage());
@@ -83,8 +60,7 @@ public final class TFTPExample
         return closed;
     }
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         boolean receiveFile = true, closed;
         int transferMode = TFTP.BINARY_MODE, argc;
         String arg;
@@ -96,8 +72,7 @@ public final class TFTPExample
         boolean verbose = false;
 
         // Parse options
-        for (argc = 0; argc < args.length; argc++)
-        {
+        for (argc = 0; argc < args.length; argc++) {
             arg = args[argc];
             if (!arg.startsWith("-")) {
                 break;
@@ -122,8 +97,7 @@ public final class TFTPExample
         }
 
         // Make sure there are enough arguments
-        if (args.length - argc != 3)
-        {
+        if (args.length - argc != 3) {
             System.err.println("Error: invalid number of arguments.");
             System.err.print(USAGE);
             System.exit(1);
@@ -153,15 +127,14 @@ public final class TFTPExample
         closed = false;
 
         // If we're receiving a file, receive, otherwise send.
-        if (receiveFile)
-        {
+        if (receiveFile) {
             closed = receive(transferMode, hostname, localFilename, remoteFilename, tftp);
         } else {
             // We're sending a file
             closed = send(transferMode, hostname, localFilename, remoteFilename, tftp);
         }
 
-        System.out.println("Recd: "+tftp.getTotalBytesReceived()+" Sent: "+tftp.getTotalBytesSent());
+        System.out.println("Recd: " + tftp.getTotalBytesReceived() + " Sent: " + tftp.getTotalBytesSent());
 
         if (!closed) {
             System.out.println("Failed");
@@ -172,18 +145,15 @@ public final class TFTPExample
     }
 
     private static void open(final TFTPClient tftp) {
-        try
-        {
+        try {
             tftp.open();
-        }
-        catch (final SocketException e)
-        {
+        } catch (final SocketException e) {
             throw new RuntimeException("Error: could not open local UDP socket.", e);
         }
     }
 
-    private static boolean receive(final int transferMode, final String hostname, final String localFilename,
-            final String remoteFilename, final TFTPClient tftp) {
+    private static boolean receive(final int transferMode, final String hostname, final String localFilename, final String remoteFilename,
+            final TFTPClient tftp) {
         final boolean closed;
         FileOutputStream output = null;
         final File file;
@@ -191,19 +161,15 @@ public final class TFTPExample
         file = new File(localFilename);
 
         // If file exists, don't overwrite it.
-        if (file.exists())
-        {
+        if (file.exists()) {
             System.err.println("Error: " + localFilename + " already exists.");
             return false;
         }
 
         // Try to open local file for writing
-        try
-        {
+        try {
             output = new FileOutputStream(file);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             tftp.close();
             throw new RuntimeException("Error: could not open local file for writing.", e);
         }
@@ -211,30 +177,22 @@ public final class TFTPExample
         open(tftp);
 
         // Try to receive remote file via TFTP
-        try
-        {
-            final String [] parts = hostname.split(":");
+        try {
+            final String[] parts = hostname.split(":");
             if (parts.length == 2) {
                 tftp.receiveFile(remoteFilename, transferMode, output, parts[0], Integer.parseInt(parts[1]));
             } else {
                 tftp.receiveFile(remoteFilename, transferMode, output, hostname);
             }
-        }
-        catch (final UnknownHostException e)
-        {
+        } catch (final UnknownHostException e) {
             System.err.println("Error: could not resolve hostname.");
             System.err.println(e.getMessage());
             System.exit(1);
-        }
-        catch (final IOException e)
-        {
-            System.err.println(
-                "Error: I/O exception occurred while receiving file.");
+        } catch (final IOException e) {
+            System.err.println("Error: I/O exception occurred while receiving file.");
             System.err.println(e.getMessage());
             System.exit(1);
-        }
-        finally
-        {
+        } finally {
             // Close local socket and output file
             closed = close(tftp, output);
         }
@@ -242,18 +200,14 @@ public final class TFTPExample
         return closed;
     }
 
-    private static boolean send(final int transferMode, final String hostname, final String localFilename,
-            final String remoteFilename, final TFTPClient tftp) {
+    private static boolean send(final int transferMode, final String hostname, final String localFilename, final String remoteFilename, final TFTPClient tftp) {
         final boolean closed;
         FileInputStream input = null;
 
         // Try to open local file for reading
-        try
-        {
+        try {
             input = new FileInputStream(localFilename);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             tftp.close();
             throw new RuntimeException("Error: could not open local file for reading.", e);
         }
@@ -261,29 +215,22 @@ public final class TFTPExample
         open(tftp);
 
         // Try to send local file via TFTP
-        try
-        {
-            final String [] parts = hostname.split(":");
+        try {
+            final String[] parts = hostname.split(":");
             if (parts.length == 2) {
                 tftp.sendFile(remoteFilename, transferMode, input, parts[0], Integer.parseInt(parts[1]));
             } else {
                 tftp.sendFile(remoteFilename, transferMode, input, hostname);
             }
-        }
-        catch (final UnknownHostException e)
-        {
+        } catch (final UnknownHostException e) {
             System.err.println("Error: could not resolve hostname.");
             System.err.println(e.getMessage());
             System.exit(1);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Error: I/O exception occurred while sending file.");
             System.err.println(e.getMessage());
             System.exit(1);
-        }
-        finally
-        {
+        } finally {
             // Close local socket and input file
             closed = close(tftp, input);
         }
@@ -292,5 +239,3 @@ public final class TFTPExample
     }
 
 }
-
-
diff --git a/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java b/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java
index c6fffd82..3f3d59fe 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/IMAPExportMbox.java
@@ -42,8 +42,8 @@ import org.apache.commons.net.imap.IMAPClient;
 import org.apache.commons.net.imap.IMAPReply;
 
 /**
- * This is an example program demonstrating how to use the IMAP[S]Client class.
- * This program connects to a IMAP[S] server and exports selected messages from a folder into an mbox file.
+ * This is an example program demonstrating how to use the IMAP[S]Client class. This program connects to a IMAP[S] server and exports selected messages from a
+ * folder into an mbox file.
  * <p>
  * Usage: IMAPExportMbox imap[s]://user:password@host[:port]/folder/path <mboxfile> [sequence-set] [item-names]
  * <p>
@@ -72,14 +72,12 @@ import org.apache.commons.net.imap.IMAPReply;
  * IMAPExportMbox imaps://username:password@imap.googlemail.com/messages_for_export exported.mbox 3 ENVELOPE X-GM-LABELS<br>
  * <p>
  * The sequence-set is passed unmodified to the FETCH command.<br>
- * The item names are wrapped in parentheses if more than one is provided.
- * Otherwise, the parameter is assumed to be wrapped if necessary.<br>
+ * The item names are wrapped in parentheses if more than one is provided. Otherwise, the parameter is assumed to be wrapped if necessary.<br>
  * Parameters with spaces must be quoted otherwise the OS shell will normally treat them as separate parameters.<br>
- * Also the listener that writes the mailbox only captures the multi-line responses (e.g. ones that include BODY references).
- * It does not capture the output from FETCH commands using item names such as ENVELOPE or FLAGS that return a single line response.
+ * Also the listener that writes the mailbox only captures the multi-line responses (e.g. ones that include BODY references). It does not capture the output
+ * from FETCH commands using item names such as ENVELOPE or FLAGS that return a single line response.
  */
-public final class IMAPExportMbox
-{
+public final class IMAPExportMbox {
 
     private static class MboxListener implements IMAPChunkListener {
 
@@ -90,7 +88,7 @@ public final class IMAPExportMbox
         volatile long lastSeq = -1;
         private final String lineSeparator;
         private final SimpleDateFormat DATE_FORMAT // for mbox From_ lines
-            = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
+                = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
 
         // e.g. INTERNALDATE "27-Oct-2013 07:43:24 +0000"
         // for parsing INTERNALDATE
@@ -99,8 +97,8 @@ public final class IMAPExportMbox
         private final boolean printMarker;
         private final boolean checkSequence;
 
-        MboxListener(final BufferedWriter bufferedWriter, final String lineSeparator, final boolean printHash,
-            final boolean printMarker, final boolean checkSequence) {
+        MboxListener(final BufferedWriter bufferedWriter, final String lineSeparator, final boolean printHash, final boolean printMarker,
+                final boolean checkSequence) {
             this.lineSeparator = lineSeparator;
             this.printHash = printHash;
             this.printMarker = printMarker;
@@ -118,7 +116,7 @@ public final class IMAPExportMbox
             if (m.lookingAt()) { // found a match
                 final String date = m.group(PATID_DATE_GROUP);
                 try {
-                    received=IDPARSE.parse(date);
+                    received = IDPARSE.parse(date);
                 } catch (final ParseException e) {
                     System.err.println(e);
                 }
@@ -126,7 +124,7 @@ public final class IMAPExportMbox
                 System.err.println("No timestamp found in: " + firstLine + "  - using current time");
             }
             String replyTo = "MAILER-DAEMON"; // default
-            for(int i=1; i< replyStrings.length - 1; i++) {
+            for (int i = 1; i < replyStrings.length - 1; i++) {
                 final String line = replyStrings[i];
                 if (line.startsWith("Return-Path: ")) {
                     final String[] parts = line.split(" ", 2);
@@ -134,9 +132,9 @@ public final class IMAPExportMbox
                         replyTo = parts[1];
                         if (replyTo.startsWith("<")) {
                             if (replyTo.endsWith(">")) {
-                                replyTo = replyTo.substring(1,replyTo.length()-1); // drop <> wrapper
+                                replyTo = replyTo.substring(1, replyTo.length() - 1); // drop <> wrapper
                             } else {
-                                System.err.println("Unexpected Return-path: '" + line+ "' in " + firstLine);
+                                System.err.println("Unexpected Return-path: '" + line + "' in " + firstLine);
                             }
                         }
                     }
@@ -156,19 +154,19 @@ public final class IMAPExportMbox
                     System.err.println("[" + total + "] " + firstLine);
                 }
                 // Skip first and last lines
-                for(int i=1; i< replyStrings.length - 1; i++) {
+                for (int i = 1; i < replyStrings.length - 1; i++) {
                     final String line = replyStrings[i];
-                        if (startsWith(line, PATFROM)) {
-                            bufferedWriter.append('>'); // Escape a From_ line
-                        }
-                        bufferedWriter.append(line);
-                        bufferedWriter.append(lineSeparator);
+                    if (startsWith(line, PATFROM)) {
+                        bufferedWriter.append('>'); // Escape a From_ line
+                    }
+                    bufferedWriter.append(line);
+                    bufferedWriter.append(lineSeparator);
                 }
                 // The last line ends with the trailing closing ")" which needs to be stripped
-                final String lastLine = replyStrings[replyStrings.length-1];
+                final String lastLine = replyStrings[replyStrings.length - 1];
                 final int lastLength = lastLine.length();
                 if (lastLength > 1) { // there's some content, we need to save it
-                    bufferedWriter.append(lastLine, 0, lastLength-1);
+                    bufferedWriter.append(lastLine, 0, lastLength - 1);
                     bufferedWriter.append(lineSeparator);
                 }
                 bufferedWriter.append(lineSeparator); // blank line between entries
@@ -185,11 +183,10 @@ public final class IMAPExportMbox
                     if (lastSeq != -1) {
                         final long missing = msgSeq - lastSeq - 1;
                         if (missing != 0) {
-                            for(long j = lastSeq + 1; j < msgSeq; j++) {
+                            for (long j = lastSeq + 1; j < msgSeq; j++) {
                                 missingIds.add(String.valueOf(j));
                             }
-                            System.err.println(
-                                "*** Sequence error: current=" + msgSeq + " previous=" + lastSeq + " Missing=" + missing);
+                            System.err.println("*** Sequence error: current=" + msgSeq + " previous=" + lastSeq + " Missing=" + missing);
                         }
                     }
                     lastSeq = msgSeq;
@@ -207,12 +204,13 @@ public final class IMAPExportMbox
             }
         }
     }
+
     private static final String CRLF = "\r\n";
     private static final String LF = "\n";
 
     private static final String EOL_DEFAULT = System.getProperty("line.separator");
     private static final Pattern PATFROM = Pattern.compile(">*From "); // unescaped From_
-    // e.g. * nnn (INTERNALDATE "27-Oct-2013 07:43:24 +0000"  BODY[] {nn} ...)
+    // e.g. * nnn (INTERNALDATE "27-Oct-2013 07:43:24 +0000" BODY[] {nn} ...)
     private static final Pattern PATID = // INTERNALDATE
             Pattern.compile(".*INTERNALDATE \"(\\d\\d-\\w{3}-\\d{4} \\d\\d:\\d\\d:\\d\\d [+-]\\d+)\"");
 
@@ -230,8 +228,7 @@ public final class IMAPExportMbox
 
     private static final int READ_TIMEOUT = 10;
 
-    public static void main(final String[] args) throws IOException, URISyntaxException
-    {
+    public static void main(final String[] args) throws IOException, URISyntaxException {
         int connect_timeout = CONNECT_TIMEOUT;
         int read_timeout = READ_TIMEOUT;
 
@@ -241,7 +238,7 @@ public final class IMAPExportMbox
         boolean printMarker = false;
         int retryWaitSecs = 0;
 
-        for(argIdx = 0; argIdx < args.length; argIdx++) {
+        for (argIdx = 0; argIdx < args.length; argIdx++) {
             if (args[argIdx].equals("-c")) {
                 connect_timeout = Integer.parseInt(args[++argIdx]);
             } else if (args[argIdx].equals("-r")) {
@@ -263,10 +260,9 @@ public final class IMAPExportMbox
 
         final int argCount = args.length - argIdx;
 
-        if (argCount < 2)
-        {
-            System.err.println("Usage: IMAPExportMbox [-LF|-CRLF] [-c n] [-r n] [-R n] [-.] [-X]" +
-                               " imap[s]://user:password@host[:port]/folder/path [+|-]<mboxfile> [sequence-set] [itemnames]");
+        if (argCount < 2) {
+            System.err.println("Usage: IMAPExportMbox [-LF|-CRLF] [-c n] [-r n] [-R n] [-.] [-X]"
+                    + " imap[s]://user:password@host[:port]/folder/path [+|-]<mboxfile> [sequence-set] [itemnames]");
             System.err.println("\t-LF | -CRLF set end-of-line to LF or CRLF (default is the line.separator system property)");
             System.err.println("\t-c connect timeout in seconds (default 10)");
             System.err.println("\t-r read timeout in seconds (default 10)");
@@ -276,8 +272,8 @@ public final class IMAPExportMbox
             System.err.println("\tthe mboxfile is where the messages are stored; use '-' to write to standard output.");
             System.err.println("\tPrefix file name with '+' to append to the file. Prefix with '-' to allow overwrite.");
             System.err.println("\ta sequence-set is a list of numbers/number ranges e.g. 1,2,3-10,20:* - default 1:*");
-            System.err.println("\titemnames are the message data item name(s) e.g. BODY.PEEK[HEADER.FIELDS (SUBJECT)]" +
-                               " or a macro e.g. ALL - default (INTERNALDATE BODY.PEEK[])");
+            System.err.println("\titemnames are the message data item name(s) e.g. BODY.PEEK[HEADER.FIELDS (SUBJECT)]"
+                    + " or a macro e.g. ALL - default (INTERNALDATE BODY.PEEK[])");
             System.exit(1);
         }
 
@@ -285,7 +281,7 @@ public final class IMAPExportMbox
         URI uri;
         try {
             uri = URI.create(uriString);
-        } catch(final IllegalArgumentException e) { // cannot parse the path as is; let's pull it apart and try again
+        } catch (final IllegalArgumentException e) { // cannot parse the path as is; let's pull it apart and try again
             final Matcher m = Pattern.compile("(imaps?://[^/]+)(/.*)").matcher(uriString);
             if (!m.matches()) {
                 throw e;
@@ -293,7 +289,7 @@ public final class IMAPExportMbox
             uri = URI.create(m.group(1)); // Just the scheme and auth parts
             uri = new URI(uri.getScheme(), uri.getAuthority(), m.group(2), null, null);
         }
-        final String file  = args[argIdx++];
+        final String file = args[argIdx++];
         String sequenceSet = argCount > 2 ? args[argIdx++] : "1:*";
         final String itemNames;
         // Handle 0, 1 or multiple item names
@@ -301,8 +297,8 @@ public final class IMAPExportMbox
             if (argCount > 4) {
                 final StringBuilder sb = new StringBuilder();
                 sb.append("(");
-                for(int i=4; i <= argCount; i++) {
-                    if (i>4) {
+                for (int i = 4; i <= argCount; i++) {
+                    if (i > 4) {
                         sb.append(" ");
                     }
                     sb.append(args[argIdx++]);
@@ -323,21 +319,18 @@ public final class IMAPExportMbox
         } else if (file.startsWith("+")) {
             final File mbox = new File(file.substring(1));
             System.out.println("Appending to file " + mbox);
-            mboxListener = new MboxListener(
-                new BufferedWriter(new FileWriter(mbox, true)), eol, printHash, printMarker, checkSequence);
+            mboxListener = new MboxListener(new BufferedWriter(new FileWriter(mbox, true)), eol, printHash, printMarker, checkSequence);
         } else if (file.startsWith("-")) {
             final File mbox = new File(file.substring(1));
             System.out.println("Writing to file " + mbox);
-            mboxListener = new MboxListener(
-                new BufferedWriter(new FileWriter(mbox, false)), eol, printHash, printMarker, checkSequence);
+            mboxListener = new MboxListener(new BufferedWriter(new FileWriter(mbox, false)), eol, printHash, printMarker, checkSequence);
         } else {
             final File mboxFile = new File(file);
             if (mboxFile.exists() && mboxFile.length() > 0) {
                 throw new IOException("mailbox file: " + mboxFile + " already exists and is non-empty!");
             }
             System.out.println("Creating file " + mboxFile);
-            mboxListener = new MboxListener(new BufferedWriter(new FileWriter(mboxFile)), eol, printHash, printMarker,
-                    checkSequence);
+            mboxListener = new MboxListener(new BufferedWriter(new FileWriter(mboxFile)), eol, printHash, printMarker, checkSequence);
         }
 
         final String path = uri.getPath();
@@ -350,7 +343,7 @@ public final class IMAPExportMbox
         final PrintCommandListener listener = new PrintCommandListener(System.out, true) {
             @Override
             public void protocolReplyReceived(final ProtocolCommandEvent event) {
-                if (event.getReplyCode() != IMAPReply.PARTIAL){ // This is dealt with by the chunk listener
+                if (event.getReplyCode() != IMAPReply.PARTIAL) { // This is dealt with by the chunk listener
                     super.protocolReplyReceived(event);
                 }
             }
@@ -365,11 +358,11 @@ public final class IMAPExportMbox
 
             imap.setSoTimeout(read_timeout * 1000);
 
-            if (!imap.select(folder)){
+            if (!imap.select(folder)) {
                 throw new IOException("Could not select folder: " + folder);
             }
 
-            for(final String line : imap.getReplyStrings()) {
+            for (final String line : imap.getReplyStrings()) {
                 maxIndexInFolder = matches(line, PATEXISTS, 1);
                 if (maxIndexInFolder != null) {
                     break;
@@ -380,19 +373,18 @@ public final class IMAPExportMbox
                 imap.setChunkListener(mboxListener);
             } // else the command listener displays the full output without processing
 
-
             while (true) {
                 final boolean ok = imap.fetch(sequenceSet, itemNames);
                 // If the fetch failed, can we retry?
                 if (ok || (retryWaitSecs <= 0) || (mboxListener == null) || !checkSequence) {
                     break;
                 }
-                final String replyString = imap.getReplyString(); //includes EOL
+                final String replyString = imap.getReplyString(); // includes EOL
                 if (!startsWith(replyString, PATTEMPFAIL)) {
-                    throw new IOException("FETCH " + sequenceSet + " " + itemNames+ " failed with " + replyString);
+                    throw new IOException("FETCH " + sequenceSet + " " + itemNames + " failed with " + replyString);
                 }
                 System.err.println("Temporary error detected, will retry in " + retryWaitSecs + "seconds");
-                sequenceSet = mboxListener.lastSeq+1+":*";
+                sequenceSet = mboxListener.lastSeq + 1 + ":*";
                 try {
                     Thread.sleep(retryWaitSecs * 1000);
                 } catch (final InterruptedException e) {
@@ -402,10 +394,9 @@ public final class IMAPExportMbox
 
         } catch (final IOException ioe) {
             final String count = mboxListener == null ? "?" : mboxListener.total.toString();
-            System.err.println(
-                    "FETCH " + sequenceSet + " " + itemNames + " failed after processing " + count + " complete messages ");
+            System.err.println("FETCH " + sequenceSet + " " + itemNames + " failed after processing " + count + " complete messages ");
             if (mboxListener != null) {
-                System.err.println("Last complete response seen: "+mboxListener.lastFetched);
+                System.err.println("Last complete response seen: " + mboxListener.lastFetched);
             }
             throw ioe;
         } finally {
@@ -419,7 +410,7 @@ public final class IMAPExportMbox
                 final Iterator<String> missingIds = mboxListener.missingIds.iterator();
                 if (missingIds.hasNext()) {
                     final StringBuilder sb = new StringBuilder();
-                    for(;;) {
+                    for (;;) {
                         sb.append(missingIds.next());
                         if (!missingIds.hasNext()) {
                             break;
diff --git a/src/main/java/org/apache/commons/net/examples/mail/IMAPImportMbox.java b/src/main/java/org/apache/commons/net/examples/mail/IMAPImportMbox.java
index 2214c98d..37483517 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/IMAPImportMbox.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/IMAPImportMbox.java
@@ -31,8 +31,8 @@ import java.util.regex.Pattern;
 import org.apache.commons.net.imap.IMAPClient;
 
 /**
- * This is an example program demonstrating how to use the IMAP[S]Client class.
- * This program connects to a IMAP[S] server and imports messages into the folder from an mbox file.
+ * This is an example program demonstrating how to use the IMAP[S]Client class. This program connects to a IMAP[S] server and imports messages into the folder
+ * from an mbox file.
  * <p>
  * Usage: IMAPImportMbox imap[s]://user:password@host[:port]/folder/path <mboxfile> [selectors]
  * <p>
@@ -45,33 +45,33 @@ import org.apache.commons.net.imap.IMAPClient;
  * For example:<br>
  * IMAPImportMbox imaps://user:pass@imap.googlemail.com/imported_messages 201401.mbox 1-10,20 -142986-
  */
-public final class IMAPImportMbox
-{
+public final class IMAPImportMbox {
 
     private static final String CRLF = "\r\n";
     private static final Pattern PATFROM = Pattern.compile(">+From "); // escaped From
 
     private static String getDate(final String msg) {
-                                              // From SENDER Fri Sep 13 17:04:01 2019
+        // From SENDER Fri Sep 13 17:04:01 2019
         final Pattern FROM_RE = Pattern.compile("From \\S+ +\\S+ (\\S+)  ?(\\S+) (\\S+) (\\S+)");
-        //                                                 [Fri]   Sep      13     HMS   2019
+        // [Fri] Sep 13 HMS 2019
         // output date: 13-Sep-2019 17:04:01 +0000
         String date = null;
         final Matcher m = FROM_RE.matcher(msg);
         if (m.lookingAt()) {
-            date = m.group(2)+"-"+m.group(1)+"-"+m.group(4)+" "+m.group(3)+" +0000";
+            date = m.group(2) + "-" + m.group(1) + "-" + m.group(4) + " " + m.group(3) + " +0000";
         }
         return date;
     }
 
     /**
      * Is at least one entry in the list contained in the string?
+     *
      * @param contains the list of strings to look for
-     * @param string the String to check against
+     * @param string   the String to check against
      * @return true if at least one entry in the contains list is contained in the string
      */
     private static boolean listContains(final List<String> contains, final String string) {
-        for(final String entry : contains) {
+        for (final String entry : contains) {
             if (string.contains(entry)) {
                 return true;
             }
@@ -79,18 +79,16 @@ public final class IMAPImportMbox
         return false;
     }
 
-    public static void main(final String[] args) throws IOException
-    {
-        if (args.length < 2)
-        {
+    public static void main(final String[] args) throws IOException {
+        if (args.length < 2) {
             System.err.println("Usage: IMAPImportMbox imap[s]://user:password@host[:port]/folder/path <mboxfile> [selectors]");
-            System.err.println("\tWhere: a selector is a list of numbers/number ranges - 1,2,3-10" +
-                               " - or a list of strings to match in the initial From line");
+            System.err
+                    .println("\tWhere: a selector is a list of numbers/number ranges - 1,2,3-10" + " - or a list of strings to match in the initial From line");
             System.exit(1);
         }
 
-        final URI uri      = URI.create(args[0]);
-        final String file  = args[1];
+        final URI uri = URI.create(args[0]);
+        final String file = args[1];
 
         final File mbox = new File(file);
         if (!mbox.isFile() || !mbox.canRead()) {
@@ -106,15 +104,15 @@ public final class IMAPImportMbox
         final List<String> contains = new ArrayList<>(); // list of strings to find
         final BitSet msgNums = new BitSet(); // list of message numbers
 
-        for(int i = 2; i < args.length; i++) {
+        for (int i = 2; i < args.length; i++) {
             final String arg = args[i];
             if (arg.matches("\\d+(-\\d+)?(,\\d+(-\\d+)?)*")) { // number,m-n
-                for(final String entry : arg.split(",")) {
-                    final String []parts = entry.split("-");
+                for (final String entry : arg.split(",")) {
+                    final String[] parts = entry.split("-");
                     if (parts.length == 2) { // m-n
                         final int low = Integer.parseInt(parts[0]);
                         final int high = Integer.parseInt(parts[1]);
-                        for(int j=low; j <= high; j++) {
+                        for (int j = low; j <= high; j++) {
                             msgNums.set(j);
                         }
                     } else {
@@ -141,13 +139,13 @@ public final class IMAPImportMbox
             String line;
             final StringBuilder sb = new StringBuilder();
             boolean wanted = false; // Skip any leading rubbish
-            while((line=br.readLine())!=null) {
+            while ((line = br.readLine()) != null) {
                 if (line.startsWith("From ")) { // start of message; i.e. end of previous (if any)
                     if (process(sb, imap, folder, total)) { // process previous message (if any)
                         loaded++;
                     }
                     sb.setLength(0);
-                    total ++;
+                    total++;
                     wanted = wanted(total, line, msgNums, contains);
                 } else if (startsWith(line, PATFROM)) { // Unescape ">+From " in body text
                     line = line.substring(1);
@@ -174,13 +172,12 @@ public final class IMAPImportMbox
         System.out.println("Processed " + total + " messages, loaded " + loaded);
     }
 
-    private static boolean process(final StringBuilder sb, final IMAPClient imap, final String folder
-            ,final int msgNum) throws IOException {
+    private static boolean process(final StringBuilder sb, final IMAPClient imap, final String folder, final int msgNum) throws IOException {
         final int length = sb.length();
         final boolean haveMessage = length > 2;
         if (haveMessage) {
-            System.out.println("MsgNum: " + msgNum +" Length " + length);
-            sb.setLength(length-2); // drop trailing CRLF (mbox format has trailing blank line)
+            System.out.println("MsgNum: " + msgNum + " Length " + length);
+            sb.setLength(length - 2); // drop trailing CRLF (mbox format has trailing blank line)
             final String msg = sb.toString();
             if (!imap.append(folder, null, getDate(msg), msg)) {
                 throw new IOException("Failed to import message: " + msgNum + " " + imap.getReplyString());
@@ -197,16 +194,16 @@ public final class IMAPImportMbox
     /**
      * Is the message wanted?
      *
-     * @param msgNum the message number
-     * @param line the From line
-     * @param msgNums the list of wanted message numbers
+     * @param msgNum   the message number
+     * @param line     the From line
+     * @param msgNums  the list of wanted message numbers
      * @param contains the list of strings to be contained
      * @return true if the message is wanted
      */
     private static boolean wanted(final int msgNum, final String line, final BitSet msgNums, final List<String> contains) {
         return (msgNums.isEmpty() && contains.isEmpty()) // no selectors
-             || msgNums.get(msgNum) // matches message number
-             || listContains(contains, line); // contains string
+                || msgNums.get(msgNum) // matches message number
+                || listContains(contains, line); // contains string
     }
 
 }
diff --git a/src/main/java/org/apache/commons/net/examples/mail/IMAPMail.java b/src/main/java/org/apache/commons/net/examples/mail/IMAPMail.java
index 17935f57..7ad05b06 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/IMAPMail.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/IMAPMail.java
@@ -24,9 +24,8 @@ import org.apache.commons.net.PrintCommandListener;
 import org.apache.commons.net.imap.IMAPClient;
 
 /**
- * This is an example program demonstrating how to use the IMAP[S]Client class.
- * This program connects to a IMAP[S] server, lists its capabilities and shows
- * the status of the Inbox.
+ * This is an example program demonstrating how to use the IMAP[S]Client class. This program connects to a IMAP[S] server, lists its capabilities and shows the
+ * status of the Inbox.
  * <p>
  * Usage: IMAPMail imap[s]://username:password@server/
  * <p>
@@ -35,14 +34,11 @@ import org.apache.commons.net.imap.IMAPClient;
  * or<br>
  * IMAPMail imaps://username:password@imap.googlemail.com/
  */
-public final class IMAPMail
-{
+public final class IMAPMail {
 
     public static void main(final String[] args) throws IOException {
-        if (args.length != 1)
-        {
-            System.err.println(
-                "Usage: IMAPMail imap[s]://username:password@server/");
+        if (args.length != 1) {
+            System.err.println("Usage: IMAPMail imap[s]://username:password@server/");
             System.err.println("Connects to server; lists capabilities and shows Inbox status");
             System.exit(1);
         }
@@ -64,7 +60,7 @@ public final class IMAPMail
 
             imap.examine("inbox");
 
-            imap.status("inbox", new String[]{"MESSAGES"});
+            imap.status("inbox", new String[] { "MESSAGES" });
 
             imap.list("", "*"); // Show the folders
 
diff --git a/src/main/java/org/apache/commons/net/examples/mail/IMAPUtils.java b/src/main/java/org/apache/commons/net/examples/mail/IMAPUtils.java
index b7711ae8..7e7f9804 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/IMAPUtils.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/IMAPUtils.java
@@ -33,21 +33,19 @@ class IMAPUtils {
     /**
      * Parse the URI and use the details to connect to the IMAP(S) server and login.
      *
-     * @param uri the URI to use, e.g. imaps://user:pass@imap.mail.yahoo.com/folder
-     * or imaps://user:pass@imap.googlemail.com/folder
+     * @param uri            the URI to use, e.g. imaps://user:pass@imap.mail.yahoo.com/folder or imaps://user:pass@imap.googlemail.com/folder
      * @param defaultTimeout initial timeout (in milliseconds)
-     * @param listener for tracing protocol IO (may be null)
+     * @param listener       for tracing protocol IO (may be null)
      * @return the IMAP client - connected and logged in
      * @throws IOException if any problems occur
      */
-    static IMAPClient imapLogin(final URI uri, final int defaultTimeout, final ProtocolCommandListener listener)
-            throws IOException {
+    static IMAPClient imapLogin(final URI uri, final int defaultTimeout, final ProtocolCommandListener listener) throws IOException {
         final String userInfo = uri.getUserInfo();
         if (userInfo == null) {
             throw new IllegalArgumentException("Missing userInfo details");
         }
 
-        final String []userpass = userInfo.split(":");
+        final String[] userpass = userInfo.split(":");
         if (userpass.length != 2) {
             throw new IllegalArgumentException("Invalid userInfo details: '" + userInfo + "'");
         }
diff --git a/src/main/java/org/apache/commons/net/examples/mail/POP3ExportMbox.java b/src/main/java/org/apache/commons/net/examples/mail/POP3ExportMbox.java
index 5dfe2288..536e6585 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/POP3ExportMbox.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/POP3ExportMbox.java
@@ -33,27 +33,23 @@ import org.apache.commons.net.pop3.POP3MessageInfo;
 import org.apache.commons.net.pop3.POP3SClient;
 
 /**
- * This is an example program demonstrating how to use the POP3[S]Client class.
- * This program connects to a POP3[S] server and writes the messages
- * to an mbox file.
+ * This is an example program demonstrating how to use the POP3[S]Client class. This program connects to a POP3[S] server and writes the messages to an mbox
+ * file.
  * <p>
- * The code currently assumes that POP3Client decodes the POP3 data as iso-8859-1.
- * The POP3 standard only allows for ASCII so in theory iso-8859-1 should be OK.
- * However it appears that actual POP3 implementations may return 8bit data that is
- * outside the ASCII range; this may result in loss of data when the mailbox is created.
+ * The code currently assumes that POP3Client decodes the POP3 data as iso-8859-1. The POP3 standard only allows for ASCII so in theory iso-8859-1 should be OK.
+ * However it appears that actual POP3 implementations may return 8bit data that is outside the ASCII range; this may result in loss of data when the mailbox is
+ * created.
  * <p>
  * See main() method for usage details
  */
-public final class POP3ExportMbox
-{
+public final class POP3ExportMbox {
 
     private static final Pattern PATFROM = Pattern.compile(">*From "); // unescaped From_
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         int argIdx;
         String file = null;
-        for(argIdx = 0; argIdx < args.length; argIdx++) {
+        for (argIdx = 0; argIdx < args.length; argIdx++) {
             if (!args[argIdx].equals("-F")) {
                 break;
             }
@@ -61,15 +57,13 @@ public final class POP3ExportMbox
         }
 
         final int argCount = args.length - argIdx;
-        if (argCount < 3)
-        {
-            System.err.println(
-                "Usage: POP3Mail [-F file/directory] <server[:port]> <username> <password|-|*|VARNAME> [TLS [true=implicit]]");
+        if (argCount < 3) {
+            System.err.println("Usage: POP3Mail [-F file/directory] <server[:port]> <username> <password|-|*|VARNAME> [TLS [true=implicit]]");
             System.exit(1);
         }
 
         final String arg0[] = args[argIdx++].split(":");
-        final String server=arg0[0];
+        final String server = arg0[0];
         final String username = args[argIdx++];
         String password = args[argIdx++];
         // prompt for the password if necessary
@@ -86,7 +80,7 @@ public final class POP3ExportMbox
         final POP3Client pop3;
 
         if (proto != null) {
-            System.out.println("Using secure protocol: "+proto);
+            System.out.println("Using secure protocol: " + proto);
             pop3 = new POP3SClient(proto, implicit);
         } else {
             pop3 = new POP3Client();
@@ -98,26 +92,21 @@ public final class POP3ExportMbox
         } else {
             port = pop3.getDefaultPort();
         }
-        System.out.println("Connecting to server "+server+" on "+port);
+        System.out.println("Connecting to server " + server + " on " + port);
 
         // We want to timeout if a response takes longer than 60 seconds
         pop3.setDefaultTimeout(60000);
 
-        try
-        {
+        try {
             pop3.connect(server);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Could not connect to server.");
             e.printStackTrace();
             return;
         }
 
-        try
-        {
-            if (!pop3.login(username, password))
-            {
+        try {
+            if (!pop3.login(username, password)) {
                 System.err.println("Could not login to server.  Check password.");
                 pop3.disconnect();
                 return;
@@ -140,16 +129,15 @@ public final class POP3ExportMbox
                     System.out.println("Writing dir: " + mbox);
                     // Currently POP3Client uses iso-8859-1
                     for (int i = 1; i <= count; i++) {
-                        try (final OutputStreamWriter fw = new OutputStreamWriter(
-                                new FileOutputStream(new File(mbox, i + ".eml")), StandardCharsets.ISO_8859_1)) {
+                        try (final OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(new File(mbox, i + ".eml")),
+                                StandardCharsets.ISO_8859_1)) {
                             writeFile(pop3, fw, i);
                         }
                     }
                 } else {
                     System.out.println("Writing file: " + mbox);
                     // Currently POP3Client uses iso-8859-1
-                    try (final OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(mbox),
-                            StandardCharsets.ISO_8859_1)) {
+                    try (final OutputStreamWriter fw = new OutputStreamWriter(new FileOutputStream(mbox), StandardCharsets.ISO_8859_1)) {
                         for (int i = 1; i <= count; i++) {
                             writeMbox(pop3, fw, i);
                         }
@@ -159,9 +147,7 @@ public final class POP3ExportMbox
 
             pop3.logout();
             pop3.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             return;
         }
@@ -205,4 +191,3 @@ public final class POP3ExportMbox
         }
     }
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java b/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java
index af694036..29b170ec 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/POP3Mail.java
@@ -28,27 +28,21 @@ import org.apache.commons.net.pop3.POP3MessageInfo;
 import org.apache.commons.net.pop3.POP3SClient;
 
 /**
- * This is an example program demonstrating how to use the POP3[S]Client class.
- * This program connects to a POP3[S] server and retrieves the message
- * headers of all the messages, printing the From: and Subject: header
- * entries for each message.
+ * This is an example program demonstrating how to use the POP3[S]Client class. This program connects to a POP3[S] server and retrieves the message headers of
+ * all the messages, printing the From: and Subject: header entries for each message.
  * <p>
  * See main() method for usage details
  */
-public final class POP3Mail
-{
-
-    public static void main(final String[] args)
-    {
-        if (args.length < 3)
-        {
-            System.err.println(
-                "Usage: POP3Mail <server[:port]> <username> <password|-|*|VARNAME> [TLS [true=implicit]]");
+public final class POP3Mail {
+
+    public static void main(final String[] args) {
+        if (args.length < 3) {
+            System.err.println("Usage: POP3Mail <server[:port]> <username> <password|-|*|VARNAME> [TLS [true=implicit]]");
             System.exit(1);
         }
 
         final String arg0[] = args[0].split(":");
-        final String server=arg0[0];
+        final String server = arg0[0];
         final String username = args[1];
         String password = args[2];
         // prompt for the password if necessary
@@ -65,7 +59,7 @@ public final class POP3Mail
         final POP3Client pop3;
 
         if (proto != null) {
-            System.out.println("Using secure protocol: "+proto);
+            System.out.println("Using secure protocol: " + proto);
             pop3 = new POP3SClient(proto, implicit);
         } else {
             pop3 = new POP3Client();
@@ -77,7 +71,7 @@ public final class POP3Mail
         } else {
             port = pop3.getDefaultPort();
         }
-        System.out.println("Connecting to server "+server+" on "+port);
+        System.out.println("Connecting to server " + server + " on " + port);
 
         // We want to timeout if a response takes longer than 60 seconds
         pop3.setDefaultTimeout(60000);
@@ -85,21 +79,16 @@ public final class POP3Mail
         // suppress login details
         pop3.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
 
-        try
-        {
+        try {
             pop3.connect(server);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Could not connect to server.");
             e.printStackTrace();
             return;
         }
 
-        try
-        {
-            if (!pop3.login(username, password))
-            {
+        try {
+            if (!pop3.login(username, password)) {
                 System.err.println("Could not login to server.  Check password.");
                 pop3.disconnect();
                 return;
@@ -117,15 +106,13 @@ public final class POP3Mail
 
             final POP3MessageInfo[] messages = pop3.listMessages();
 
-            if (messages == null)
-            {
+            if (messages == null) {
                 System.err.println("Could not retrieve message list.");
                 pop3.logout();
                 pop3.disconnect();
                 return;
             }
-            if (messages.length == 0)
-            {
+            if (messages.length == 0) {
                 System.out.println("No messages");
                 pop3.logout();
                 pop3.disconnect();
@@ -148,24 +135,21 @@ public final class POP3Mail
 
             pop3.logout();
             pop3.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             return;
         }
     }
 
-    public static void printMessageInfo(final BufferedReader reader, final int id) throws IOException  {
+    public static void printMessageInfo(final BufferedReader reader, final int id) throws IOException {
         String from = "";
         String subject = "";
         String line;
-        while ((line = reader.readLine()) != null)
-        {
+        while ((line = reader.readLine()) != null) {
             final String lower = line.toLowerCase(Locale.ENGLISH);
             if (lower.startsWith("from: ")) {
                 from = line.substring(6).trim();
-            }  else if (lower.startsWith("subject: ")) {
+            } else if (lower.startsWith("subject: ")) {
                 subject = line.substring(9).trim();
             }
         }
@@ -173,4 +157,3 @@ public final class POP3Mail
         System.out.println(Integer.toString(id) + " From: " + from + "  Subject: " + subject);
     }
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/mail/SMTPMail.java b/src/main/java/org/apache/commons/net/examples/mail/SMTPMail.java
index c7a1f381..366c7b48 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/SMTPMail.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/SMTPMail.java
@@ -34,16 +34,13 @@ import org.apache.commons.net.smtp.SMTPReply;
 import org.apache.commons.net.smtp.SimpleSMTPHeader;
 
 /**
- * This is an example program using the SMTP package to send a message
- * to the specified recipients.  It prompts you for header information and
- * a file name containing the message.
+ * This is an example program using the SMTP package to send a message to the specified recipients. It prompts you for header information and a file name
+ * containing the message.
  */
 
-public final class SMTPMail
-{
+public final class SMTPMail {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final String sender;
         final String recipient;
         final String subject;
@@ -57,8 +54,7 @@ public final class SMTPMail
         final SimpleSMTPHeader header;
         final SMTPClient client;
 
-        if (args.length < 1)
-        {
+        if (args.length < 1) {
             System.err.println("Usage: SMTPMail <smtpserver>");
             System.exit(1);
         }
@@ -67,8 +63,7 @@ public final class SMTPMail
 
         stdin = new BufferedReader(new InputStreamReader(System.in));
 
-        try
-        {
+        try {
             System.out.print("From: ");
             System.out.flush();
 
@@ -86,15 +81,13 @@ public final class SMTPMail
 
             header = new SimpleSMTPHeader(sender, recipient, subject);
 
-
-            while (true)
-            {
+            while (true) {
                 System.out.print("CC <enter one address per line, hit enter to end>: ");
                 System.out.flush();
 
                 cc = stdin.readLine();
 
-                if (cc== null || cc.isEmpty()) {
+                if (cc == null || cc.isEmpty()) {
                     break;
                 }
 
@@ -107,23 +100,18 @@ public final class SMTPMail
 
             fileName = stdin.readLine();
 
-            try
-            {
+            try {
                 fileReader = new FileReader(fileName);
-            }
-            catch (final FileNotFoundException e)
-            {
+            } catch (final FileNotFoundException e) {
                 System.err.println("File not found. " + e.getMessage());
             }
 
             client = new SMTPClient();
-            client.addProtocolCommandListener(new PrintCommandListener(
-                                                  new PrintWriter(System.out), true));
+            client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
 
             client.connect(server);
 
-            if (!SMTPReply.isPositiveCompletion(client.getReplyCode()))
-            {
+            if (!SMTPReply.isPositiveCompletion(client.getReplyCode())) {
                 client.disconnect();
                 System.err.println("SMTP server refused connection.");
                 System.exit(1);
@@ -134,36 +122,29 @@ public final class SMTPMail
             client.setSender(sender);
             client.addRecipient(recipient);
 
-
-
             for (final String recpt : ccList) {
                 client.addRecipient(recpt);
             }
 
             writer = client.sendMessageData();
 
-            if (writer != null)
-            {
+            if (writer != null) {
                 writer.write(header.toString());
                 Util.copyReader(fileReader, writer);
                 writer.close();
                 client.completePendingCommand();
             }
 
-            if (fileReader != null ) {
+            if (fileReader != null) {
                 fileReader.close();
             }
 
             client.logout();
 
             client.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
     }
 }
-
-
diff --git a/src/main/java/org/apache/commons/net/examples/mail/Utils.java b/src/main/java/org/apache/commons/net/examples/mail/Utils.java
index 92bba30d..8f9c4b4e 100644
--- a/src/main/java/org/apache/commons/net/examples/mail/Utils.java
+++ b/src/main/java/org/apache/commons/net/examples/mail/Utils.java
@@ -29,18 +29,14 @@ import java.util.Locale;
 class Utils {
 
     /**
-     * If the initial password is:
-     * '*' - replace it with a line read from the system console
-     * '-' - replace it with next line from STDIN
-     * 'ABCD' - if the input is all upper case, use the field as an environment variable name
+     * If the initial password is: '*' - replace it with a line read from the system console '-' - replace it with next line from STDIN 'ABCD' - if the input is
+     * all upper case, use the field as an environment variable name
      *
      * Note: there are no guarantees that the password cannot be snooped.
      *
-     * Even using the console may be subject to memory snooping,
-     * however it should be safer than the other methods.
+     * Even using the console may be subject to memory snooping, however it should be safer than the other methods.
      *
-     * STDIN may require creating a temporary file which could be read by others
-     * Environment variables may be visible by using PS
+     * STDIN may require creating a temporary file which could be read by others Environment variables may be visible by using PS
      */
     static String getPassword(final String username, String password) throws IOException {
         if ("-".equals(password)) { // stdin
@@ -56,7 +52,7 @@ class Utils {
         } else if (password.equals(password.toUpperCase(Locale.ROOT))) { // environment variable name
             final String tmp = System.getenv(password);
             if (tmp != null) { // don't overwrite if variable does not exist (just in case password is all uppers)
-                password=tmp;
+                password = tmp;
             }
         }
         return password;
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java b/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java
index 981a4d00..7f8a1e55 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/ArticleReader.java
@@ -50,7 +50,7 @@ public class ArticleReader {
         if (args.length == 5) { // Optional auth
             final String user = args[3];
             final String password = args[4];
-            if(!client.authenticate(user, password)) {
+            if (!client.authenticate(user, password)) {
                 System.out.println("Authentication failed for user " + user + "!");
                 System.exit(1);
             }
@@ -68,7 +68,7 @@ public class ArticleReader {
             brHdr = client.retrieveArticleHeader(articleNum);
         }
         if (brHdr != null) {
-            while((line=brHdr.readLine()) != null) {
+            while ((line = brHdr.readLine()) != null) {
                 System.out.println(line);
             }
             brHdr.close();
@@ -81,7 +81,7 @@ public class ArticleReader {
             brBody = client.retrieveArticleBody(articleNum);
         }
         if (brBody != null) {
-            while((line=brBody.readLine()) != null) {
+            while ((line = brBody.readLine()) != null) {
                 System.out.println(line);
             }
             brBody.close();
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/ExtendedNNTPOps.java b/src/main/java/org/apache/commons/net/examples/nntp/ExtendedNNTPOps.java
index 4e2961ec..9018ce6c 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/ExtendedNNTPOps.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/ExtendedNNTPOps.java
@@ -25,13 +25,11 @@ import org.apache.commons.net.nntp.Article;
 import org.apache.commons.net.nntp.NNTPClient;
 import org.apache.commons.net.nntp.NewsgroupInfo;
 
-
 /**
  * Simple class showing some of the extended commands (AUTH, XOVER, LIST ACTIVE)
  */
 public class ExtendedNNTPOps {
 
-
     public static void main(final String[] args) {
         final ExtendedNNTPOps ops;
 
@@ -42,12 +40,11 @@ public class ExtendedNNTPOps {
         }
 
         ops = new ExtendedNNTPOps();
-        ops.demo(args[0], argc >=3 ? args[1] : null, argc >=3 ? args[2] : null);
+        ops.demo(args[0], argc >= 3 ? args[1] : null, argc >= 3 ? args[2] : null);
     }
 
     private final NNTPClient client;
 
-
     public ExtendedNNTPOps() {
         client = new NNTPClient();
         client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
@@ -71,12 +68,12 @@ public class ExtendedNNTPOps {
             final NewsgroupInfo testGroup = new NewsgroupInfo();
             client.selectNewsgroup("alt.test", testGroup);
             final long lowArticleNumber = testGroup.getFirstArticleLong();
-            final long  highArticleNumber = lowArticleNumber + 100;
+            final long highArticleNumber = lowArticleNumber + 100;
             final Iterable<Article> articles = client.iterateArticleInfo(lowArticleNumber, highArticleNumber);
 
             for (final Article article : articles) {
                 if (article.isDummy()) { // Subject will contain raw response
-                    System.out.println("Could not parse: "+article.getSubject());
+                    System.out.println("Could not parse: " + article.getSubject());
                 } else {
                     System.out.println(article.getSubject());
                 }
@@ -84,8 +81,7 @@ public class ExtendedNNTPOps {
 
             // LIST ACTIVE
             final NewsgroupInfo[] fanGroups = client.listNewsgroups("alt.fan.*");
-            for (final NewsgroupInfo fanGroup : fanGroups)
-            {
+            for (final NewsgroupInfo fanGroup : fanGroups) {
                 System.out.println(fanGroup.getNewsgroup());
             }
 
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/ListNewsgroups.java b/src/main/java/org/apache/commons/net/examples/nntp/ListNewsgroups.java
index b870475c..515fa403 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/ListNewsgroups.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/ListNewsgroups.java
@@ -23,20 +23,15 @@ import org.apache.commons.net.nntp.NNTPClient;
 import org.apache.commons.net.nntp.NewsgroupInfo;
 
 /**
- * This is a trivial example using the NNTP package to approximate the
- * Unix newsgroups command.  It merely connects to the specified news
- * server and issues fetches the list of newsgroups stored by the server.
- * On servers that store a lot of newsgroups, this command can take a very
- * long time (listing upwards of 30,000 groups).
+ * This is a trivial example using the NNTP package to approximate the Unix newsgroups command. It merely connects to the specified news server and issues
+ * fetches the list of newsgroups stored by the server. On servers that store a lot of newsgroups, this command can take a very long time (listing upwards of
+ * 30,000 groups).
  */
 
-public final class ListNewsgroups
-{
+public final class ListNewsgroups {
 
-    public static void main(final String[] args)
-    {
-        if (args.length < 1)
-        {
+    public static void main(final String[] args) {
+        if (args.length < 1) {
             System.err.println("Usage: newsgroups newsserver [pattern]");
             return;
         }
@@ -44,13 +39,12 @@ public final class ListNewsgroups
         final NNTPClient client = new NNTPClient();
         final String pattern = args.length >= 2 ? args[1] : "";
 
-        try
-        {
+        try {
             client.connect(args[0]);
 
             int j = 0;
             try {
-                for(final String s : client.iterateNewsgroupListing(pattern)) {
+                for (final String s : client.iterateNewsgroupListing(pattern)) {
                     j++;
                     System.out.println(s);
                 }
@@ -60,26 +54,19 @@ public final class ListNewsgroups
             System.out.println(j);
 
             j = 0;
-            for(final NewsgroupInfo n : client.iterateNewsgroups(pattern)) {
+            for (final NewsgroupInfo n : client.iterateNewsgroups(pattern)) {
                 j++;
                 System.out.println(n.getNewsgroup());
             }
             System.out.println(j);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
-        }
-        finally
-        {
-            try
-            {
+        } finally {
+            try {
                 if (client.isConnected()) {
                     client.disconnect();
                 }
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 System.err.println("Error disconnecting from server.");
                 e.printStackTrace();
                 System.exit(1);
@@ -89,5 +76,3 @@ public final class ListNewsgroups
     }
 
 }
-
-
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/MessageThreading.java b/src/main/java/org/apache/commons/net/examples/nntp/MessageThreading.java
index 547ede82..5be1bdb3 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/MessageThreading.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/MessageThreading.java
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-
 package org.apache.commons.net.examples.nntp;
 
 import java.io.IOException;
@@ -49,7 +48,7 @@ public class MessageThreading {
         if (args.length == 4) { // Optional auth
             final String user = args[2];
             final String password = args[3];
-            if(!client.authenticate(user, password)) {
+            if (!client.authenticate(user, password)) {
                 System.out.println("Authentication failed for user " + user + "!");
                 System.exit(1);
             }
@@ -58,7 +57,7 @@ public class MessageThreading {
         final String fmt[] = client.listOverviewFmt();
         if (fmt != null) {
             System.out.println("LIST OVERVIEW.FMT:");
-            for(final String s : fmt) {
+            for (final String s : fmt) {
                 System.out.println(s);
             }
         } else {
@@ -75,7 +74,7 @@ public class MessageThreading {
 
         System.out.println("Building message thread tree...");
         final Threader threader = new Threader();
-        final Article root = (Article)threader.thread(articles);
+        final Article root = (Article) threader.thread(articles);
 
         Article.printThread(root, 0);
     }
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/NNTPUtils.java b/src/main/java/org/apache/commons/net/examples/nntp/NNTPUtils.java
index def8b59e..cc6b91e6 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/NNTPUtils.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/NNTPUtils.java
@@ -29,19 +29,18 @@ import org.apache.commons.net.nntp.NNTPClient;
 public class NNTPUtils {
 
     /**
-     * Given an {@link NNTPClient} instance, and an integer range of messages, return
-     * an array of {@link Article} instances.
-     * @param client the client to use
-     * @param lowArticleNumber low number
+     * Given an {@link NNTPClient} instance, and an integer range of messages, return an array of {@link Article} instances.
+     *
+     * @param client            the client to use
+     * @param lowArticleNumber  low number
      * @param highArticleNumber high number
      * @return Article[] An array of Article
      * @throws IOException on error
      */
-    public  static List<Article> getArticleInfo(final NNTPClient client, final long lowArticleNumber, final long highArticleNumber)
-    throws IOException {
+    public static List<Article> getArticleInfo(final NNTPClient client, final long lowArticleNumber, final long highArticleNumber) throws IOException {
         final List<Article> articles = new ArrayList<>();
         final Iterable<Article> arts = client.iterateArticleInfo(lowArticleNumber, highArticleNumber);
-        for(final Article article : arts){
+        for (final Article article : arts) {
             articles.add(article);
         }
         return articles;
diff --git a/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java b/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java
index 78d68772..9b2f7168 100644
--- a/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java
+++ b/src/main/java/org/apache/commons/net/examples/nntp/PostMessage.java
@@ -31,18 +31,14 @@ import org.apache.commons.net.nntp.NNTPClient;
 import org.apache.commons.net.nntp.NNTPReply;
 import org.apache.commons.net.nntp.SimpleNNTPHeader;
 
-
 /**
- * This is an example program using the NNTP package to post an article
- * to the specified newsgroup(s).  It prompts you for header information and
- * a file name to post.
+ * This is an example program using the NNTP package to post an article to the specified newsgroup(s). It prompts you for header information and a file name to
+ * post.
  */
 
-public final class PostMessage
-{
+public final class PostMessage {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final String from;
         final String subject;
         String newsgroup;
@@ -55,8 +51,7 @@ public final class PostMessage
         final SimpleNNTPHeader header;
         final NNTPClient client;
 
-        if (args.length < 1)
-        {
+        if (args.length < 1) {
             System.err.println("Usage: post newsserver");
             System.exit(1);
         }
@@ -65,8 +60,7 @@ public final class PostMessage
 
         stdin = new BufferedReader(new InputStreamReader(System.in));
 
-        try
-        {
+        try {
             System.out.print("From: ");
             System.out.flush();
 
@@ -85,8 +79,7 @@ public final class PostMessage
             newsgroup = stdin.readLine();
             header.addNewsgroup(newsgroup);
 
-            while (true)
-            {
+            while (true) {
                 System.out.print("Additional Newsgroup <Hit enter to end>: ");
                 System.out.flush();
 
@@ -129,35 +122,28 @@ public final class PostMessage
 
             fileName = stdin.readLine();
 
-            try
-            {
+            try {
                 fileReader = new FileReader(fileName);
-            }
-            catch (final FileNotFoundException e)
-            {
+            } catch (final FileNotFoundException e) {
                 System.err.println("File not found. " + e.getMessage());
                 System.exit(1);
             }
 
             client = new NNTPClient();
-            client.addProtocolCommandListener(new PrintCommandListener(
-                                                  new PrintWriter(System.out), true));
+            client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out), true));
 
             client.connect(server);
 
-            if (!NNTPReply.isPositiveCompletion(client.getReplyCode()))
-            {
+            if (!NNTPReply.isPositiveCompletion(client.getReplyCode())) {
                 client.disconnect();
                 System.err.println("NNTP server refused connection.");
                 System.exit(1);
             }
 
-            if (client.isAllowedToPost())
-            {
+            if (client.isAllowedToPost()) {
                 final Writer writer = client.postArticle();
 
-                if (writer != null)
-                {
+                if (writer != null) {
                     writer.write(header.toString());
                     Util.copyReader(fileReader, writer);
                     writer.close();
@@ -170,13 +156,9 @@ public final class PostMessage
             client.logout();
 
             client.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
     }
 }
-
-
diff --git a/src/main/java/org/apache/commons/net/examples/ntp/NTPClient.java b/src/main/java/org/apache/commons/net/examples/ntp/NTPClient.java
index 2c753c43..562e05d1 100644
--- a/src/main/java/org/apache/commons/net/examples/ntp/NTPClient.java
+++ b/src/main/java/org/apache/commons/net/examples/ntp/NTPClient.java
@@ -30,14 +30,9 @@ import org.apache.commons.net.ntp.TimeInfo;
 import org.apache.commons.net.ntp.TimeStamp;
 
 /**
- * This is an example program demonstrating how to use the NTPUDPClient
- * class. This program sends a Datagram client request packet to a
- * Network time Protocol (NTP) service port on a specified server,
- * retrieves the time, and prints it to standard output along with
- * the fields from the NTP message header (e.g. stratum level, reference id,
- * poll interval, root delay, mode, ...)
- * See <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc868.txt"> the spec </A>
- * for details.
+ * This is an example program demonstrating how to use the NTPUDPClient class. This program sends a Datagram client request packet to a Network time Protocol
+ * (NTP) service port on a specified server, retrieves the time, and prints it to standard output along with the fields from the NTP message header (e.g.
+ * stratum level, reference id, poll interval, root delay, mode, ...) See <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc868.txt"> the spec </A> for details.
  * <p>
  * Usage: NTPClient <hostname-or-address-list>
  * </p>
@@ -45,13 +40,11 @@ import org.apache.commons.net.ntp.TimeStamp;
  * Example: NTPClient clock.psu.edu
  * </p>
  */
-public final class NTPClient
-{
+public final class NTPClient {
 
     private static final NumberFormat numberFormat = new java.text.DecimalFormat("0.00");
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         if (args.length == 0) {
             System.err.println("Usage: NTPClient <hostname-or-address-list>");
             System.exit(1);
@@ -62,8 +55,7 @@ public final class NTPClient
         client.setDefaultTimeout(10000);
         try {
             client.open();
-            for (final String arg : args)
-            {
+            for (final String arg : args) {
                 System.out.println();
                 try {
                     final InetAddress hostAddr = InetAddress.getByName(arg);
@@ -83,10 +75,10 @@ public final class NTPClient
 
     /**
      * Process <code>TimeInfo</code> object and print its details.
+     *
      * @param info <code>TimeInfo</code> object.
      */
-    public static void processResponse(final TimeInfo info)
-    {
+    public static void processResponse(final TimeInfo info) {
         final NtpV3Packet message = info.getMessage();
         final int stratum = message.getStratum();
         final String refType;
@@ -101,17 +93,14 @@ public final class NTPClient
         System.out.println(" Stratum: " + stratum + " " + refType);
         final int version = message.getVersion();
         final int li = message.getLeapIndicator();
-        System.out.println(" leap=" + li + ", version="
-                + version + ", precision=" + message.getPrecision());
+        System.out.println(" leap=" + li + ", version=" + version + ", precision=" + message.getPrecision());
 
         System.out.println(" mode: " + message.getModeName() + " (" + message.getMode() + ")");
         final int poll = message.getPoll();
         // poll value typically btwn MINPOLL (4) and MAXPOLL (14)
-        System.out.println(" poll: " + (poll <= 0 ? 1 : (int) Math.pow(2, poll))
-                + " seconds" + " (2 ** " + poll + ")");
+        System.out.println(" poll: " + (poll <= 0 ? 1 : (int) Math.pow(2, poll)) + " seconds" + " (2 ** " + poll + ")");
         final double disp = message.getRootDispersionInMillisDouble();
-        System.out.println(" rootdelay=" + numberFormat.format(message.getRootDelayInMillisDouble())
-                + ", rootdispersion(ms): " + numberFormat.format(disp));
+        System.out.println(" rootdelay=" + numberFormat.format(message.getRootDelayInMillisDouble()) + ", rootdispersion(ms): " + numberFormat.format(disp));
 
         final int refId = message.getReferenceId();
         String refAddr = NtpUtils.getHostAddress(refId);
@@ -174,8 +163,7 @@ public final class NTPClient
         final String delay = delayMillis == null ? "N/A" : delayMillis.toString();
         final String offset = offsetMillis == null ? "N/A" : offsetMillis.toString();
 
-        System.out.println(" Roundtrip delay(ms)=" + delay
-                + ", clock offset(ms)=" + offset); // offset in ms
+        System.out.println(" Roundtrip delay(ms)=" + delay + ", clock offset(ms)=" + offset); // offset in ms
     }
 
 }
diff --git a/src/main/java/org/apache/commons/net/examples/ntp/SimpleNTPServer.java b/src/main/java/org/apache/commons/net/examples/ntp/SimpleNTPServer.java
index 59457843..cd10bb53 100644
--- a/src/main/java/org/apache/commons/net/examples/ntp/SimpleNTPServer.java
+++ b/src/main/java/org/apache/commons/net/examples/ntp/SimpleNTPServer.java
@@ -26,23 +26,17 @@ import org.apache.commons.net.ntp.NtpV3Packet;
 import org.apache.commons.net.ntp.TimeStamp;
 
 /**
- * The SimpleNTPServer class is a UDP implementation of a server for the
- * Network Time Protocol (NTP) version 3 as described in RFC 1305.
- * It is a minimal NTP server that doesn't actually adjust the time but
- * only responds to NTP datagram requests with response sent back to
- * originating host with info filled out using the current clock time.
- * To be used for debugging or testing.
+ * The SimpleNTPServer class is a UDP implementation of a server for the Network Time Protocol (NTP) version 3 as described in RFC 1305. It is a minimal NTP
+ * server that doesn't actually adjust the time but only responds to NTP datagram requests with response sent back to originating host with info filled out
+ * using the current clock time. To be used for debugging or testing.
  *
- * To prevent this from interfering with the actual NTP service it can be
- * run from any local port.
+ * To prevent this from interfering with the actual NTP service it can be run from any local port.
  */
 public class SimpleNTPServer implements Runnable {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         int port = NtpV3Packet.NTP_PORT;
-        if (args.length != 0)
-        {
+        if (args.length != 0) {
             try {
                 port = Integer.parseInt(args[0]);
             } catch (final NumberFormatException nfe) {
@@ -56,6 +50,7 @@ public class SimpleNTPServer implements Runnable {
             e.printStackTrace();
         }
     }
+
     private int port;
     private volatile boolean running;
     private boolean started;
@@ -65,20 +60,17 @@ public class SimpleNTPServer implements Runnable {
     /**
      * Creates SimpleNTPServer listening on default NTP port.
      */
-    public SimpleNTPServer()
-    {
+    public SimpleNTPServer() {
         this(NtpV3Packet.NTP_PORT);
     }
 
     /**
      * Creates SimpleNTPServer.
      *
-     * @param port the local port the server socket is bound to, or
-     *             <code>zero</code> for a system selected free port.
+     * @param port the local port the server socket is bound to, or <code>zero</code> for a system selected free port.
      * @throws IllegalArgumentException if port number less than 0
      */
-    public SimpleNTPServer(final int port)
-    {
+    public SimpleNTPServer(final int port) {
         if (port < 0) {
             throw new IllegalArgumentException();
         }
@@ -90,10 +82,8 @@ public class SimpleNTPServer implements Runnable {
      *
      * @throws IOException if an I/O error occurs when creating the socket.
      */
-    public void connect() throws IOException
-    {
-        if (socket == null)
-        {
+    public void connect() throws IOException {
+        if (socket == null) {
             socket = new DatagramSocket(port);
             // port = 0 is bound to available free port
             if (port == 0) {
@@ -103,26 +93,22 @@ public class SimpleNTPServer implements Runnable {
         }
     }
 
-    public int getPort()
-    {
+    public int getPort() {
         return port;
     }
 
     /**
-     * Handles incoming packet. If NTP packet is client-mode then respond
-     * to that host with a NTP response packet otherwise ignore.
+     * Handles incoming packet. If NTP packet is client-mode then respond to that host with a NTP response packet otherwise ignore.
      *
      * @param request incoming DatagramPacket
      * @param rcvTime time packet received
      *
-     * @throws IOException  if an I/O error occurs.
+     * @throws IOException if an I/O error occurs.
      */
-    protected void handlePacket(final DatagramPacket request, final long rcvTime) throws IOException
-    {
+    protected void handlePacket(final DatagramPacket request, final long rcvTime) throws IOException {
         final NtpV3Packet message = new NtpV3Impl();
         message.setDatagramPacket(request);
-        System.out.printf("NTP packet from %s mode=%s%n", request.getAddress().getHostAddress(),
-                NtpUtils.getModeName(message.getMode()));
+        System.out.printf("NTP packet from %s mode=%s%n", request.getAddress().getHostAddress(), NtpUtils.getModeName(message.getMode()));
         if (message.getMode() == NtpV3Packet.MODE_CLIENT) {
             final NtpV3Packet response = new NtpV3Impl();
 
@@ -157,8 +143,7 @@ public class SimpleNTPServer implements Runnable {
      *
      * @return true if time service is running
      */
-    public boolean isRunning()
-    {
+    public boolean isRunning() {
         return running;
     }
 
@@ -167,8 +152,7 @@ public class SimpleNTPServer implements Runnable {
      *
      * @return true if time service is running
      */
-    public boolean isStarted()
-    {
+    public boolean isStarted() {
         return started;
     }
 
@@ -176,8 +160,7 @@ public class SimpleNTPServer implements Runnable {
      * Main method to service client connections.
      */
     @Override
-    public void run()
-    {
+    public void run() {
         running = true;
         final byte buffer[] = new byte[48];
         final DatagramPacket request = new DatagramPacket(buffer, buffer.length);
@@ -187,8 +170,7 @@ public class SimpleNTPServer implements Runnable {
                 final long rcvTime = System.currentTimeMillis();
                 handlePacket(request, rcvTime);
             } catch (final IOException e) {
-                if (running)
-                {
+                if (running) {
                     e.printStackTrace();
                 }
                 // otherwise socket thrown exception during shutdown
@@ -201,14 +183,11 @@ public class SimpleNTPServer implements Runnable {
      *
      * @throws IOException if an I/O error occurs when creating the socket.
      */
-    public void start() throws IOException
-    {
-        if (socket == null)
-        {
+    public void start() throws IOException {
+        if (socket == null) {
             connect();
         }
-        if (!started)
-        {
+        if (!started) {
             started = true;
             new Thread(this).start();
         }
@@ -217,12 +196,10 @@ public class SimpleNTPServer implements Runnable {
     /**
      * Closes server socket and stop listening.
      */
-    public void stop()
-    {
+    public void stop() {
         running = false;
-        if (socket != null)
-        {
-            socket.close();  // force closing of the socket
+        if (socket != null) {
+            socket.close(); // force closing of the socket
             socket = null;
         }
         started = false;
diff --git a/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java b/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java
index 3eb56c37..3d5619d4 100644
--- a/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java
+++ b/src/main/java/org/apache/commons/net/examples/ntp/TimeClient.java
@@ -24,70 +24,51 @@ import org.apache.commons.net.time.TimeTCPClient;
 import org.apache.commons.net.time.TimeUDPClient;
 
 /**
- * This is an example program demonstrating how to use the TimeTCPClient
- * and TimeUDPClient classes.
- * This program connects to the default time service port of a
- * specified server, retrieves the time, and prints it to standard output.
- * See <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc868.txt"> the spec </A>
- * for details.  The default is to use the TCP port.  Use the -udp flag to
- * use the UDP port.
+ * This is an example program demonstrating how to use the TimeTCPClient and TimeUDPClient classes. This program connects to the default time service port of a
+ * specified server, retrieves the time, and prints it to standard output. See <A HREF="ftp://ftp.rfc-editor.org/in-notes/rfc868.txt"> the spec </A> for
+ * details. The default is to use the TCP port. Use the -udp flag to use the UDP port.
  * <p>
  * Usage: TimeClient [-udp] <hostname>
  * </p>
  */
-public final class TimeClient
-{
+public final class TimeClient {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
 
-        if (args.length == 1)
-        {
-            try
-            {
+        if (args.length == 1) {
+            try {
                 timeTCP(args[0]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else if (args.length == 2 && args[0].equals("-udp"))
-        {
-            try
-            {
+        } else if (args.length == 2 && args[0].equals("-udp")) {
+            try {
                 timeUDP(args[1]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else
-        {
+        } else {
             System.err.println("Usage: TimeClient [-udp] <hostname>");
             System.exit(1);
         }
 
     }
 
-    public static void timeTCP(final String host) throws IOException
-    {
+    public static void timeTCP(final String host) throws IOException {
         final TimeTCPClient client = new TimeTCPClient();
-    try {
-          // We want to timeout if a response takes longer than 60 seconds
-          client.setDefaultTimeout(60000);
-      client.connect(host);
-          System.out.println(client.getDate());
-    } finally {
-          client.disconnect();
-    }
+        try {
+            // We want to timeout if a response takes longer than 60 seconds
+            client.setDefaultTimeout(60000);
+            client.connect(host);
+            System.out.println(client.getDate());
+        } finally {
+            client.disconnect();
+        }
     }
 
-    public static void timeUDP(final String host) throws IOException
-    {
+    public static void timeUDP(final String host) throws IOException {
         final TimeUDPClient client = new TimeUDPClient();
 
         // We want to timeout if a response takes longer than 60 seconds
@@ -98,4 +79,3 @@ public final class TimeClient
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/telnet/TelnetClientExample.java b/src/main/java/org/apache/commons/net/examples/telnet/TelnetClientExample.java
index 804bf673..13f94c7e 100644
--- a/src/main/java/org/apache/commons/net/examples/telnet/TelnetClientExample.java
+++ b/src/main/java/org/apache/commons/net/examples/telnet/TelnetClientExample.java
@@ -31,35 +31,26 @@ import org.apache.commons.net.telnet.TelnetClient;
 import org.apache.commons.net.telnet.TelnetNotificationHandler;
 import org.apache.commons.net.telnet.TerminalTypeOptionHandler;
 
-
 /**
- * This is a simple example of use of TelnetClient.
- * An external option handler (SimpleTelnetOptionHandler) is used.
- * Initial configuration requested by TelnetClient will be:
- * WILL ECHO, WILL SUPPRESS-GA, DO SUPPRESS-GA.
- * VT100 terminal type will be subnegotiated.
+ * This is a simple example of use of TelnetClient. An external option handler (SimpleTelnetOptionHandler) is used. Initial configuration requested by
+ * TelnetClient will be: WILL ECHO, WILL SUPPRESS-GA, DO SUPPRESS-GA. VT100 terminal type will be subnegotiated.
  * <p>
- * Also, use of the sendAYT(), getLocalOptionState(), getRemoteOptionState()
- * is demonstrated.
- * When connected, type AYT to send an AYT command to the server and see
- * the result.
- * Type OPT to see a report of the state of the first 25 options.
+ * Also, use of the sendAYT(), getLocalOptionState(), getRemoteOptionState() is demonstrated. When connected, type AYT to send an AYT command to the server and
+ * see the result. Type OPT to see a report of the state of the first 25 options.
  */
-public class TelnetClientExample implements Runnable, TelnetNotificationHandler
-{
+public class TelnetClientExample implements Runnable, TelnetNotificationHandler {
     private static TelnetClient tc;
 
     /**
      * Main for the TelnetClientExample.
+     *
      * @param args input params
      * @throws Exception on error
      */
-    public static void main(final String[] args) throws Exception
-    {
+    public static void main(final String[] args) throws Exception {
         FileOutputStream fout = null;
 
-        if(args.length < 1)
-        {
+        if (args.length < 1) {
             System.err.println("Usage: TelnetClientExample <remote-ip> [<remote-port>]");
             System.exit(1);
         }
@@ -68,24 +59,16 @@ public class TelnetClientExample implements Runnable, TelnetNotificationHandler
 
         final int remoteport;
 
-        if (args.length > 1)
-        {
+        if (args.length > 1) {
             remoteport = Integer.parseInt(args[1]);
-        }
-        else
-        {
+        } else {
             remoteport = 23;
         }
 
-        try
-        {
-            fout = new FileOutputStream ("spy.log", true);
-        }
-        catch (final IOException e)
-        {
-            System.err.println(
-                "Exception while opening the spy file: "
-                + e.getMessage());
+        try {
+            fout = new FileOutputStream("spy.log", true);
+        } catch (final IOException e) {
+            System.err.println("Exception while opening the spy file: " + e.getMessage());
         }
 
         tc = new TelnetClient();
@@ -94,26 +77,20 @@ public class TelnetClientExample implements Runnable, TelnetNotificationHandler
         final EchoOptionHandler echoopt = new EchoOptionHandler(true, false, true, false);
         final SuppressGAOptionHandler gaopt = new SuppressGAOptionHandler(true, true, true, true);
 
-        try
-        {
+        try {
             tc.addOptionHandler(ttopt);
             tc.addOptionHandler(echoopt);
             tc.addOptionHandler(gaopt);
-        }
-        catch (final InvalidTelnetOptionException e)
-        {
+        } catch (final InvalidTelnetOptionException e) {
             System.err.println("Error registering option handlers: " + e.getMessage());
         }
 
-        while (true)
-        {
+        while (true) {
             boolean end_loop = false;
-            try
-            {
+            try {
                 tc.connect(remoteip, remoteport);
 
-
-                final Thread reader = new Thread (new TelnetClientExample());
+                final Thread reader = new Thread(new TelnetClientExample());
                 tc.registerNotifHandler(new TelnetClientExample());
                 System.out.println("TelnetClientExample");
                 System.out.println("Type AYT to send an AYT telnet command");
@@ -130,98 +107,66 @@ public class TelnetClientExample implements Runnable, TelnetNotificationHandler
                 final byte[] buff = new byte[1024];
                 int ret_read = 0;
 
-                do
-                {
-                    try
-                    {
+                do {
+                    try {
                         ret_read = System.in.read(buff);
-                        if(ret_read > 0)
-                        {
+                        if (ret_read > 0) {
                             final String line = new String(buff, 0, ret_read); // deliberate use of default charset
-                            if(line.startsWith("AYT"))
-                            {
-                                try
-                                {
+                            if (line.startsWith("AYT")) {
+                                try {
                                     System.out.println("Sending AYT");
 
                                     System.out.println("AYT response:" + tc.sendAYT(5000));
-                                }
-                                catch (final IOException e)
-                                {
+                                } catch (final IOException e) {
                                     System.err.println("Exception waiting AYT response: " + e.getMessage());
                                 }
-                            }
-                            else if(line.startsWith("OPT"))
-                            {
-                                 System.out.println("Status of options:");
-                                 for(int ii=0; ii<25; ii++) {
-                                     System.out.println("Local Option " + ii + ":" + tc.getLocalOptionState(ii) +
-                                                        " Remote Option " + ii + ":" + tc.getRemoteOptionState(ii));
-                                 }
-                            }
-                            else if(line.startsWith("REGISTER"))
-                            {
+                            } else if (line.startsWith("OPT")) {
+                                System.out.println("Status of options:");
+                                for (int ii = 0; ii < 25; ii++) {
+                                    System.out.println("Local Option " + ii + ":" + tc.getLocalOptionState(ii) + " Remote Option " + ii + ":"
+                                            + tc.getRemoteOptionState(ii));
+                                }
+                            } else if (line.startsWith("REGISTER")) {
                                 final StringTokenizer st = new StringTokenizer(new String(buff));
-                                try
-                                {
+                                try {
                                     st.nextToken();
                                     final int opcode = Integer.parseInt(st.nextToken());
                                     final boolean initlocal = Boolean.parseBoolean(st.nextToken());
                                     final boolean initremote = Boolean.parseBoolean(st.nextToken());
                                     final boolean acceptlocal = Boolean.parseBoolean(st.nextToken());
                                     final boolean acceptremote = Boolean.parseBoolean(st.nextToken());
-                                    final SimpleOptionHandler opthand = new SimpleOptionHandler(opcode, initlocal, initremote,
-                                                                    acceptlocal, acceptremote);
+                                    final SimpleOptionHandler opthand = new SimpleOptionHandler(opcode, initlocal, initremote, acceptlocal, acceptremote);
                                     tc.addOptionHandler(opthand);
-                                }
-                                catch (final Exception e)
-                                {
-                                    if(e instanceof InvalidTelnetOptionException)
-                                    {
+                                } catch (final Exception e) {
+                                    if (e instanceof InvalidTelnetOptionException) {
                                         System.err.println("Error registering option: " + e.getMessage());
-                                    }
-                                    else
-                                    {
+                                    } else {
                                         System.err.println("Invalid REGISTER command.");
                                         System.err.println("Use REGISTER optcode initlocal initremote acceptlocal acceptremote");
                                         System.err.println("(optcode is an integer.)");
                                         System.err.println("(initlocal, initremote, acceptlocal, acceptremote are boolean)");
                                     }
                                 }
-                            }
-                            else if(line.startsWith("UNREGISTER"))
-                            {
+                            } else if (line.startsWith("UNREGISTER")) {
                                 final StringTokenizer st = new StringTokenizer(new String(buff));
-                                try
-                                {
+                                try {
                                     st.nextToken();
                                     final int opcode = Integer.parseInt(st.nextToken());
                                     tc.deleteOptionHandler(opcode);
-                                }
-                                catch (final Exception e)
-                                {
-                                    if(e instanceof InvalidTelnetOptionException)
-                                    {
+                                } catch (final Exception e) {
+                                    if (e instanceof InvalidTelnetOptionException) {
                                         System.err.println("Error unregistering option: " + e.getMessage());
-                                    }
-                                    else
-                                    {
+                                    } else {
                                         System.err.println("Invalid UNREGISTER command.");
                                         System.err.println("Use UNREGISTER optcode");
                                         System.err.println("(optcode is an integer)");
                                     }
                                 }
-                            }
-                            else if(line.startsWith("SPY"))
-                            {
+                            } else if (line.startsWith("SPY")) {
                                 tc.registerSpyStream(fout);
-                            }
-                            else if(line.startsWith("UNSPY"))
-                            {
+                            } else if (line.startsWith("UNSPY")) {
                                 tc.stopSpyStream();
-                            }
-                            else if(line.matches("^\\^[A-Z^]\\r?\\n?$"))
-                            {
+                            } else if (line.matches("^\\^[A-Z^]\\r?\\n?$")) {
                                 final byte toSend = buff[1];
                                 if (toSend == '^') {
                                     outstr.write(toSend);
@@ -229,120 +174,90 @@ public class TelnetClientExample implements Runnable, TelnetNotificationHandler
                                     outstr.write(toSend - 'A' + 1);
                                 }
                                 outstr.flush();
-                            }
-                            else
-                            {
-                                try
-                                {
-                                        outstr.write(buff, 0 , ret_read);
-                                        outstr.flush();
-                                }
-                                catch (final IOException e)
-                                {
-                                        end_loop = true;
+                            } else {
+                                try {
+                                    outstr.write(buff, 0, ret_read);
+                                    outstr.flush();
+                                } catch (final IOException e) {
+                                    end_loop = true;
                                 }
                             }
                         }
-                    }
-                    catch (final IOException e)
-                    {
+                    } catch (final IOException e) {
                         System.err.println("Exception while reading keyboard:" + e.getMessage());
                         end_loop = true;
                     }
-                }
-                while(ret_read > 0 && !end_loop);
+                } while (ret_read > 0 && !end_loop);
 
-                try
-                {
+                try {
                     tc.disconnect();
-                }
-                catch (final IOException e)
-                {
-                          System.err.println("Exception while connecting:" + e.getMessage());
-                }
-            }
-            catch (final IOException e)
-            {
+                } catch (final IOException e) {
                     System.err.println("Exception while connecting:" + e.getMessage());
-                    System.exit(1);
+                }
+            } catch (final IOException e) {
+                System.err.println("Exception while connecting:" + e.getMessage());
+                System.exit(1);
             }
         }
     }
 
-
     /**
-     * Callback method called when TelnetClient receives an option
-     * negotiation command.
+     * Callback method called when TelnetClient receives an option negotiation command.
      *
-     * @param negotiation_code - type of negotiation command received
-     * (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT, RECEIVED_COMMAND)
-     * @param option_code - code of the option negotiated
+     * @param negotiation_code - type of negotiation command received (RECEIVED_DO, RECEIVED_DONT, RECEIVED_WILL, RECEIVED_WONT, RECEIVED_COMMAND)
+     * @param option_code      - code of the option negotiated
      */
     @Override
-    public void receivedNegotiation(final int negotiation_code, final int option_code)
-    {
+    public void receivedNegotiation(final int negotiation_code, final int option_code) {
         String command = null;
         switch (negotiation_code) {
-            case TelnetNotificationHandler.RECEIVED_DO:
-                command = "DO";
-                break;
-            case TelnetNotificationHandler.RECEIVED_DONT:
-                command = "DONT";
-                break;
-            case TelnetNotificationHandler.RECEIVED_WILL:
-                command = "WILL";
-                break;
-            case TelnetNotificationHandler.RECEIVED_WONT:
-                command = "WONT";
-                break;
-            case TelnetNotificationHandler.RECEIVED_COMMAND:
-                command = "COMMAND";
-                break;
-            default:
-                command = Integer.toString(negotiation_code); // Should not happen
-                break;
+        case TelnetNotificationHandler.RECEIVED_DO:
+            command = "DO";
+            break;
+        case TelnetNotificationHandler.RECEIVED_DONT:
+            command = "DONT";
+            break;
+        case TelnetNotificationHandler.RECEIVED_WILL:
+            command = "WILL";
+            break;
+        case TelnetNotificationHandler.RECEIVED_WONT:
+            command = "WONT";
+            break;
+        case TelnetNotificationHandler.RECEIVED_COMMAND:
+            command = "COMMAND";
+            break;
+        default:
+            command = Integer.toString(negotiation_code); // Should not happen
+            break;
         }
         System.out.println("Received " + command + " for option code " + option_code);
-   }
+    }
 
     /**
-     * Reader thread.
-     * Reads lines from the TelnetClient and echoes them
-     * on the screen.
+     * Reader thread. Reads lines from the TelnetClient and echoes them on the screen.
      */
     @Override
-    public void run()
-    {
+    public void run() {
         final InputStream instr = tc.getInputStream();
 
-        try
-        {
+        try {
             final byte[] buff = new byte[1024];
             int ret_read = 0;
 
-            do
-            {
+            do {
                 ret_read = instr.read(buff);
-                if(ret_read > 0)
-                {
+                if (ret_read > 0) {
                     System.out.print(new String(buff, 0, ret_read));
                 }
-            }
-            while (ret_read >= 0);
-        }
-        catch (final IOException e)
-        {
+            } while (ret_read >= 0);
+        } catch (final IOException e) {
             System.err.println("Exception while reading socket:" + e.getMessage());
         }
 
-        try
-        {
+        try {
             tc.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Exception while closing telnet:" + e.getMessage());
         }
     }
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java b/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java
index cd22b336..ee297e59 100644
--- a/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java
+++ b/src/main/java/org/apache/commons/net/examples/telnet/WeatherTelnet.java
@@ -23,46 +23,32 @@ import org.apache.commons.net.examples.util.IOUtil;
 import org.apache.commons.net.telnet.TelnetClient;
 
 /**
- * This is an example of a trivial use of the TelnetClient class.
- * It connects to the weather server at the University of Michigan,
- * um-weather.sprl.umich.edu port 3000, and allows the user to interact
- * with the server via standard input.  You could use this example to
- * connect to any telnet server, but it is obviously not general purpose
- * because it reads from standard input a line at a time, making it
- * inconvenient for use with a remote interactive shell.  The TelnetClient
- * class used by itself is mostly intended for automating access to telnet
- * resources rather than interactive use.
+ * This is an example of a trivial use of the TelnetClient class. It connects to the weather server at the University of Michigan, um-weather.sprl.umich.edu
+ * port 3000, and allows the user to interact with the server via standard input. You could use this example to connect to any telnet server, but it is
+ * obviously not general purpose because it reads from standard input a line at a time, making it inconvenient for use with a remote interactive shell. The
+ * TelnetClient class used by itself is mostly intended for automating access to telnet resources rather than interactive use.
  */
 
 // This class requires the IOUtil support class!
-public final class WeatherTelnet
-{
+public final class WeatherTelnet {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final TelnetClient telnet;
 
         telnet = new TelnetClient();
 
-        try
-        {
+        try {
             telnet.connect("rainmaker.wunderground.com", 3000);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
 
-        IOUtil.readWrite(telnet.getInputStream(), telnet.getOutputStream(),
-                         System.in, System.out);
+        IOUtil.readWrite(telnet.getInputStream(), telnet.getOutputStream(), System.in, System.out);
 
-        try
-        {
+        try {
             telnet.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
@@ -71,5 +57,3 @@ public final class WeatherTelnet
     }
 
 }
-
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/chargen.java b/src/main/java/org/apache/commons/net/examples/unix/chargen.java
index 713215a0..326a7ef0 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/chargen.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/chargen.java
@@ -28,22 +28,15 @@ import org.apache.commons.net.chargen.CharGenTCPClient;
 import org.apache.commons.net.chargen.CharGenUDPClient;
 
 /**
- * This is an example program demonstrating how to use the CharGenTCPClient
- * and CharGenUDPClient classes.  This program connects to the default
- * chargen service port of a specified server, then reads 100 lines from
- * of generated output, writing each line to standard output, and then
- * closes the connection.  The UDP invocation of the program sends 50
- * datagrams, printing the reply to each.
- * The default is to use the TCP port.  Use the -udp flag to use the UDP
- * port.
+ * This is an example program demonstrating how to use the CharGenTCPClient and CharGenUDPClient classes. This program connects to the default chargen service
+ * port of a specified server, then reads 100 lines from of generated output, writing each line to standard output, and then closes the connection. The UDP
+ * invocation of the program sends 50 datagrams, printing the reply to each. The default is to use the TCP port. Use the -udp flag to use the UDP port.
  * <p>
  * Usage: chargen [-udp] <hostname>
  */
-public final class chargen
-{
+public final class chargen {
 
-    public static void chargenTCP(final String host) throws IOException
-    {
+    public static void chargenTCP(final String host) throws IOException {
         int lines = 100;
         String line;
         final CharGenTCPClient client = new CharGenTCPClient();
@@ -66,8 +59,7 @@ public final class chargen
         client.disconnect();
     }
 
-    public static void chargenUDP(final String host) throws IOException
-    {
+    public static void chargenUDP(final String host) throws IOException {
         int packets = 50;
         byte[] data;
         final InetAddress address;
@@ -81,29 +73,23 @@ public final class chargen
         // the packet is lost.
         client.setSoTimeout(5000);
 
-        while (packets-- > 0)
-        {
+        while (packets-- > 0) {
             client.send(address);
 
-            try
-            {
+            try {
                 data = client.receive();
             }
             // Here we catch both SocketException and InterruptedIOException,
             // because even though the JDK 1.1 docs claim that
             // InterruptedIOException is thrown on a timeout, it seems
             // SocketException is also thrown.
-            catch (final SocketException e)
-            {
+            catch (final SocketException e) {
                 // We timed out and assume the packet is lost.
                 System.err.println("SocketException: Timed out and dropped packet");
                 continue;
-            }
-            catch (final InterruptedIOException e)
-            {
+            } catch (final InterruptedIOException e) {
                 // We timed out and assume the packet is lost.
-                System.err.println(
-                    "InterruptedIOException: Timed out and dropped packet");
+                System.err.println("InterruptedIOException: Timed out and dropped packet");
                 continue;
             }
             System.out.write(data);
@@ -113,36 +99,23 @@ public final class chargen
         client.close();
     }
 
+    public static void main(final String[] args) {
 
-    public static void main(final String[] args)
-    {
-
-        if (args.length == 1)
-        {
-            try
-            {
+        if (args.length == 1) {
+            try {
                 chargenTCP(args[0]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else if (args.length == 2 && args[0].equals("-udp"))
-        {
-            try
-            {
+        } else if (args.length == 2 && args[0].equals("-udp")) {
+            try {
                 chargenUDP(args[1]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else
-        {
+        } else {
             System.err.println("Usage: chargen [-udp] <hostname>");
             System.exit(1);
         }
@@ -150,4 +123,3 @@ public final class chargen
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/daytime.java b/src/main/java/org/apache/commons/net/examples/unix/daytime.java
index 6ccbf645..ecb11ea0 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/daytime.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/daytime.java
@@ -24,20 +24,14 @@ import org.apache.commons.net.daytime.DaytimeTCPClient;
 import org.apache.commons.net.daytime.DaytimeUDPClient;
 
 /**
- * This is an example program demonstrating how to use the DaytimeTCP
- * and DaytimeUDP classes.
- * This program connects to the default daytime service port of a
- * specified server, retrieves the daytime, and prints it to standard output.
- * The default is to use the TCP port.  Use the -udp flag to use the UDP
- * port.
+ * This is an example program demonstrating how to use the DaytimeTCP and DaytimeUDP classes. This program connects to the default daytime service port of a
+ * specified server, retrieves the daytime, and prints it to standard output. The default is to use the TCP port. Use the -udp flag to use the UDP port.
  * <p>
  * Usage: daytime [-udp] <hostname>
  */
-public final class daytime
-{
+public final class daytime {
 
-    public static void daytimeTCP(final String host) throws IOException
-    {
+    public static void daytimeTCP(final String host) throws IOException {
         final DaytimeTCPClient client = new DaytimeTCPClient();
 
         // We want to timeout if a response takes longer than 60 seconds
@@ -47,48 +41,33 @@ public final class daytime
         client.disconnect();
     }
 
-    public static void daytimeUDP(final String host) throws IOException
-    {
+    public static void daytimeUDP(final String host) throws IOException {
         final DaytimeUDPClient client = new DaytimeUDPClient();
 
         // We want to timeout if a response takes longer than 60 seconds
         client.setDefaultTimeout(60000);
         client.open();
-        System.out.println(client.getTime(
-                                          InetAddress.getByName(host)).trim());
+        System.out.println(client.getTime(InetAddress.getByName(host)).trim());
         client.close();
     }
 
+    public static void main(final String[] args) {
 
-    public static void main(final String[] args)
-    {
-
-        if (args.length == 1)
-        {
-            try
-            {
+        if (args.length == 1) {
+            try {
                 daytimeTCP(args[0]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else if (args.length == 2 && args[0].equals("-udp"))
-        {
-            try
-            {
+        } else if (args.length == 2 && args[0].equals("-udp")) {
+            try {
                 daytimeUDP(args[1]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else
-        {
+        } else {
             System.err.println("Usage: daytime [-udp] <hostname>");
             System.exit(1);
         }
@@ -96,4 +75,3 @@ public final class daytime
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/echo.java b/src/main/java/org/apache/commons/net/examples/unix/echo.java
index 27a59995..b753179d 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/echo.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/echo.java
@@ -30,20 +30,15 @@ import org.apache.commons.net.echo.EchoTCPClient;
 import org.apache.commons.net.echo.EchoUDPClient;
 
 /**
- * This is an example program demonstrating how to use the EchoTCPClient
- * and EchoUDPClient classes.  This program connects to the default echo
- * service port of a specified server, then reads lines from standard
- * input, writing them to the echo server, and then printing the echo.
- * The default is to use the TCP port.  Use the -udp flag to use the UDP
- * port.
+ * This is an example program demonstrating how to use the EchoTCPClient and EchoUDPClient classes. This program connects to the default echo service port of a
+ * specified server, then reads lines from standard input, writing them to the echo server, and then printing the echo. The default is to use the TCP port. Use
+ * the -udp flag to use the UDP port.
  * <p>
  * Usage: echo [-udp] <hostname>
  */
-public final class echo
-{
+public final class echo {
 
-    public static void echoTCP(final String host) throws IOException
-    {
+    public static void echoTCP(final String host) throws IOException {
         final EchoTCPClient client = new EchoTCPClient();
         final BufferedReader input;
         final BufferedReader echoInput;
@@ -55,13 +50,10 @@ public final class echo
         client.connect(host);
         System.out.println("Connected to " + host + ".");
         input = new BufferedReader(new InputStreamReader(System.in));
-        echoOutput =
-            new PrintWriter(new OutputStreamWriter(client.getOutputStream()), true);
-        echoInput =
-            new BufferedReader(new InputStreamReader(client.getInputStream()));
+        echoOutput = new PrintWriter(new OutputStreamWriter(client.getOutputStream()), true);
+        echoInput = new BufferedReader(new InputStreamReader(client.getInputStream()));
 
-        while ((line = input.readLine()) != null)
-        {
+        while ((line = input.readLine()) != null) {
             echoOutput.println(line);
             System.out.println(echoInput.readLine());
         }
@@ -71,8 +63,7 @@ public final class echo
         client.disconnect();
     }
 
-    public static void echoUDP(final String host) throws IOException
-    {
+    public static void echoUDP(final String host) throws IOException {
         int length, count;
         byte[] data;
         String line;
@@ -91,39 +82,30 @@ public final class echo
 
         // Remember, there are no guarantees about the ordering of returned
         // UDP packets, so there is a chance the output may be jumbled.
-        while ((line = input.readLine()) != null)
-        {
+        while ((line = input.readLine()) != null) {
             data = line.getBytes();
             client.send(data, address);
             count = 0;
-            do
-            {
-                try
-                {
+            do {
+                try {
                     length = client.receive(data);
                 }
                 // Here we catch both SocketException and InterruptedIOException,
                 // because even though the JDK 1.1 docs claim that
                 // InterruptedIOException is thrown on a timeout, it seems
                 // SocketException is also thrown.
-                catch (final SocketException e)
-                {
+                catch (final SocketException e) {
                     // We timed out and assume the packet is lost.
-                    System.err.println(
-                        "SocketException: Timed out and dropped packet");
+                    System.err.println("SocketException: Timed out and dropped packet");
                     break;
-                }
-                catch (final InterruptedIOException e)
-                {
+                } catch (final InterruptedIOException e) {
                     // We timed out and assume the packet is lost.
-                    System.err.println(
-                        "InterruptedIOException: Timed out and dropped packet");
+                    System.err.println("InterruptedIOException: Timed out and dropped packet");
                     break;
                 }
                 System.out.print(new String(data, 0, length));
                 count += length;
-            }
-            while (count < data.length);
+            } while (count < data.length);
 
             System.out.println();
         }
@@ -131,36 +113,23 @@ public final class echo
         client.close();
     }
 
+    public static void main(final String[] args) {
 
-    public static void main(final String[] args)
-    {
-
-        if (args.length == 1)
-        {
-            try
-            {
+        if (args.length == 1) {
+            try {
                 echoTCP(args[0]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else if (args.length == 2 && args[0].equals("-udp"))
-        {
-            try
-            {
+        } else if (args.length == 2 && args[0].equals("-udp")) {
+            try {
                 echoUDP(args[1]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else
-        {
+        } else {
             System.err.println("Usage: echo [-udp] <hostname>");
             System.exit(1);
         }
@@ -168,4 +137,3 @@ public final class echo
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/finger.java b/src/main/java/org/apache/commons/net/examples/unix/finger.java
index eb658d36..0ee6e1f5 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/finger.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/finger.java
@@ -24,28 +24,22 @@ import java.net.UnknownHostException;
 import org.apache.commons.net.finger.FingerClient;
 
 /**
- * This is an example of how you would implement the finger command
- * in Java using NetComponents.  The Java version is much shorter.
- * But keep in mind that the Unix finger command reads all sorts of
- * local files to output local finger information.  This program only
- * queries the finger daemon.
+ * This is an example of how you would implement the finger command in Java using NetComponents. The Java version is much shorter. But keep in mind that the
+ * Unix finger command reads all sorts of local files to output local finger information. This program only queries the finger daemon.
  * <p>
  * The -l flag is used to request long output from the server.
  */
-public final class finger
-{
+public final class finger {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         boolean longOutput = false;
         int arg = 0, index;
         String handle, host;
         final FingerClient finger;
         InetAddress address = null;
 
-        // Get flags.  If an invalid flag is present, exit with usage message.
-        while (arg < args.length && args[arg].startsWith("-"))
-        {
+        // Get flags. If an invalid flag is present, exit with usage message.
+        while (arg < args.length && args[arg].startsWith("-")) {
             if (args[arg].equals("-l")) {
                 longOutput = true;
             } else {
@@ -55,84 +49,63 @@ public final class finger
             ++arg;
         }
 
-
         finger = new FingerClient();
         // We want to timeout if a response takes longer than 60 seconds
         finger.setDefaultTimeout(60000);
 
-        if (arg >= args.length)
-        {
+        if (arg >= args.length) {
             // Finger local host
 
-            try
-            {
+            try {
                 address = InetAddress.getLocalHost();
-            }
-            catch (final UnknownHostException e)
-            {
+            } catch (final UnknownHostException e) {
                 System.err.println("Error unknown host: " + e.getMessage());
                 System.exit(1);
             }
 
-            try
-            {
+            try {
                 finger.connect(address);
                 System.out.print(finger.query(longOutput));
                 finger.disconnect();
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 System.err.println("Error I/O exception: " + e.getMessage());
                 System.exit(1);
             }
 
-            return ;
+            return;
         }
 
         // Finger each argument
-        while (arg < args.length)
-        {
+        while (arg < args.length) {
 
             index = args[arg].lastIndexOf('@');
 
-            if (index == -1)
-            {
+            if (index == -1) {
                 handle = args[arg];
-                try
-                {
+                try {
                     address = InetAddress.getLocalHost();
-                }
-                catch (final UnknownHostException e)
-                {
+                } catch (final UnknownHostException e) {
                     System.err.println("Error unknown host: " + e.getMessage());
                     System.exit(1);
                 }
-            }
-            else
-            {
+            } else {
                 handle = args[arg].substring(0, index);
                 host = args[arg].substring(index + 1);
 
-                try
-                {
+                try {
                     address = InetAddress.getByName(host);
                     System.out.println("[" + address.getHostName() + "]");
-                }
-                catch (final UnknownHostException e)
-                {
+                } catch (final UnknownHostException e) {
                     System.err.println("Error unknown host: " + e.getMessage());
                     System.exit(1);
                 }
             }
 
-            try
-            {
+            try {
                 finger.connect(address);
                 System.out.print(finger.query(longOutput, handle));
                 finger.disconnect();
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 System.err.println("Error I/O exception: " + e.getMessage());
                 System.exit(1);
             }
@@ -144,4 +117,3 @@ public final class finger
         }
     }
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/fwhois.java b/src/main/java/org/apache/commons/net/examples/unix/fwhois.java
index 2cbca6a0..262050bc 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/fwhois.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/fwhois.java
@@ -24,22 +24,18 @@ import java.net.UnknownHostException;
 import org.apache.commons.net.whois.WhoisClient;
 
 /**
- * This is an example of how you would implement the Linux fwhois command
- * in Java using NetComponents.  The Java version is much shorter.
+ * This is an example of how you would implement the Linux fwhois command in Java using NetComponents. The Java version is much shorter.
  */
-public final class fwhois
-{
+public final class fwhois {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final int index;
         final String handle;
         final String host;
         InetAddress address = null;
         final WhoisClient whois;
 
-        if (args.length != 1)
-        {
+        if (args.length != 1) {
             System.err.println("usage: fwhois handle[@<server>]");
             System.exit(1);
         }
@@ -50,36 +46,27 @@ public final class fwhois
         // We want to timeout if a response takes longer than 60 seconds
         whois.setDefaultTimeout(60000);
 
-        if (index == -1)
-        {
+        if (index == -1) {
             handle = args[0];
             host = WhoisClient.DEFAULT_HOST;
-        }
-        else
-        {
+        } else {
             handle = args[0].substring(0, index);
             host = args[0].substring(index + 1);
         }
 
-        try
-        {
+        try {
             address = InetAddress.getByName(host);
             System.out.println("[" + address.getHostName() + "]");
-        }
-        catch (final UnknownHostException e)
-        {
+        } catch (final UnknownHostException e) {
             System.err.println("Error unknown host: " + e.getMessage());
             System.exit(1);
         }
 
-        try
-        {
+        try {
             whois.connect(address);
             System.out.print(whois.query(handle));
             whois.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Error I/O exception: " + e.getMessage());
             System.exit(1);
         }
diff --git a/src/main/java/org/apache/commons/net/examples/unix/rdate.java b/src/main/java/org/apache/commons/net/examples/unix/rdate.java
index 60edfe3a..ed39c54e 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/rdate.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/rdate.java
@@ -24,56 +24,38 @@ import org.apache.commons.net.time.TimeTCPClient;
 import org.apache.commons.net.time.TimeUDPClient;
 
 /**
- * This is an example program demonstrating how to use the TimeTCPClient
- * and TimeUDPClient classes.  It's very similar to the simple Unix rdate
- * command.  This program connects to the default time service port of a
- * specified server, retrieves the time, and prints it to standard output.
- * The default is to use the TCP port.  Use the -udp flag to use the UDP
- * port.  You can test this program by using the NIST time server at
- * 132.163.135.130 (warning: the IP address may change).
+ * This is an example program demonstrating how to use the TimeTCPClient and TimeUDPClient classes. It's very similar to the simple Unix rdate command. This
+ * program connects to the default time service port of a specified server, retrieves the time, and prints it to standard output. The default is to use the TCP
+ * port. Use the -udp flag to use the UDP port. You can test this program by using the NIST time server at 132.163.135.130 (warning: the IP address may change).
  * <p>
  * Usage: rdate [-udp] <hostname>
  */
-public final class rdate
-{
+public final class rdate {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
 
-        if (args.length == 1)
-        {
-            try
-            {
+        if (args.length == 1) {
+            try {
                 timeTCP(args[0]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else if (args.length == 2 && args[0].equals("-udp"))
-        {
-            try
-            {
+        } else if (args.length == 2 && args[0].equals("-udp")) {
+            try {
                 timeUDP(args[1]);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
-        }
-        else
-        {
+        } else {
             System.err.println("Usage: rdate [-udp] <hostname>");
             System.exit(1);
         }
 
     }
 
-    public static void timeTCP(final String host) throws IOException
-    {
+    public static void timeTCP(final String host) throws IOException {
         final TimeTCPClient client = new TimeTCPClient();
 
         // We want to timeout if a response takes longer than 60 seconds
@@ -83,9 +65,7 @@ public final class rdate
         client.disconnect();
     }
 
-
-    public static void timeUDP(final String host) throws IOException
-    {
+    public static void timeUDP(final String host) throws IOException {
         final TimeUDPClient client = new TimeUDPClient();
 
         // We want to timeout if a response takes longer than 60 seconds
@@ -96,4 +76,3 @@ public final class rdate
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/rexec.java b/src/main/java/org/apache/commons/net/examples/unix/rexec.java
index 688a7fa5..2577c2a7 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/rexec.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/rexec.java
@@ -23,12 +23,9 @@ import org.apache.commons.net.bsd.RExecClient;
 import org.apache.commons.net.examples.util.IOUtil;
 
 /**
- * This is an example program demonstrating how to use the RExecClient class.
- * This program connects to an rexec server and requests that the
- * given command be executed on the server.  It then reads input from stdin
- * (this will be line buffered on most systems, so don't expect character
- * at a time interactivity), passing it to the remote process and writes
- * the process stdout and stderr to local stdout.
+ * This is an example program demonstrating how to use the RExecClient class. This program connects to an rexec server and requests that the given command be
+ * executed on the server. It then reads input from stdin (this will be line buffered on most systems, so don't expect character at a time interactivity),
+ * passing it to the remote process and writes the process stdout and stderr to local stdout.
  * <p>
  * Example: java rexec myhost myusername mypassword "ps -aux"
  * <p>
@@ -36,23 +33,19 @@ import org.apache.commons.net.examples.util.IOUtil;
  */
 
 // This class requires the IOUtil support class!
-public final class rexec
-{
+public final class rexec {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final String server;
         final String username;
         final String password;
         final String command;
         final RExecClient client;
 
-        if (args.length != 4)
-        {
-            System.err.println(
-                "Usage: rexec <hostname> <username> <password> <command>");
+        if (args.length != 4) {
+            System.err.println("Usage: rexec <hostname> <username> <password> <command>");
             System.exit(1);
-            return ; // so compiler can do proper flow control analysis
+            return; // so compiler can do proper flow control analysis
         }
 
         client = new RExecClient();
@@ -62,44 +55,31 @@ public final class rexec
         password = args[2];
         command = args[3];
 
-        try
-        {
+        try {
             client.connect(server);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Could not connect to server.");
             e.printStackTrace();
             System.exit(1);
         }
 
-        try
-        {
+        try {
             client.rexec(username, password, command);
-        }
-        catch (final IOException e)
-        {
-            try
-            {
+        } catch (final IOException e) {
+            try {
                 client.disconnect();
-            }
-            catch (final IOException f)
-            {/* ignored */}
+            } catch (final IOException f) {
+                /* ignored */}
             e.printStackTrace();
             System.err.println("Could not execute command.");
             System.exit(1);
         }
 
+        IOUtil.readWrite(client.getInputStream(), client.getOutputStream(), System.in, System.out);
 
-        IOUtil.readWrite(client.getInputStream(), client.getOutputStream(),
-                         System.in, System.out);
-
-        try
-        {
+        try {
             client.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
@@ -108,4 +88,3 @@ public final class rexec
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/rlogin.java b/src/main/java/org/apache/commons/net/examples/unix/rlogin.java
index cf93e299..9ac5e821 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/rlogin.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/rlogin.java
@@ -23,23 +23,16 @@ import org.apache.commons.net.bsd.RLoginClient;
 import org.apache.commons.net.examples.util.IOUtil;
 
 /**
- * This is an example program demonstrating how to use the RLoginClient
- * class. This program connects to an rlogin daemon and begins to
- * interactively read input from stdin (this will be line buffered on most
- * systems, so don't expect character at a time interactivity), passing it
- * to the remote login process and writing the remote stdout and stderr
- * to local stdout.  If you don't have .rhosts or hosts.equiv files set up,
- * the rlogin daemon will prompt you for a password.
+ * This is an example program demonstrating how to use the RLoginClient class. This program connects to an rlogin daemon and begins to interactively read input
+ * from stdin (this will be line buffered on most systems, so don't expect character at a time interactivity), passing it to the remote login process and
+ * writing the remote stdout and stderr to local stdout. If you don't have .rhosts or hosts.equiv files set up, the rlogin daemon will prompt you for a
+ * password.
  * <p>
- * On Unix systems you will not be able to use the rshell capability
- * unless the process runs as root since only root can bind port addresses
- * lower than 1024.
+ * On Unix systems you will not be able to use the rshell capability unless the process runs as root since only root can bind port addresses lower than 1024.
  * <p>
- * JVM's using green threads will likely have problems if the rlogin daemon
- * requests a password.  This program is merely a demonstration and is
- * not suitable for use as an application, especially given that it relies
- * on line buffered input from System.in.  The best way to run this example
- * is probably from a Win95 dos box into a Unix host.
+ * JVM's using green threads will likely have problems if the rlogin daemon requests a password. This program is merely a demonstration and is not suitable for
+ * use as an application, especially given that it relies on line buffered input from System.in. The best way to run this example is probably from a Win95 dos
+ * box into a Unix host.
  * <p>
  * Example: java rlogin myhost localusername remoteusername vt100
  * <p>
@@ -47,23 +40,19 @@ import org.apache.commons.net.examples.util.IOUtil;
  */
 
 // This class requires the IOUtil support class!
-public final class rlogin
-{
+public final class rlogin {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final String server;
         final String localuser;
         final String remoteuser;
         final String terminal;
         final RLoginClient client;
 
-        if (args.length != 4)
-        {
-            System.err.println(
-                "Usage: rlogin <hostname> <localuser> <remoteuser> <terminal>");
+        if (args.length != 4) {
+            System.err.println("Usage: rlogin <hostname> <localuser> <remoteuser> <terminal>");
             System.exit(1);
-            return ; // so compiler can do proper flow control analysis
+            return; // so compiler can do proper flow control analysis
         }
 
         client = new RLoginClient();
@@ -73,44 +62,31 @@ public final class rlogin
         remoteuser = args[2];
         terminal = args[3];
 
-        try
-        {
+        try {
             client.connect(server);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Could not connect to server.");
             e.printStackTrace();
             System.exit(1);
         }
 
-        try
-        {
+        try {
             client.rlogin(localuser, remoteuser, terminal);
-        }
-        catch (final IOException e)
-        {
-            try
-            {
+        } catch (final IOException e) {
+            try {
                 client.disconnect();
-            }
-            catch (final IOException f)
-            {/* ignored */}
+            } catch (final IOException f) {
+                /* ignored */}
             e.printStackTrace();
             System.err.println("rlogin authentication failed.");
             System.exit(1);
         }
 
+        IOUtil.readWrite(client.getInputStream(), client.getOutputStream(), System.in, System.out);
 
-        IOUtil.readWrite(client.getInputStream(), client.getOutputStream(),
-                         System.in, System.out);
-
-        try
-        {
+        try {
             client.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
@@ -119,4 +95,3 @@ public final class rlogin
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/unix/rshell.java b/src/main/java/org/apache/commons/net/examples/unix/rshell.java
index 67766e64..6502f3a9 100644
--- a/src/main/java/org/apache/commons/net/examples/unix/rshell.java
+++ b/src/main/java/org/apache/commons/net/examples/unix/rshell.java
@@ -23,16 +23,11 @@ import org.apache.commons.net.bsd.RCommandClient;
 import org.apache.commons.net.examples.util.IOUtil;
 
 /**
- * This is an example program demonstrating how to use the RCommandClient
- * class. This program connects to an rshell daemon and requests that the
- * given command be executed on the server.  It then reads input from stdin
- * (this will be line buffered on most systems, so don't expect character
- * at a time interactivity), passing it to the remote process and writes
- * the process stdout and stderr to local stdout.
+ * This is an example program demonstrating how to use the RCommandClient class. This program connects to an rshell daemon and requests that the given command
+ * be executed on the server. It then reads input from stdin (this will be line buffered on most systems, so don't expect character at a time interactivity),
+ * passing it to the remote process and writes the process stdout and stderr to local stdout.
  * <p>
- * On Unix systems you will not be able to use the rshell capability
- * unless the process runs as root since only root can bind port addresses
- * lower than 1024.
+ * On Unix systems you will not be able to use the rshell capability unless the process runs as root since only root can bind port addresses lower than 1024.
  * <p>
  * Example: java rshell myhost localusername remoteusername "ps -aux"
  * <p>
@@ -40,23 +35,19 @@ import org.apache.commons.net.examples.util.IOUtil;
  */
 
 // This class requires the IOUtil support class!
-public final class rshell
-{
+public final class rshell {
 
-    public static void main(final String[] args)
-    {
+    public static void main(final String[] args) {
         final String server;
         final String localuser;
         final String remoteuser;
         final String command;
         final RCommandClient client;
 
-        if (args.length != 4)
-        {
-            System.err.println(
-                "Usage: rshell <hostname> <localuser> <remoteuser> <command>");
+        if (args.length != 4) {
+            System.err.println("Usage: rshell <hostname> <localuser> <remoteuser> <command>");
             System.exit(1);
-            return ; // so compiler can do proper flow control analysis
+            return; // so compiler can do proper flow control analysis
         }
 
         client = new RCommandClient();
@@ -66,44 +57,31 @@ public final class rshell
         remoteuser = args[2];
         command = args[3];
 
-        try
-        {
+        try {
             client.connect(server);
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             System.err.println("Could not connect to server.");
             e.printStackTrace();
             System.exit(1);
         }
 
-        try
-        {
+        try {
             client.rcommand(localuser, remoteuser, command);
-        }
-        catch (final IOException e)
-        {
-            try
-            {
+        } catch (final IOException e) {
+            try {
                 client.disconnect();
-            }
-            catch (final IOException f)
-            {/* ignored */}
+            } catch (final IOException f) {
+                /* ignored */}
             e.printStackTrace();
             System.err.println("Could not execute command.");
             System.exit(1);
         }
 
+        IOUtil.readWrite(client.getInputStream(), client.getOutputStream(), System.in, System.out);
 
-        IOUtil.readWrite(client.getInputStream(), client.getOutputStream(),
-                         System.in, System.out);
-
-        try
-        {
+        try {
             client.disconnect();
-        }
-        catch (final IOException e)
-        {
+        } catch (final IOException e) {
             e.printStackTrace();
             System.exit(1);
         }
@@ -112,4 +90,3 @@ public final class rshell
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/examples/util/IOUtil.java b/src/main/java/org/apache/commons/net/examples/util/IOUtil.java
index df226254..14b6f194 100644
--- a/src/main/java/org/apache/commons/net/examples/util/IOUtil.java
+++ b/src/main/java/org/apache/commons/net/examples/util/IOUtil.java
@@ -25,74 +25,52 @@ import org.apache.commons.net.io.Util;
 import org.apache.commons.net.util.NetConstants;
 
 /**
- * This is a utility class providing a reader/writer capability required
- * by the weatherTelnet, rexec, rshell, and rlogin example programs.
- * The only point of the class is to hold the static method readWrite
- * which spawns a reader thread and a writer thread.  The reader thread
- * reads from a local input source (presumably stdin) and writes the
- * data to a remote output destination.  The writer thread reads from
- * a remote input source and writes to a local output destination.
- * The threads terminate when the remote input source closes.
+ * This is a utility class providing a reader/writer capability required by the weatherTelnet, rexec, rshell, and rlogin example programs. The only point of the
+ * class is to hold the static method readWrite which spawns a reader thread and a writer thread. The reader thread reads from a local input source (presumably
+ * stdin) and writes the data to a remote output destination. The writer thread reads from a remote input source and writes to a local output destination. The
+ * threads terminate when the remote input source closes.
  */
 
-public final class IOUtil
-{
+public final class IOUtil {
 
-    public static void readWrite(final InputStream remoteInput,
-                                       final OutputStream remoteOutput,
-                                       final InputStream localInput,
-                                       final OutputStream localOutput)
-    {
+    public static void readWrite(final InputStream remoteInput, final OutputStream remoteOutput, final InputStream localInput, final OutputStream localOutput) {
         final Thread reader;
         final Thread writer;
 
         reader = new Thread(() -> {
             int ch;
 
-            try
-            {
-                while (!Thread.interrupted() && (ch = localInput.read()) != NetConstants.EOS)
-                {
+            try {
+                while (!Thread.interrupted() && (ch = localInput.read()) != NetConstants.EOS) {
                     remoteOutput.write(ch);
                     remoteOutput.flush();
                 }
-            }
-            catch (final IOException e)
-            {
-                //e.printStackTrace();
+            } catch (final IOException e) {
+                // e.printStackTrace();
             }
         });
 
-
         writer = new Thread(() -> {
-            try
-            {
+            try {
                 Util.copyStream(remoteInput, localOutput);
-            }
-            catch (final IOException e)
-            {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 System.exit(1);
             }
         });
 
-
         writer.setPriority(Thread.currentThread().getPriority() + 1);
 
         writer.start();
         reader.setDaemon(true);
         reader.start();
 
-        try
-        {
+        try {
             writer.join();
             reader.interrupt();
-        }
-        catch (final InterruptedException e)
-        {
+        } catch (final InterruptedException e) {
             // Ignored
         }
     }
 
 }
-
diff --git a/src/main/java/org/apache/commons/net/finger/FingerClient.java b/src/main/java/org/apache/commons/net/finger/FingerClient.java
index 255175e0..2fdb66ed 100644
--- a/src/main/java/org/apache/commons/net/finger/FingerClient.java
+++ b/src/main/java/org/apache/commons/net/finger/FingerClient.java
@@ -27,33 +27,30 @@ import org.apache.commons.net.SocketClient;
 import org.apache.commons.net.util.Charsets;
 
 /**
- * The FingerClient class implements the client side of the Internet Finger
- * Protocol defined in RFC 1288.  To finger a host you create a
- * FingerClient instance, connect to the host, query the host, and finally
- * disconnect from the host.  If the finger service you want to query is on
- * a non-standard port, connect to the host at that port.
- * Here's a sample use:
+ * The FingerClient class implements the client side of the Internet Finger Protocol defined in RFC 1288. To finger a host you create a FingerClient instance,
+ * connect to the host, query the host, and finally disconnect from the host. If the finger service you want to query is on a non-standard port, connect to the
+ * host at that port. Here's a sample use:
+ *
  * <pre>
- *    FingerClient finger;
+ * FingerClient finger;
  *
- *    finger = new FingerClient();
+ * finger = new FingerClient();
  *
- *    try {
- *      finger.connect("foo.bar.com");
- *      System.out.println(finger.query("foobar", false));
- *      finger.disconnect();
- *    } catch(IOException e) {
- *      System.err.println("Error I/O exception: " + e.getMessage());
- *      return;
- *    }
+ * try {
+ *     finger.connect("foo.bar.com");
+ *     System.out.println(finger.query("foobar", false));
+ *     finger.disconnect();
+ * } catch (IOException e) {
+ *     System.err.println("Error I/O exception: " + e.getMessage());
+ *     return;
+ * }
  * </pre>
  *
  */
 
-public class FingerClient extends SocketClient
-{
+public class FingerClient extends SocketClient {
     /**
-     * The default FINGER port.  Set to 79 according to RFC 1288.
+     * The default FINGER port. Set to 79 according to RFC 1288.
      */
     public static final int DEFAULT_PORT = 79;
 
@@ -62,68 +59,49 @@ public class FingerClient extends SocketClient
     private final transient char[] buffer = new char[1024];
 
     /**
-     * The default FingerClient constructor.  Initializes the
-     * default port to <code> DEFAULT_PORT </code>.
+     * The default FingerClient constructor. Initializes the default port to <code> DEFAULT_PORT </code>.
      */
-    public FingerClient()
-    {
+    public FingerClient() {
         setDefaultPort(DEFAULT_PORT);
     }
 
-
     /**
-     * Fingers the connected host and returns the input stream from
-     * the network connection of the finger query.  This is equivalent to
-     * calling getInputStream(longOutput, "").  You must first connect to a
-     * finger server before calling this method, and you should disconnect
-     * after finishing reading the stream.
+     * Fingers the connected host and returns the input stream from the network connection of the finger query. This is equivalent to calling
+     * getInputStream(longOutput, ""). You must first connect to a finger server before calling this method, and you should disconnect after finishing reading
+     * the stream.
      *
      * @param longOutput Set to true if long output is requested, false if not.
-     * @return The InputStream of the network connection of the finger query.
-     *         Can be read to obtain finger results.
+     * @return The InputStream of the network connection of the finger query. Can be read to obtain finger results.
      * @throws IOException If an I/O error during the operation.
      */
-    public InputStream getInputStream(final boolean longOutput) throws IOException
-    {
+    public InputStream getInputStream(final boolean longOutput) throws IOException {
         return getInputStream(longOutput, "");
     }
 
-
     /**
-     * Fingers a user and returns the input stream from the network connection
-     * of the finger query.  You must first connect to a finger server before
-     * calling this method, and you should disconnect after finishing reading
-     * the stream.
+     * Fingers a user and returns the input stream from the network connection of the finger query. You must first connect to a finger server before calling
+     * this method, and you should disconnect after finishing reading the stream.
      *
      * @param longOutput Set to true if long output is requested, false if not.
-     * @param username  The name of the user to finger.
-     * @return The InputStream of the network connection of the finger query.
-     *         Can be read to obtain finger results.
+     * @param username   The name of the user to finger.
+     * @return The InputStream of the network connection of the finger query. Can be read to obtain finger results.
      * @throws IOException If an I/O error during the operation.
      */
-    public InputStream getInputStream(final boolean longOutput, final String username)
-    throws IOException
-    {
+    public InputStream getInputStream(final boolean longOutput, final String username) throws IOException {
         return getInputStream(longOutput, username, null);
     }
 
-
     /**
-     * Fingers a user and returns the input stream from the network connection
-     * of the finger query.  You must first connect to a finger server before
-     * calling this method, and you should disconnect after finishing reading
-     * the stream.
+     * Fingers a user and returns the input stream from the network connection of the finger query. You must first connect to a finger server before calling
+     * this method, and you should disconnect after finishing reading the stream.
      *
      * @param longOutput Set to true if long output is requested, false if not.
-     * @param username  The name of the user to finger.
-     * @param encoding the character encoding that should be used for the query,
-     *        null for the platform's default encoding
-     * @return The InputStream of the network connection of the finger query.
-     *         Can be read to obtain finger results.
+     * @param username   The name of the user to finger.
+     * @param encoding   the character encoding that should be used for the query, null for the platform's default encoding
+     * @return The InputStream of the network connection of the finger query. Can be read to obtain finger results.
      * @throws IOException If an I/O error during the operation.
      */
-    public InputStream getInputStream(final boolean longOutput, final String username, final String encoding)
-            throws IOException {
+    public InputStream getInputStream(final boolean longOutput, final String username, final String encoding) throws IOException {
         final DataOutputStream output;
         final StringBuilder buffer = new StringBuilder(64);
         if (longOutput) {
@@ -144,37 +122,31 @@ public class FingerClient extends SocketClient
     }
 
     /**
-     * Fingers the connected host and returns the output
-     * as a String.  You must first connect to a finger server before
-     * calling this method, and you should disconnect afterward.
-     * This is equivalent to calling <code> query(longOutput, "") </code>.
+     * Fingers the connected host and returns the output as a String. You must first connect to a finger server before calling this method, and you should
+     * disconnect afterward. This is equivalent to calling <code> query(longOutput, "") </code>.
      *
      * @param longOutput Set to true if long output is requested, false if not.
      * @return The result of the finger query.
      * @throws IOException If an I/O error occurs while reading the socket.
      */
-    public String query(final boolean longOutput) throws IOException
-    {
+    public String query(final boolean longOutput) throws IOException {
         return query(longOutput, "");
     }
 
     /**
-     * Fingers a user at the connected host and returns the output
-     * as a String.  You must first connect to a finger server before
-     * calling this method, and you should disconnect afterward.
+     * Fingers a user at the connected host and returns the output as a String. You must first connect to a finger server before calling this method, and you
+     * should disconnect afterward.
      *
      * @param longOutput Set to true if long output is requested, false if not.
-     * @param username  The name of the user to finger.
+     * @param username   The name of the user to finger.
      * @return The result of the finger query.
      * @throws IOException If an I/O error occurs while reading the socket.
      */
-    public String query(final boolean longOutput, final String username) throws IOException
-    {
+    public String query(final boolean longOutput, final String username) throws IOException {
         int read;
         final StringBuilder result = new StringBuilder(buffer.length);
 
-        try (final BufferedReader input = new BufferedReader(
-                new InputStreamReader(getInputStream(longOutput, username), getCharset()))) {
+        try (final BufferedReader input = new BufferedReader(new InputStreamReader(getInputStream(longOutput, username), getCharset()))) {
             while (true) {
                 read = input.read(buffer, 0, buffer.length);
                 if (read <= 0) {
diff --git a/src/main/java/org/apache/commons/net/ftp/Configurable.java b/src/main/java/org/apache/commons/net/ftp/Configurable.java
index bc2bd908..2b24bbb7 100644
--- a/src/main/java/org/apache/commons/net/ftp/Configurable.java
+++ b/src/main/java/org/apache/commons/net/ftp/Configurable.java
@@ -17,19 +17,14 @@
 
 package org.apache.commons.net.ftp;
 
-
 /**
- * This interface adds the aspect of configurability by means of
- * a supplied FTPClientConfig object to other classes in the
- * system, especially listing parsers.
+ * This interface adds the aspect of configurability by means of a supplied FTPClientConfig object to other classes in the system, especially listing parsers.
  */
 public interface Configurable {
 
     /**
      * @param config the object containing the configuration data
-     * @throws IllegalArgumentException if the elements of the
-     * <code>config</code> are somehow inadequate to configure the
-     * Configurable object.
+     * @throws IllegalArgumentException if the elements of the <code>config</code> are somehow inadequate to configure the Configurable object.
      */
     void configure(FTPClientConfig config);
 }
diff --git a/src/main/java/org/apache/commons/net/ftp/FTP.java b/src/main/java/org/apache/commons/net/ftp/FTP.java
index d7969542..af96e1dc 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTP.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTP.java
@@ -16,6 +16,7 @@
  */
 
 package org.apache.commons.net.ftp;
+
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.IOException;
@@ -36,166 +37,116 @@ import org.apache.commons.net.io.CRLFLineReader;
 import org.apache.commons.net.util.NetConstants;
 
 /**
- * FTP provides the basic the functionality necessary to implement your
- * own FTP client.  It extends org.apache.commons.net.SocketClient since
- * extending TelnetClient was causing unwanted behavior (like connections
- * that did not time out properly).
+ * FTP provides the basic the functionality necessary to implement your own FTP client. It extends org.apache.commons.net.SocketClient since extending
+ * TelnetClient was causing unwanted behavior (like connections that did not time out properly).
  * <p>
- * To derive the full benefits of the FTP class requires some knowledge
- * of the FTP protocol defined in RFC 959.  However, there is no reason
- * why you should have to use the FTP class.  The
- * {@link org.apache.commons.net.ftp.FTPClient} class,
- * derived from FTP,
- * implements all the functionality required of an FTP client.  The
- * FTP class is made public to provide access to various FTP constants
- * and to make it easier for adventurous programmers (or those with
- * special needs) to interact with the FTP protocol and implement their
- * own clients.  A set of methods with names corresponding to the FTP
- * command names are provided to facilitate this interaction.
+ * To derive the full benefits of the FTP class requires some knowledge of the FTP protocol defined in RFC 959. However, there is no reason why you should have
+ * to use the FTP class. The {@link org.apache.commons.net.ftp.FTPClient} class, derived from FTP, implements all the functionality required of an FTP client.
+ * The FTP class is made public to provide access to various FTP constants and to make it easier for adventurous programmers (or those with special needs) to
+ * interact with the FTP protocol and implement their own clients. A set of methods with names corresponding to the FTP command names are provided to facilitate
+ * this interaction.
  * <p>
- * You should keep in mind that the FTP server may choose to prematurely
- * close a connection if the client has been idle for longer than a
- * given time period (usually 900 seconds).  The FTP class will detect a
- * premature FTP server connection closing when it receives a
- * {@link org.apache.commons.net.ftp.FTPReply#SERVICE_NOT_AVAILABLE FTPReply.SERVICE_NOT_AVAILABLE }
- *  response to a command.
- * When that occurs, the FTP class method encountering that reply will throw
- * an {@link org.apache.commons.net.ftp.FTPConnectionClosedException}
- * .  <code>FTPConectionClosedException</code>
- * is a subclass of <code> IOException </code> and therefore need not be
- * caught separately, but if you are going to catch it separately, its
- * catch block must appear before the more general <code> IOException </code>
- * catch block.  When you encounter an
- * {@link org.apache.commons.net.ftp.FTPConnectionClosedException}
- * , you must disconnect the connection with
- * {@link #disconnect  disconnect() } to properly clean up the
- * system resources used by FTP.  Before disconnecting, you may check the
- * last reply code and text with
- * {@link #getReplyCode  getReplyCode },
- * {@link #getReplyString  getReplyString },
- * and {@link #getReplyStrings  getReplyStrings}.
- * You may avoid server disconnections while the client is idle by
- * periodicaly sending NOOP commands to the server.
+ * You should keep in mind that the FTP server may choose to prematurely close a connection if the client has been idle for longer than a given time period
+ * (usually 900 seconds). The FTP class will detect a premature FTP server connection closing when it receives a
+ * {@link org.apache.commons.net.ftp.FTPReply#SERVICE_NOT_AVAILABLE FTPReply.SERVICE_NOT_AVAILABLE } response to a command. When that occurs, the FTP class
+ * method encountering that reply will throw an {@link org.apache.commons.net.ftp.FTPConnectionClosedException} . <code>FTPConectionClosedException</code> is a
+ * subclass of <code> IOException </code> and therefore need not be caught separately, but if you are going to catch it separately, its catch block must appear
+ * before the more general <code> IOException </code> catch block. When you encounter an {@link org.apache.commons.net.ftp.FTPConnectionClosedException} , you
+ * must disconnect the connection with {@link #disconnect disconnect() } to properly clean up the system resources used by FTP. Before disconnecting, you may
+ * check the last reply code and text with {@link #getReplyCode getReplyCode }, {@link #getReplyString getReplyString }, and {@link #getReplyStrings
+ * getReplyStrings}. You may avoid server disconnections while the client is idle by periodicaly sending NOOP commands to the server.
  * <p>
- * Rather than list it separately for each method, we mention here that
- * every method communicating with the server and throwing an IOException
- * can also throw a
- * {@link org.apache.commons.net.MalformedServerReplyException}
- * , which is a subclass
- * of IOException.  A MalformedServerReplyException will be thrown when
- * the reply received from the server deviates enough from the protocol
- * specification that it cannot be interpreted in a useful manner despite
- * attempts to be as lenient as possible.
+ * Rather than list it separately for each method, we mention here that every method communicating with the server and throwing an IOException can also throw a
+ * {@link org.apache.commons.net.MalformedServerReplyException} , which is a subclass of IOException. A MalformedServerReplyException will be thrown when the
+ * reply received from the server deviates enough from the protocol specification that it cannot be interpreted in a useful manner despite attempts to be as
+ * lenient as possible.
  *
  * @see FTPClient
  * @see FTPConnectionClosedException
  * @see org.apache.commons.net.MalformedServerReplyException
  */
 
-public class FTP extends SocketClient
-{
+public class FTP extends SocketClient {
     /** The default FTP data port (20). */
     public static final int DEFAULT_DATA_PORT = 20;
     /** The default FTP control port (21). */
     public static final int DEFAULT_PORT = 21;
 
     /**
-     * A constant used to indicate the file(s) being transferred should
-     * be treated as ASCII.  This is the default file type.  All constants
-     * ending in <code>FILE_TYPE</code> are used to indicate file types.
+     * A constant used to indicate the file(s) being transferred should be treated as ASCII. This is the default file type. All constants ending in
+     * <code>FILE_TYPE</code> are used to indicate file types.
      */
     public static final int ASCII_FILE_TYPE = 0;
 
     /**
-     * A constant used to indicate the file(s) being transferred should
-     * be treated as EBCDIC.  Note however that there are several different
-     * EBCDIC formats.  All constants ending in <code>FILE_TYPE</code>
-     * are used to indicate file types.
+     * A constant used to indicate the file(s) being transferred should be treated as EBCDIC. Note however that there are several different EBCDIC formats. All
+     * constants ending in <code>FILE_TYPE</code> are used to indicate file types.
      */
     public static final int EBCDIC_FILE_TYPE = 1;
 
-
     /**
-     * A constant used to indicate the file(s) being transferred should
-     * be treated as a binary image, i.e., no translations should be
-     * performed.  All constants ending in <code>FILE_TYPE</code> are used to
-     * indicate file types.
+     * A constant used to indicate the file(s) being transferred should be treated as a binary image, i.e., no translations should be performed. All constants
+     * ending in <code>FILE_TYPE</code> are used to indicate file types.
      */
     public static final int BINARY_FILE_TYPE = 2;
 
     /**
-     * A constant used to indicate the file(s) being transferred should
-     * be treated as a local type.  All constants ending in
-     * <code>FILE_TYPE</code> are used to indicate file types.
+     * A constant used to indicate the file(s) being transferred should be treated as a local type. All constants ending in <code>FILE_TYPE</code> are used to
+     * indicate file types.
      */
     public static final int LOCAL_FILE_TYPE = 3;
 
     /**
-     * A constant used for text files to indicate a non-print text format.
-     * This is the default format.
-     * All constants ending in <code>TEXT_FORMAT</code> are used to indicate
-     * text formatting for text transfers (both ASCII and EBCDIC).
+     * A constant used for text files to indicate a non-print text format. This is the default format. All constants ending in <code>TEXT_FORMAT</code> are used
+     * to indicate text formatting for text transfers (both ASCII and EBCDIC).
      */
     public static final int NON_PRINT_TEXT_FORMAT = 4;
 
     /**
-     * A constant used to indicate a text file contains format vertical format
-     * control characters.
-     * All constants ending in <code>TEXT_FORMAT</code> are used to indicate
-     * text formatting for text transfers (both ASCII and EBCDIC).
+     * A constant used to indicate a text file contains format vertical format control characters. All constants ending in <code>TEXT_FORMAT</code> are used to
+     * indicate text formatting for text transfers (both ASCII and EBCDIC).
      */
     public static final int TELNET_TEXT_FORMAT = 5;
 
     /**
-     * A constant used to indicate a text file contains ASA vertical format
-     * control characters.
-     * All constants ending in <code>TEXT_FORMAT</code> are used to indicate
-     * text formatting for text transfers (both ASCII and EBCDIC).
+     * A constant used to indicate a text file contains ASA vertical format control characters. All constants ending in <code>TEXT_FORMAT</code> are used to
+     * indicate text formatting for text transfers (both ASCII and EBCDIC).
      */
     public static final int CARRIAGE_CONTROL_TEXT_FORMAT = 6;
 
     /**
-     * A constant used to indicate a file is to be treated as a continuous
-     * sequence of bytes.  This is the default structure.  All constants ending
-     * in <code>_STRUCTURE</code> are used to indicate file structure for
-     * file transfers.
+     * A constant used to indicate a file is to be treated as a continuous sequence of bytes. This is the default structure. All constants ending in
+     * <code>_STRUCTURE</code> are used to indicate file structure for file transfers.
      */
     public static final int FILE_STRUCTURE = 7;
 
     /**
-     * A constant used to indicate a file is to be treated as a sequence
-     * of records.  All constants ending in <code>_STRUCTURE</code>
-     * are used to indicate file structure for file transfers.
+     * A constant used to indicate a file is to be treated as a sequence of records. All constants ending in <code>_STRUCTURE</code> are used to indicate file
+     * structure for file transfers.
      */
     public static final int RECORD_STRUCTURE = 8;
 
     /**
-     * A constant used to indicate a file is to be treated as a set of
-     * independent indexed pages.  All constants ending in
-     * <code>_STRUCTURE</code> are used to indicate file structure for file
-     * transfers.
+     * A constant used to indicate a file is to be treated as a set of independent indexed pages. All constants ending in <code>_STRUCTURE</code> are used to
+     * indicate file structure for file transfers.
      */
     public static final int PAGE_STRUCTURE = 9;
 
     /**
-     * A constant used to indicate a file is to be transferred as a stream
-     * of bytes.  This is the default transfer mode.  All constants ending
-     * in <code>TRANSFER_MODE</code> are used to indicate file transfer
-     * modes.
+     * A constant used to indicate a file is to be transferred as a stream of bytes. This is the default transfer mode. All constants ending in
+     * <code>TRANSFER_MODE</code> are used to indicate file transfer modes.
      */
     public static final int STREAM_TRANSFER_MODE = 10;
 
     /**
-     * A constant used to indicate a file is to be transferred as a series
-     * of blocks.  All constants ending in <code>TRANSFER_MODE</code> are used
-     * to indicate file transfer modes.
+     * A constant used to indicate a file is to be transferred as a series of blocks. All constants ending in <code>TRANSFER_MODE</code> are used to indicate
+     * file transfer modes.
      */
     public static final int BLOCK_TRANSFER_MODE = 11;
 
     /**
-     * A constant used to indicate a file is to be transferred as FTP
-     * compressed data.  All constants ending in <code>TRANSFER_MODE</code>
-     * are used to indicate file transfer modes.
+     * A constant used to indicate a file is to be transferred as FTP compressed data. All constants ending in <code>TRANSFER_MODE</code> are used to indicate
+     * file transfer modes.
      */
     public static final int COMPRESSED_TRANSFER_MODE = 12;
 
@@ -203,11 +154,8 @@ public class FTP extends SocketClient
     // but we use ISO-8859-1 just in case 8-bit characters cross
     // the wire.
     /**
-     * The default character encoding used for communicating over an
-     * FTP control connection.  The default encoding is an
-     * ASCII-compatible encoding.  Some FTP servers expect other
-     * encodings.  You can change the encoding used by an FTP instance
-     * with {@link #setControlEncoding setControlEncoding}.
+     * The default character encoding used for communicating over an FTP control connection. The default encoding is an ASCII-compatible encoding. Some FTP
+     * servers expect other encodings. You can change the encoding used by an FTP instance with {@link #setControlEncoding setControlEncoding}.
      */
     public static final String DEFAULT_CONTROL_ENCODING = "ISO-8859-1";
 
@@ -222,51 +170,39 @@ public class FTP extends SocketClient
     protected String _controlEncoding;
 
     /**
-     * A ProtocolCommandSupport object used to manage the registering of
-     * ProtocolCommandListeners and the firing of ProtocolCommandEvents.
+     * A ProtocolCommandSupport object used to manage the registering of ProtocolCommandListeners and the firing of ProtocolCommandEvents.
      */
     protected ProtocolCommandSupport _commandSupport_;
 
     /**
-     * This is used to signal whether a block of multiline responses beginning
-     * with xxx must be terminated by the same numeric code xxx
-     * See section 4.2 of RFC 959 for details.
+     * This is used to signal whether a block of multiline responses beginning with xxx must be terminated by the same numeric code xxx See section 4.2 of RFC
+     * 959 for details.
      */
     protected boolean strictMultilineParsing;
 
     /**
-     * If this is true, then non-multiline replies must have the format:
-     * 3 digit code <space> <text>
-     * If false, then the 3 digit code does not have to be followed by space
-     * See section 4.2 of RFC 959 for details.
+     * If this is true, then non-multiline replies must have the format: 3 digit code <space> <text> If false, then the 3 digit code does not have to be
+     * followed by space See section 4.2 of RFC 959 for details.
      */
     private boolean strictReplyParsing = true;
 
     /**
-     * Wraps SocketClient._input_ to facilitate the reading of text
-     * from the FTP control connection.  Do not access the control
-     * connection via SocketClient._input_.  This member starts
-     * with a null value, is initialized in {@link #_connectAction_},
-     * and set to null in {@link #disconnect}.
+     * Wraps SocketClient._input_ to facilitate the reading of text from the FTP control connection. Do not access the control connection via
+     * SocketClient._input_. This member starts with a null value, is initialized in {@link #_connectAction_}, and set to null in {@link #disconnect}.
      */
     protected BufferedReader _controlInput_;
 
     /**
-     * Wraps SocketClient._output_ to facilitate the writing of text
-     * to the FTP control connection.  Do not access the control
-     * connection via SocketClient._output_.  This member starts
-     * with a null value, is initialized in {@link #_connectAction_},
-     * and set to null in {@link #disconnect}.
+     * Wraps SocketClient._output_ to facilitate the writing of text to the FTP control connection. Do not access the control connection via
+     * SocketClient._output_. This member starts with a null value, is initialized in {@link #_connectAction_}, and set to null in {@link #disconnect}.
      */
     protected BufferedWriter _controlOutput_;
 
     /**
-     * The default FTP constructor.  Sets the default port to
-     * <code>DEFAULT_PORT</code> and initializes internal data structures
-     * for saving FTP reply information.
+     * The default FTP constructor. Sets the default port to <code>DEFAULT_PORT</code> and initializes internal data structures for saving FTP reply
+     * information.
      */
-    public FTP()
-    {
+    public FTP() {
         setDefaultPort(DEFAULT_PORT);
         _replyLines = new ArrayList<>();
         _newReplyString = false;
@@ -276,19 +212,17 @@ public class FTP extends SocketClient
     }
 
     /**
-     * Get the reply, but don't pass it to command listeners.
-     * Used for keep-alive processing only.
+     * Get the reply, but don't pass it to command listeners. Used for keep-alive processing only.
+     *
      * @since 3.0
      * @throws IOException on error
      */
-    protected void __getReplyNoReport()  throws IOException
-    {
+    protected void __getReplyNoReport() throws IOException {
         getReply(false);
     }
 
     /**
-     * Send a noop and get the reply without reporting to the command listener.
-     * Intended for use with keep-alive.
+     * Send a noop and get the reply without reporting to the command listener. Intended for use with keep-alive.
      *
      * @throws IOException on error
      * @since 3.0
@@ -300,18 +234,15 @@ public class FTP extends SocketClient
     }
 
     /**
-     * Initiates control connections and gets initial reply.
-     * Initializes {@link #_controlInput_} and {@link #_controlOutput_}.
+     * Initiates control connections and gets initial reply. Initializes {@link #_controlInput_} and {@link #_controlOutput_}.
      */
     @Override
-    protected void _connectAction_() throws IOException
-    {
+    protected void _connectAction_() throws IOException {
         _connectAction_(null);
     }
 
     /**
-     * Initiates control connections and gets initial reply.
-     * Initializes {@link #_controlInput_} and {@link #_controlOutput_}.
+     * Initiates control connections and gets initial reply. Initializes {@link #_controlInput_} and {@link #_controlOutput_}.
      *
      * @param socketIsReader the reader to reuse (if non-null)
      * @throws IOException on error
@@ -319,14 +250,12 @@ public class FTP extends SocketClient
      */
     protected void _connectAction_(final Reader socketIsReader) throws IOException {
         super._connectAction_(); // sets up _input_ and _output_
-        if(socketIsReader == null) {
-            _controlInput_ =
-                    new CRLFLineReader(new InputStreamReader(_input_, getControlEncoding()));
+        if (socketIsReader == null) {
+            _controlInput_ = new CRLFLineReader(new InputStreamReader(_input_, getControlEncoding()));
         } else {
             _controlInput_ = new CRLFLineReader(socketIsReader);
         }
-        _controlOutput_ =
-            new BufferedWriter(new OutputStreamWriter(_output_, getControlEncoding()));
+        _controlOutput_ = new BufferedWriter(new OutputStreamWriter(_output_, getControlEncoding()));
         if (connectTimeout > 0) { // NET-385
             final int original = _socket_.getSoTimeout();
             _socket_.setSoTimeout(connectTimeout);
@@ -353,147 +282,103 @@ public class FTP extends SocketClient
     }
 
     /**
-     * A convenience method to send the FTP ABOR command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP ABOR command to the server, receive the reply, and return the reply code.
      *
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int abor() throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int abor() throws IOException {
         return sendCommand(FTPCmd.ABOR);
     }
 
-
     /**
-     * A convenience method to send the FTP ACCT command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP ACCT command to the server, receive the reply, and return the reply code.
      *
-     * @param account  The account name to access.
+     * @param account The account name to access.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int acct(final String account) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int acct(final String account) throws IOException {
         return sendCommand(FTPCmd.ACCT, account);
     }
 
-
     /**
-     * A convenience method to send the FTP ALLO command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP ALLO command to the server, receive the reply, and return the reply code.
      *
      * @param bytes The number of bytes to allocate.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int allo(final int bytes) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int allo(final int bytes) throws IOException {
         return sendCommand(FTPCmd.ALLO, Integer.toString(bytes));
     }
 
-
     /**
-     * A convenience method to send the FTP ALLO command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP ALLO command to the server, receive the reply, and return the reply code.
      *
-     * @param bytes The number of bytes to allocate.
-     * @param recordSize  The size of a record.
+     * @param bytes      The number of bytes to allocate.
+     * @param recordSize The size of a record.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
      */
-    public int allo(final int bytes, final int recordSize) throws IOException
-    {
-        return sendCommand(FTPCmd.ALLO, Integer.toString(bytes) + " R " +
-                           Integer.toString(recordSize));
+    public int allo(final int bytes, final int recordSize) throws IOException {
+        return sendCommand(FTPCmd.ALLO, Integer.toString(bytes) + " R " + Integer.toString(recordSize));
     }
 
-
     /**
-     * A convenience method to send the FTP ALLO command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP ALLO command to the server, receive the reply, and return the reply code.
      *
      * @param bytes The number of bytes to allocate.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int allo(final long bytes) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int allo(final long bytes) throws IOException {
         return sendCommand(FTPCmd.ALLO, Long.toString(bytes));
     }
 
-
     /**
-     * A convenience method to send the FTP ALLO command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP ALLO command to the server, receive the reply, and return the reply code.
      *
-     * @param bytes The number of bytes to allocate.
-     * @param recordSize  The size of a record.
+     * @param bytes      The number of bytes to allocate.
+     * @param recordSize The size of a record.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
      */
-    public int allo(final long bytes, final int recordSize) throws IOException
-    {
-        return sendCommand(FTPCmd.ALLO, Long.toString(bytes) + " R " +
-                           Integer.toString(recordSize));
+    public int allo(final long bytes, final int recordSize) throws IOException {
+        return sendCommand(FTPCmd.ALLO, Long.toString(bytes) + " R " + Integer.toString(recordSize));
     }
 
     /**
-     * A convenience method to send the FTP APPE command to the server,
-     * receive the reply, and return the reply code.  Remember, it is up
-     * to you to manage the data connection.  If you don't need this low
-     * level of access, use {@link org.apache.commons.net.ftp.FTPClient}
-     * , which will handle all low level details for you.
+     * A convenience method to send the FTP APPE command to the server, receive the reply, and return the reply code. Remember, it is up to you to manage the
+     * data connection. If you don't need this low level of access, use {@link org.apache.commons.net.ftp.FTPClient} , which will handle all low level details
+     * for you.
      *
-     * @param pathname  The pathname to use for the file when stored at
-     *                  the remote end of the transfer.
+     * @param pathname The pathname to use for the file when stored at the remote end of the transfer.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int appe(final String pathname) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int appe(final String pathname) throws IOException {
         return sendCommand(FTPCmd.APPE, pathname);
     }
 
@@ -502,8 +387,7 @@ public class FTP extends SocketClient
 
         __commandBuffer.append(command);
 
-        if (args != null)
-        {
+        if (args != null) {
             __commandBuffer.append(' ');
             __commandBuffer.append(args);
         }
@@ -512,73 +396,55 @@ public class FTP extends SocketClient
     }
 
     /**
-     * A convenience method to send the FTP CDUP command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP CDUP command to the server, receive the reply, and return the reply code.
      *
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int cdup() throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int cdup() throws IOException {
         return sendCommand(FTPCmd.CDUP);
     }
 
     /**
-     * A convenience method to send the FTP CWD command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP CWD command to the server, receive the reply, and return the reply code.
      *
      * @param directory The new working directory.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int cwd(final String directory) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int cwd(final String directory) throws IOException {
         return sendCommand(FTPCmd.CWD, directory);
     }
 
     /**
-     * A convenience method to send the FTP DELE command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP DELE command to the server, receive the reply, and return the reply code.
      *
      * @param pathname The pathname to delete.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int dele(final String pathname) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int dele(final String pathname) throws IOException {
         return sendCommand(FTPCmd.DELE, pathname);
     }
 
     /**
-     * Closes the control connection to the FTP server and sets to null
-     * some internal data so that the memory may be reclaimed by the
-     * garbage collector.  The reply text and code information from the
-     * last command is voided so that the memory it used may be reclaimed.
-     * Also sets {@link #_controlInput_} and {@link #_controlOutput_} to null.
+     * Closes the control connection to the FTP server and sets to null some internal data so that the memory may be reclaimed by the garbage collector. The
+     * reply text and code information from the last command is voided so that the memory it used may be reclaimed. Also sets {@link #_controlInput_} and
+     * {@link #_controlOutput_} to null.
      *
      * @throws IOException If an error occurs while disconnecting.
      */
     @Override
-    public void disconnect() throws IOException
-    {
+    public void disconnect() throws IOException {
         super.disconnect();
         _controlInput_ = null;
         _controlOutput_ = null;
@@ -587,8 +453,7 @@ public class FTP extends SocketClient
     }
 
     /**
-     * A convenience method to send the FTP EPRT command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP EPRT command to the server, receive the reply, and return the reply code.
      *
      * Examples:
      * <ul>
@@ -598,20 +463,16 @@ public class FTP extends SocketClient
      *
      * @see "http://www.faqs.org/rfcs/rfc2428.html"
      *
-     * @param host  The host owning the port.
-     * @param port  The new port.
+     * @param host The host owning the port.
+     * @param port The new port.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
      * @since 2.2
      */
-    public int eprt(final InetAddress host, final int port) throws IOException
-    {
+    public int eprt(final InetAddress host, final int port) throws IOException {
         final int num;
         final StringBuilder info = new StringBuilder();
         String h;
@@ -639,39 +500,29 @@ public class FTP extends SocketClient
         return sendCommand(FTPCmd.EPRT, info.toString());
     }
 
-
     /**
-     * A convenience method to send the FTP EPSV command to the server,
-     * receive the reply, and return the reply code.  Remember, it's up
-     * to you to interpret the reply string containing the host/port
-     * information.
+     * A convenience method to send the FTP EPSV command to the server, receive the reply, and return the reply code. Remember, it's up to you to interpret the
+     * reply string containing the host/port information.
      *
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
      * @since 2.2
      */
-    public int epsv() throws IOException
-    {
+    public int epsv() throws IOException {
         return sendCommand(FTPCmd.EPSV);
     }
 
-
     /**
-     * A convenience method to send the FTP FEAT command to the server, receive the reply,
-     * and return the reply code.
+     * A convenience method to send the FTP FEAT command to the server, receive the reply, and return the reply code.
+     *
      * @return The reply code received by the server
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
+     * @throws IOException If an I/O error occurs while either sending the command or receiving the server reply.
      * @since 2.2
      */
-    public int feat() throws IOException
-    {
+    public int feat() throws IOException {
         return sendCommand(FTPCmd.FEAT);
     }
 
@@ -683,39 +534,29 @@ public class FTP extends SocketClient
         return _commandSupport_;
     }
 
-
     /**
-     * @return The character encoding used to communicate over the
-     * control connection.
+     * @return The character encoding used to communicate over the control connection.
      */
     public String getControlEncoding() {
         return _controlEncoding;
     }
 
     /**
-     * Fetches a reply from the FTP server and returns the integer reply
-     * code.  After calling this method, the actual reply text can be accessed
-     * from either  calling {@link #getReplyString  getReplyString } or
-     * {@link #getReplyStrings  getReplyStrings }.  Only use this
-     * method if you are implementing your own FTP client or if you need to
-     * fetch a secondary response from the FTP server.
+     * Fetches a reply from the FTP server and returns the integer reply code. After calling this method, the actual reply text can be accessed from either
+     * calling {@link #getReplyString getReplyString } or {@link #getReplyStrings getReplyStrings }. Only use this method if you are implementing your own FTP
+     * client or if you need to fetch a secondary response from the FTP server.
      *
      * @return The integer value of the reply code of the fetched FTP reply.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while receiving the
-     *                         server reply.
-     */
-    public int getReply() throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while receiving the server reply.
+     */
+    public int getReply() throws IOException {
         return getReply(true);
     }
 
-    private int getReply(final boolean reportReply) throws IOException
-    {
+    private int getReply(final boolean reportReply) throws IOException {
         final int length;
 
         _newReplyString = true;
@@ -724,28 +565,22 @@ public class FTP extends SocketClient
         String line = _controlInput_.readLine();
 
         if (line == null) {
-            throw new FTPConnectionClosedException(
-                    "Connection closed without indication.");
+            throw new FTPConnectionClosedException("Connection closed without indication.");
         }
 
         // In case we run into an anomaly we don't want fatal index exceptions
         // to be thrown.
         length = line.length();
         if (length < REPLY_CODE_LEN) {
-            throw new MalformedServerReplyException(
-                "Truncated server reply: " + line);
+            throw new MalformedServerReplyException("Truncated server reply: " + line);
         }
 
         String code = null;
-        try
-        {
+        try {
             code = line.substring(0, REPLY_CODE_LEN);
             _replyCode = Integer.parseInt(code);
-        }
-        catch (final NumberFormatException e)
-        {
-            throw new MalformedServerReplyException(
-                "Could not parse response code.\nServer Reply: " + line);
+        } catch (final NumberFormatException e) {
+            throw new MalformedServerReplyException("Could not parse response code.\nServer Reply: " + line);
         }
 
         _replyLines.add(line);
@@ -755,13 +590,11 @@ public class FTP extends SocketClient
             final char sep = line.charAt(REPLY_CODE_LEN);
             // Get extra lines if message continues.
             if (sep == '-') {
-                do
-                {
+                do {
                     line = _controlInput_.readLine();
 
                     if (line == null) {
-                        throw new FTPConnectionClosedException(
-                            "Connection closed without indication.");
+                        throw new FTPConnectionClosedException("Connection closed without indication.");
                     }
 
                     _replyLines.add(line);
@@ -769,19 +602,18 @@ public class FTP extends SocketClient
                     // The length() check handles problems that could arise from readLine()
                     // returning too soon after encountering a naked CR or some other
                     // anomaly.
-                }
-                while ( isStrictMultilineParsing() ? strictCheck(line, code) : lenientCheck(line));
+                } while (isStrictMultilineParsing() ? strictCheck(line, code) : lenientCheck(line));
 
             } else if (isStrictReplyParsing()) {
                 if (length == REPLY_CODE_LEN + 1) { // expecting some text
-                    throw new MalformedServerReplyException("Truncated server reply: '" + line +"'");
+                    throw new MalformedServerReplyException("Truncated server reply: '" + line + "'");
                 }
                 if (sep != ' ') {
-                    throw new MalformedServerReplyException("Invalid server reply: '" + line +"'");
+                    throw new MalformedServerReplyException("Invalid server reply: '" + line + "'");
                 }
             }
         } else if (isStrictReplyParsing()) {
-            throw new MalformedServerReplyException("Truncated server reply: '" + line +"'");
+            throw new MalformedServerReplyException("Truncated server reply: '" + line + "'");
         }
 
         if (reportReply) {
@@ -794,29 +626,22 @@ public class FTP extends SocketClient
         return _replyCode;
     }
 
-
     /**
-     * Returns the integer value of the reply code of the last FTP reply.
-     * You will usually only use this method after you connect to the
-     * FTP server to check that the connection was successful since
-     * <code> connect </code> is of type void.
+     * Returns the integer value of the reply code of the last FTP reply. You will usually only use this method after you connect to the FTP server to check
+     * that the connection was successful since <code> connect </code> is of type void.
      *
      * @return The integer value of the reply code of the last FTP reply.
      */
-    public int getReplyCode()
-    {
+    public int getReplyCode() {
         return _replyCode;
     }
 
     /**
-     * Returns the entire text of the last FTP server response exactly
-     * as it was received, including all end of line markers in NETASCII
-     * format.
+     * Returns the entire text of the last FTP server response exactly as it was received, including all end of line markers in NETASCII format.
      *
      * @return The entire text from the last FTP response as a String.
      */
-    public String getReplyString()
-    {
+    public String getReplyString() {
         final StringBuilder buffer;
 
         if (!_newReplyString) {
@@ -826,80 +651,66 @@ public class FTP extends SocketClient
         buffer = new StringBuilder(256);
 
         for (final String line : _replyLines) {
-                buffer.append(line);
-                buffer.append(SocketClient.NETASCII_EOL);
+            buffer.append(line);
+            buffer.append(SocketClient.NETASCII_EOL);
         }
 
-         _newReplyString = false;
+        _newReplyString = false;
 
         return _replyString = buffer.toString();
     }
 
     /**
-     * Returns the nth line of text from the last FTP server response as a string. The end of line markers of each are
-     * stripped from the line.
+     * Returns the nth line of text from the last FTP server response as a string. The end of line markers of each are stripped from the line.
      *
      * @param index The index of the line to return, 0-based.
      *
      * @return The lines of text from the last FTP response as an array.
      */
-    String getReplyString(final int index)
-    {
+    String getReplyString(final int index) {
         return _replyLines.get(index);
     }
 
-
     /**
-     * Returns the lines of text from the last FTP server response as an array
-     * of strings, one entry per line.  The end of line markers of each are
-     * stripped from each line.
+     * Returns the lines of text from the last FTP server response as an array of strings, one entry per line. The end of line markers of each are stripped from
+     * each line.
      *
      * @return The lines of text from the last FTP response as an array.
      */
-    public String[] getReplyStrings()
-    {
+    public String[] getReplyStrings() {
         return _replyLines.toArray(NetConstants.EMPTY_STRING_ARRAY);
     }
 
     /**
-     * A convenience method to send the FTP HELP command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP HELP command to the server, receive the reply, and return the reply code.
      *
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int help() throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int help() throws IOException {
         return sendCommand(FTPCmd.HELP);
     }
 
     /**
-     * A convenience method to send the FTP HELP command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP HELP command to the server, receive the reply, and return the reply code.
      *
-     * @param command  The command name on which to request help.
+     * @param command The command name on which to request help.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int help(final String command) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int help(final String command) throws IOException {
         return sendCommand(FTPCmd.HELP, command);
     }
 
     /**
      * Return whether strict multiline parsing is enabled, as per RFC 959, section 4.2.
+     *
      * @return True if strict, false if lenient
      * @since 2.0
      */
@@ -910,10 +721,9 @@ public class FTP extends SocketClient
     /**
      * Return whether strict non-multiline parsing is enabled, as per RFC 959, section 4.2.
      * <p>
-     * The default is true, which requires the 3 digit code be followed by space and some text.
-     * <br>
-     * If false, only the 3 digit code is required (as was the case for versions up to 3.5)
-     * <br>
+     * The default is true, which requires the 3 digit code be followed by space and some text. <br>
+     * If false, only the 3 digit code is required (as was the case for versions up to 3.5) <br>
+     *
      * @return True if strict (default), false if additional checks are not made
      * @since 3.6
      */
@@ -923,55 +733,41 @@ public class FTP extends SocketClient
 
     // The strict check is too strong a condition because of non-conforming ftp
     // servers like ftp.funet.fi which sent 226 as the last line of a
-    // 426 multi-line reply in response to ls /.  We relax the condition to
+    // 426 multi-line reply in response to ls /. We relax the condition to
     // test that the line starts with a digit rather than starting with
     // the code.
     private boolean lenientCheck(final String line) {
-        return !(line.length() > REPLY_CODE_LEN&& line.charAt(REPLY_CODE_LEN) != '-' &&
-                Character.isDigit(line.charAt(0)));
+        return !(line.length() > REPLY_CODE_LEN && line.charAt(REPLY_CODE_LEN) != '-' && Character.isDigit(line.charAt(0)));
     }
 
     /**
-     * A convenience method to send the FTP LIST command to the server,
-     * receive the reply, and return the reply code.  Remember, it is up
-     * to you to manage the data connection.  If you don't need this low
-     * level of access, use {@link org.apache.commons.net.ftp.FTPClient}
-     * , which will handle all low level details for you.
+     * A convenience method to send the FTP LIST command to the server, receive the reply, and return the reply code. Remember, it is up to you to manage the
+     * data connection. If you don't need this low level of access, use {@link org.apache.commons.net.ftp.FTPClient} , which will handle all low level details
+     * for you.
      *
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int list() throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int list() throws IOException {
         return sendCommand(FTPCmd.LIST);
     }
 
     /**
-     * A convenience method to send the FTP LIST command to the server,
-     * receive the reply, and return the reply code.  Remember, it is up
-     * to you to manage the data connection.  If you don't need this low
-     * level of access, use {@link org.apache.commons.net.ftp.FTPClient}
-     * , which will handle all low level details for you.
+     * A convenience method to send the FTP LIST command to the server, receive the reply, and return the reply code. Remember, it is up to you to manage the
+     * data connection. If you don't need this low level of access, use {@link org.apache.commons.net.ftp.FTPClient} , which will handle all low level details
+     * for you.
      *
-     * @param pathname  The pathname to list,
-     * may be {@code null} in which case the command is sent with no parameters
+     * @param pathname The pathname to list, may be {@code null} in which case the command is sent with no parameters
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int list(final String pathname) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int list(final String pathname) throws IOException {
         return sendCommand(FTPCmd.LIST, pathname);
     }
 
@@ -983,283 +779,205 @@ public class FTP extends SocketClient
      * @throws IOException on error
      * @since 2.0
      **/
-    public int mdtm(final String file) throws IOException
-    {
+    public int mdtm(final String file) throws IOException {
         return sendCommand(FTPCmd.MDTM, file);
     }
 
-     /**
-     * A convenience method to send the FTP MFMT command to the server,
-     * receive the reply, and return the reply code.
+    /**
+     * A convenience method to send the FTP MFMT command to the server, receive the reply, and return the reply code.
      *
      * @param pathname The pathname for which mtime is to be changed
-     * @param timeval Timestamp in <code>yyyyMMDDhhmmss</code> format
+     * @param timeval  Timestamp in <code>yyyyMMDDhhmmss</code> format
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
      * @since 2.2
      * @see <a href="http://tools.ietf.org/html/draft-somers-ftp-mfxx-04">http://tools.ietf.org/html/draft-somers-ftp-mfxx-04</a>
      **/
-    public int mfmt(final String pathname, final String timeval) throws IOException
-    {
+    public int mfmt(final String pathname, final String timeval) throws IOException {
         return sendCommand(FTPCmd.MFMT, timeval + " " + pathname);
     }
 
     /**
-     * A convenience method to send the FTP MKD command to the server,
-     * receive the reply, and return the reply code.
+     * A convenience method to send the FTP MKD command to the server, receive the reply, and return the reply code.
      *
      * @param pathname The pathname of the new directory to create.
      * @return The reply code received from the server.
-     * @throws FTPConnectionClosedException
-     *      If the FTP server prematurely closes the connection as a result
-     *      of the client being idle or some other reason causing the server
-     *      to send FTP reply code 421.  This exception may be caught either
-     *      as an IOException or independently as itself.
-     * @throws IOException  If an I/O error occurs while either sending the
-     *      command or receiving the server reply.
-     */
-    public int mkd(final String pathname) throws IOException
-    {
+     * @throws FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason
+     *                                      causing the server to send FTP reply code 421. This exception may be caught either as an IOException or
+     *                                      independently as itself.
+     * @throws IOException                  If an I/O error occurs while either sending the command or receiving the server reply.
+     */
+    public int mkd(final String pathname) throws IOException {
         return sendCommand(FTPCmd.MKD, pathname);
     }
 
-
     /**
-     * A convenience method to send the FTP MLSD command to the server,
-     * receive the reply, and return the reply code.  Remember, it is up
-     * to you to manage the data connection.  If you don't need this low
-     * level of access, use {@link org.apache.commons.net.ftp.FTPClient}
-     * , which will handle all low level details for you.
... 45796 lines suppressed ...