commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1230358 [1/2] - in /commons/proper/net/trunk/src: main/java/examples/ftp/ main/java/examples/mail/ main/java/examples/nntp/ main/java/examples/ntp/ main/java/examples/telnet/ main/java/examples/unix/ main/java/org/apache/commons/net/ main/...
Date Thu, 12 Jan 2012 01:51:04 GMT
Author: sebb
Date: Thu Jan 12 01:51:02 2012
New Revision: 1230358

URL: http://svn.apache.org/viewvc?rev=1230358&view=rev
Log:
Ensure all conditional statements use blocks
(no code change)

Modified:
    commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
    commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java
    commons/proper/net/trunk/src/main/java/examples/mail/SMTPMail.java
    commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java
    commons/proper/net/trunk/src/main/java/examples/nntp/PostMessage.java
    commons/proper/net/trunk/src/main/java/examples/ntp/NTPClient.java
    commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java
    commons/proper/net/trunk/src/main/java/examples/unix/chargen.java
    commons/proper/net/trunk/src/main/java/examples/unix/finger.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/SocketClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/finger/FingerClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPSClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/DotTerminatedMessageWriter.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIOutputStream.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIInputStream.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIOutputStream.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/Util.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Article.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTP.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/ThreadContainer.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpUtils.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeInfo.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeStamp.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3SClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTP.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPSClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
    commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java

Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Thu Jan 12 01:51:02 2012
@@ -293,8 +293,9 @@ __main:
 
             System.out.println("Remote system is " + ftp.getSystemType());
 
-            if (binaryTransfer)
+            if (binaryTransfer) {
                 ftp.setFileType(FTP.BINARY_FILE_TYPE);
+            }
 
             // Use passive mode as default because most of us are
             // behind firewalls these days.

Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Thu Jan 12 01:51:02 2012
@@ -72,23 +72,22 @@ public final class TFTPExample
             arg = args[argc];
             if (arg.startsWith("-"))
             {
-                if (arg.equals("-r"))
+                if (arg.equals("-r")) {
                     receiveFile = true;
-                else if (arg.equals("-s"))
+                } else if (arg.equals("-s")) {
                     receiveFile = false;
-                else if (arg.equals("-a"))
+                } else if (arg.equals("-a")) {
                     transferMode = TFTP.ASCII_MODE;
-                else if (arg.equals("-b"))
+                } else if (arg.equals("-b")) {
                     transferMode = TFTP.BINARY_MODE;
-                else
-                {
+                } else {
                     System.err.println("Error: unrecognized option.");
                     System.err.print(USAGE);
                     System.exit(1);
                 }
-            }
-            else
+            } else {
                 break;
+            }
         }
 
         // Make sure there are enough arguments
@@ -190,12 +189,11 @@ public final class TFTPExample
                 }
             }
 
-            if (!closed)
+            if (!closed) {
                 System.exit(1);
+            }
 
-        }
-        else
-        {
+        } else {
             // We're sending a file
             FileInputStream input = null;
 
@@ -249,8 +247,9 @@ public final class TFTPExample
                 }
             }
 
-            if (!closed)
+            if (!closed) {
                 System.exit(1);
+            }
 
         }
 

Modified: commons/proper/net/trunk/src/main/java/examples/mail/SMTPMail.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/mail/SMTPMail.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/mail/SMTPMail.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/mail/SMTPMail.java Thu Jan 12 01:51:02 2012
@@ -90,8 +90,9 @@ public final class SMTPMail
 
                 cc = stdin.readLine();
 
-                if (cc== null || cc.length() == 0)
+                if (cc== null || cc.length() == 0) {
                     break;
+                }
 
                 header.addCC(cc.trim());
                 ccList.add(cc.trim());
@@ -131,8 +132,9 @@ public final class SMTPMail
 
 
 
-            for (String recpt : ccList)
+            for (String recpt : ccList) {
                 client.addRecipient(recpt);
+            }
 
             writer = client.sendMessageData();
 

Modified: commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/nntp/ListNewsgroups.java Thu Jan 12 01:51:02 2012
@@ -74,8 +74,9 @@ public final class ListNewsgroups
         {
             try
             {
-                if (client.isConnected())
+                if (client.isConnected()) {
                     client.disconnect();
+                }
             }
             catch (IOException e)
             {

Modified: commons/proper/net/trunk/src/main/java/examples/nntp/PostMessage.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/nntp/PostMessage.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/nntp/PostMessage.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/nntp/PostMessage.java Thu Jan 12 01:51:02 2012
@@ -89,8 +89,9 @@ public final class PostMessage
                 // Of course you don't want to do this because readLine() may be null
                 newsgroup = stdin.readLine().trim();
 
-                if (newsgroup.length() == 0)
+                if (newsgroup.length() == 0) {
                     break;
+                }
 
                 header.addNewsgroup(newsgroup);
             }
@@ -105,11 +106,13 @@ public final class PostMessage
 
             references = stdin.readLine();
 
-            if (organization != null && organization.length() > 0)
+            if (organization != null && organization.length() > 0) {
                 header.addHeaderField("Organization", organization);
+            }
 
-            if (references != null && references.length() > 0)
+            if (references != null && references.length() > 0) {
                 header.addHeaderField("References", references);
+            }
 
             header.addHeaderField("X-Newsreader", "NetComponents");
 

Modified: commons/proper/net/trunk/src/main/java/examples/ntp/NTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ntp/NTPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/ntp/NTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/ntp/NTPClient.java Thu Jan 12 01:51:02 2012
@@ -59,12 +59,13 @@ public final class NTPClient
         NtpV3Packet message = info.getMessage();
         int stratum = message.getStratum();
         String refType;
-        if (stratum <= 0)
+        if (stratum <= 0) {
             refType = "(Unspecified or Unavailable)";
-        else if (stratum == 1)
+        } else if (stratum == 1) {
             refType = "(Primary Reference; e.g., GPS)"; // GPS, radio clock, etc.
-        else
+        } else {
             refType = "(Secondary Reference; e.g. via NTP or SNTP)";
+        }
         // stratum should be 0..15...
         System.out.println(" Stratum: " + stratum + " " + refType);
         int version = message.getVersion();
@@ -95,8 +96,9 @@ public final class NTPClient
                     try {
                         InetAddress addr = InetAddress.getByName(refAddr);
                         String name = addr.getHostName();
-                        if (name != null && !name.equals(refAddr))
+                        if (name != null && !name.equals(refAddr)) {
                             refName = name;
+                        }
                     } catch (UnknownHostException e) {
                         // some stratum-2 servers sync to ref clock device but fudge stratum level higher... (e.g. 2)
                         // ref not valid host maybe it's a reference clock name?
@@ -110,8 +112,9 @@ public final class NTPClient
             }
             // otherwise give up on naming the beast...
         }
-        if (refName != null && refName.length() > 1)
+        if (refName != null && refName.length() > 1) {
             refAddr += " (" + refName + ")";
+        }
         System.out.println(" Reference Identifier:\t" + refAddr);
 
         TimeStamp refNtpTime = message.getReferenceTimeStamp();

Modified: commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/telnet/TelnetClientExample.java Thu Jan 12 01:51:02 2012
@@ -152,8 +152,9 @@ public class TelnetClientExample impleme
                             else if((new String(buff, 0, ret_read)).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));
+                                 for(int ii=0; ii<25; ii++) {
+                                     System.out.println("Local Option " + ii + ":" + tc.getLocalOptionState(ii) + " Remote Option " + ii + ":" + tc.getRemoteOptionState(ii));
+                                 }
                             }
                             else if((new String(buff, 0, ret_read)).startsWith("REGISTER"))
                             {

Modified: commons/proper/net/trunk/src/main/java/examples/unix/chargen.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/unix/chargen.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/unix/chargen.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/unix/chargen.java Thu Jan 12 01:51:02 2012
@@ -61,8 +61,9 @@ public final class chargen
         // present.
         while (lines-- > 0)
         {
-            if ((line = chargenInput.readLine()) == null)
+            if ((line = chargenInput.readLine()) == null) {
                 break;
+            }
             System.out.println(line);
         }
 

Modified: commons/proper/net/trunk/src/main/java/examples/unix/finger.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/unix/finger.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/unix/finger.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/unix/finger.java Thu Jan 12 01:51:02 2012
@@ -47,10 +47,9 @@ public final class finger
         // Get flags.  If an invalid flag is present, exit with usage message.
         while (arg < args.length && args[arg].startsWith("-"))
         {
-            if (args[arg].equals("-l"))
+            if (args[arg].equals("-l")) {
                 longOutput = true;
-            else
-            {
+            } else {
                 System.err.println("usage: finger [-l] [[[handle][@<server>]] ...]");
                 System.exit(1);
             }
@@ -140,8 +139,9 @@ public final class finger
             }
 
             ++arg;
-            if (arg != args.length)
+            if (arg != args.length) {
                 System.out.print("\n");
+            }
         }
     }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java Thu Jan 12 01:51:02 2012
@@ -268,9 +268,10 @@ public abstract class DatagramSocketClie
      ***/
     public void setDatagramSocketFactory(DatagramSocketFactory factory)
     {
-        if (factory == null)
+        if (factory == null) {
             _socketFactory_ = __DEFAULT_SOCKET_FACTORY;
-        else
+        } else {
             _socketFactory_ = factory;
+        }
     }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/SocketClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/SocketClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/SocketClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/SocketClient.java Thu Jan 12 01:51:02 2012
@@ -163,8 +163,12 @@ public abstract class SocketClient
     throws SocketException, IOException
     {
         _socket_ = _socketFactory_.createSocket();
-        if (receiveBufferSize != -1) _socket_.setReceiveBufferSize(receiveBufferSize);
-        if (sendBufferSize != -1) _socket_.setSendBufferSize(sendBufferSize);
+        if (receiveBufferSize != -1) {
+            _socket_.setReceiveBufferSize(receiveBufferSize);
+        }
+        if (sendBufferSize != -1) {
+            _socket_.setSendBufferSize(sendBufferSize);
+        }
         _socket_.connect(new InetSocketAddress(host, port), connectTimeout);
         _connectAction_();
     }
@@ -210,8 +214,12 @@ public abstract class SocketClient
     throws SocketException, IOException
     {
         _socket_ = _socketFactory_.createSocket();
-        if (receiveBufferSize != -1) _socket_.setReceiveBufferSize(receiveBufferSize);
-        if (sendBufferSize != -1) _socket_.setSendBufferSize(sendBufferSize);
+        if (receiveBufferSize != -1) {
+            _socket_.setReceiveBufferSize(receiveBufferSize);
+        }
+        if (sendBufferSize != -1) {
+            _socket_.setSendBufferSize(sendBufferSize);
+        }
         _socket_.bind(new InetSocketAddress(localAddr, localPort));
         _socket_.connect(new InetSocketAddress(host, port), connectTimeout);
         _connectAction_();
@@ -325,8 +333,9 @@ public abstract class SocketClient
      */
     public boolean isConnected()
     {
-        if (_socket_ == null)
+        if (_socket_ == null) {
             return false;
+        }
 
         return _socket_.isConnected();
     }
@@ -343,15 +352,27 @@ public abstract class SocketClient
         if (isConnected()) {
             try
             {
-                if (_socket_.getInetAddress() == null) return false;
-                if (_socket_.getPort() == 0) return false;
-                if (_socket_.getRemoteSocketAddress() == null) return false;
-                if (_socket_.isClosed()) return false;
+                if (_socket_.getInetAddress() == null) {
+                    return false;
+                }
+                if (_socket_.getPort() == 0) {
+                    return false;
+                }
+                if (_socket_.getRemoteSocketAddress() == null) {
+                    return false;
+                }
+                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: */
-                if (_socket_.isInputShutdown()) return false;
-                if (_socket_.isOutputShutdown()) return false;
+                if (_socket_.isInputShutdown()) {
+                    return false;
+                }
+                if (_socket_.isOutputShutdown()) {
+                    return false;
+                }
                 /* ignore the result, catch exceptions: */
                 _socket_.getInputStream();
                 _socket_.getOutputStream();
@@ -644,10 +665,11 @@ public abstract class SocketClient
      */
     public void setSocketFactory(SocketFactory factory)
     {
-        if (factory == null)
+        if (factory == null) {
             _socketFactory_ = __DEFAULT_SOCKET_FACTORY;
-        else
+        } else {
             _socketFactory_ = factory;
+        }
     }
 
     /**
@@ -660,10 +682,11 @@ public abstract class SocketClient
      * @since 2.0
      */
     public void setServerSocketFactory(ServerSocketFactory factory) {
-        if (factory == null)
+        if (factory == null) {
             _serverSocketFactory_ = __DEFAULT_SERVER_SOCKET_FACTORY;
-        else
+        } else {
             _serverSocketFactory_ = factory;
+        }
     }
 
     /**

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RCommandClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RCommandClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RCommandClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RCommandClient.java Thu Jan 12 01:51:02 2012
@@ -203,8 +203,9 @@ public class RCommandClient extends RExe
             break;
         }
 
-        if (localPort < MIN_CLIENT_PORT)
+        if (localPort < MIN_CLIENT_PORT) {
             throw new BindException("All ports in use or insufficient permssion.");
+        }
 
         _connectAction_();
     }
@@ -306,8 +307,9 @@ public class RCommandClient extends RExe
                         InetAddress localAddr, int localPort)
     throws SocketException, IOException, IllegalArgumentException
     {
-        if (localPort < MIN_CLIENT_PORT || localPort > MAX_CLIENT_PORT)
+        if (localPort < MIN_CLIENT_PORT || localPort > MAX_CLIENT_PORT) {
             throw new IllegalArgumentException("Invalid port number " + localPort);
+        }
         super.connect(host, port, localAddr, localPort);
     }
 
@@ -338,8 +340,9 @@ public class RCommandClient extends RExe
                         InetAddress localAddr, int localPort)
     throws SocketException, IOException, IllegalArgumentException, UnknownHostException
     {
-        if (localPort < MIN_CLIENT_PORT || localPort > MAX_CLIENT_PORT)
+        if (localPort < MIN_CLIENT_PORT || localPort > MAX_CLIENT_PORT) {
             throw new IllegalArgumentException("Invalid port number " + localPort);
+        }
         super.connect(hostname, port, localAddr, localPort);
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/bsd/RExecClient.java Thu Jan 12 01:51:02 2012
@@ -219,17 +219,15 @@ public class RExecClient extends SocketC
         _output_.flush();
 
         ch = _input_.read();
-        if (ch > 0)
-        {
+        if (ch > 0) {
             StringBuilder buffer = new StringBuilder();
 
-            while ((ch = _input_.read()) != -1 && ch != '\n')
+            while ((ch = _input_.read()) != -1 && ch != '\n') {
                 buffer.append((char)ch);
+            }
 
             throw new IOException(buffer.toString());
-        }
-        else if (ch < 0)
-        {
+        } else if (ch < 0) {
             throw new IOException("Server closed connection.");
         }
     }
@@ -254,8 +252,9 @@ public class RExecClient extends SocketC
     @Override
     public void disconnect() throws IOException
     {
-        if (_errorStream_ != null)
+        if (_errorStream_ != null) {
             _errorStream_.close();
+        }
         _errorStream_ = null;
         super.disconnect();
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/daytime/DaytimeTCPClient.java Thu Jan 12 01:51:02 2012
@@ -79,8 +79,9 @@ public final class DaytimeTCPClient exte
         while (true)
         {
             read = reader.read(__buffer, 0, __buffer.length);
-            if (read <= 0)
+            if (read <= 0) {
                 break;
+            }
             result.append(__buffer, 0, read);
         }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/finger/FingerClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/finger/FingerClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/finger/FingerClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/finger/FingerClient.java Thu Jan 12 01:51:02 2012
@@ -95,8 +95,9 @@ public class FingerClient extends Socket
             while (true)
             {
                 read = input.read(__buffer, 0, __buffer.length);
-                if (read <= 0)
+                if (read <= 0) {
                     break;
+                }
                 result.append(__buffer, 0, read);
             }
         } finally {
@@ -160,8 +161,9 @@ public class FingerClient extends Socket
     {
         DataOutputStream output;
         StringBuilder buffer = new StringBuilder(64);
-        if (longOutput)
+        if (longOutput) {
             buffer.append(__LONG_FLAG);
+        }
         buffer.append(username);
         buffer.append(SocketClient.NETASCII_EOL);
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java Thu Jan 12 01:51:02 2012
@@ -309,16 +309,18 @@ public class FTP extends SocketClient
 
         String line = _controlInput_.readLine();
 
-        if (line == null)
+        if (line == null) {
             throw new FTPConnectionClosedException(
-                "Connection closed without indication.");
+                    "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 < 3)
+        if (length < 3) {
             throw new MalformedServerReplyException(
                 "Truncated server reply: " + line);
+        }
 
         String code = null;
         try
@@ -341,9 +343,10 @@ public class FTP extends SocketClient
             {
                 line = _controlInput_.readLine();
 
-                if (line == null)
+                if (line == null) {
                     throw new FTPConnectionClosedException(
                         "Connection closed without indication.");
+                }
 
                 _replyLines.add(line);
 
@@ -379,8 +382,9 @@ public class FTP extends SocketClient
             try {
                 __getReply();
                 // If we received code 120, we have to fetch completion reply.
-                if (FTPReply.isPositivePreliminary(_replyCode))
+                if (FTPReply.isPositivePreliminary(_replyCode)) {
                     __getReply();
+                }
             } catch (SocketTimeoutException e) {
                 IOException ioe = new IOException("Timed out waiting for initial connect reply");
                 ioe.initCause(e);
@@ -391,8 +395,9 @@ public class FTP extends SocketClient
         } else {
             __getReply();
             // If we received code 120, we have to fetch completion reply.
-            if (FTPReply.isPositivePreliminary(_replyCode))
+            if (FTPReply.isPositivePreliminary(_replyCode)) {
                 __getReply();
+            }
         }
     }
 
@@ -907,15 +912,17 @@ public class FTP extends SocketClient
         // If IPv6, trim the zone index
         h = host.getHostAddress();
         num = h.indexOf("%");
-        if (num > 0)
+        if (num > 0) {
             h = h.substring(0, num);
+        }
 
         info.append("|");
 
-        if (host instanceof Inet4Address)
+        if (host instanceof Inet4Address) {
             info.append("1");
-        else if (host instanceof Inet6Address)
+        } else if (host instanceof Inet6Address) {
             info.append("2");
+        }
         info.append("|");
         info.append(h);
         info.append("|");
@@ -989,10 +996,11 @@ public class FTP extends SocketClient
 
         arg.append(__modes.charAt(fileType));
         arg.append(' ');
-        if (fileType == LOCAL_FILE_TYPE)
+        if (fileType == LOCAL_FILE_TYPE) {
             arg.append(formatOrByteSize);
-        else
+        } else {
             arg.append(__modes.charAt(formatOrByteSize));
+        }
 
         return sendCommand(FTPCommand.TYPE, arg.toString());
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java Thu Jan 12 01:51:02 2012
@@ -197,7 +197,9 @@ public class FTPSClient extends FTPClien
     @Override
     protected void _connectAction_() throws IOException {
         // Implicit mode.
-        if (isImplicit) sslNegotiation();
+        if (isImplicit) {
+            sslNegotiation();
+        }
         super._connectAction_();
         // Explicit mode.
         if (!isImplicit) {
@@ -227,7 +229,7 @@ public class FTPSClient extends FTPClien
      * @throws IOException
      */
     private void initSslContext() throws IOException {
-        if(context == null) {
+        if (context == null) {
             context = SSLContextUtils.createSSLContext(protocol, getKeyManager(), getTrustManager());
         }
     }
@@ -254,8 +256,12 @@ public class FTPSClient extends FTPClien
             socket.setWantClientAuth(isWantClientAuth);
         }
 
-        if (protocols != null) socket.setEnabledProtocols(protocols);
-        if (suites != null) socket.setEnabledCipherSuites(suites);
+        if (protocols != null) {
+            socket.setEnabledProtocols(protocols);
+        }
+        if (suites != null) {
+            socket.setEnabledCipherSuites(suites);
+        }
         socket.startHandshake();
 
         _socket_ = socket;
@@ -301,8 +307,9 @@ public class FTPSClient extends FTPClien
      * false - indicates that an existing session must be resumed.
      */
     public boolean getEnableSessionCreation() {
-        if (_socket_ instanceof SSLSocket)
+        if (_socket_ instanceof SSLSocket) {
             return ((SSLSocket)_socket_).getEnableSessionCreation();
+        }
         return false;
     }
 
@@ -321,8 +328,9 @@ public class FTPSClient extends FTPClien
      * that the client authenticate itself.
      */
     public boolean getNeedClientAuth() {
-        if (_socket_ instanceof SSLSocket)
+        if (_socket_ instanceof SSLSocket) {
             return ((SSLSocket)_socket_).getNeedClientAuth();
+        }
         return false;
     }
 
@@ -343,8 +351,9 @@ public class FTPSClient extends FTPClien
      * that the client authenticate itself.
      */
     public boolean getWantClientAuth() {
-        if (_socket_ instanceof SSLSocket)
+        if (_socket_ instanceof SSLSocket) {
             return ((SSLSocket)_socket_).getWantClientAuth();
+        }
         return false;
     }
 
@@ -365,8 +374,9 @@ public class FTPSClient extends FTPClien
      * in "client" mode.
      */
     public boolean getUseClientMode() {
-        if (_socket_ instanceof SSLSocket)
+        if (_socket_ instanceof SSLSocket) {
             return ((SSLSocket)_socket_).getUseClientMode();
+        }
         return false;
     }
 
@@ -387,8 +397,9 @@ public class FTPSClient extends FTPClien
      * @return An array of cipher suite names, or <code>null</code>
      */
     public String[] getEnabledCipherSuites() {
-        if (_socket_ instanceof SSLSocket)
+        if (_socket_ instanceof SSLSocket) {
             return ((SSLSocket)_socket_).getEnabledCipherSuites();
+        }
         return null;
     }
 
@@ -409,8 +420,9 @@ public class FTPSClient extends FTPClien
      * @return An array of protocols, or <code>null</code>
      */
     public String[] getEnabledProtocols() {
-        if (_socket_ instanceof SSLSocket)
+        if (_socket_ instanceof SSLSocket) {
             return ((SSLSocket)_socket_).getEnabledProtocols();
+        }
         return null;
     }
 
@@ -423,8 +435,9 @@ public class FTPSClient extends FTPClien
      * @see #parsePBSZ(long)
      */
     public void execPBSZ(long pbsz) throws SSLException, IOException {
-        if (pbsz < 0 || 4294967295L < pbsz) // 32-bit unsigned number
+        if (pbsz < 0 || 4294967295L < pbsz) { // 32-bit unsigned number
             throw new IllegalArgumentException();
+        }
         int status = sendCommand(CMD_PBSZ, String.valueOf(pbsz));
         if (FTPReply.COMMAND_OK != status) {
             throw new SSLException(getReplyString());
@@ -473,10 +486,15 @@ public class FTPSClient extends FTPClien
      * the command.
      */
     public void execPROT(String prot) throws SSLException, IOException {
-        if (prot == null) prot = DEFAULT_PROT;
-        if (!checkPROTValue(prot)) throw new IllegalArgumentException();
-        if (FTPReply.COMMAND_OK != sendCommand(CMD_PROT, prot))
+        if (prot == null) {
+            prot = DEFAULT_PROT;
+        }
+        if (!checkPROTValue(prot)) {
+            throw new IllegalArgumentException();
+        }
+        if (FTPReply.COMMAND_OK != sendCommand(CMD_PROT, prot)) {
             throw new SSLException(getReplyString());
+        }
         if (DEFAULT_PROT.equals(prot)) {
             setSocketFactory(null);
             setServerSocketFactory(null);
@@ -494,7 +512,9 @@ public class FTPSClient extends FTPClien
      */
     private boolean checkPROTValue(String prot) {
         for (int p = 0; p < PROT_COMMAND_VALUE.length; p++) {
-            if (PROT_COMMAND_VALUE[p].equals(prot)) return true;
+            if (PROT_COMMAND_VALUE[p].equals(prot)) {
+                return true;
+            }
         }
         return false;
     }
@@ -748,8 +768,9 @@ public class FTPSClient extends FTPClien
      */
     public byte[] parseADATReply(String reply)
     {
-        if (reply == null) return null;
-        else {
+        if (reply == null) {
+            return null;
+        } else {
             return Base64.decodeBase64(extractPrefixedData("ADAT=", reply));
         }
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java Thu Jan 12 01:51:02 2012
@@ -88,8 +88,9 @@ public class DefaultFTPFileEntryParserFa
      */
     public FTPFileEntryParser createFileEntryParser(String key)
     {
-        if (key == null)
+        if (key == null) {
             throw new ParserInitializationException("Parser key cannot be null");
+        }
         return createFileEntryParser(key, null);
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java Thu Jan 12 01:51:02 2012
@@ -233,12 +233,13 @@ public class MVSFTPEntryParser extends C
         boolean isParsed = false;
         FTPFile f = new FTPFile();
 
-        if (isType == FILE_LIST_TYPE)
+        if (isType == FILE_LIST_TYPE) {
             isParsed = parseFileList(f, entry);
-        else if (isType == MEMBER_LIST_TYPE) {
+        } else if (isType == MEMBER_LIST_TYPE) {
             isParsed = parseMemberList(f, entry);
-            if (!isParsed)
+            if (!isParsed) {
                 isParsed = parseSimpleEntry(f, entry);
+            }
         } else if (isType == UNIX_LIST_TYPE) {
             isParsed = parseUnixList(f, entry);
         } else if (isType == JES_LEVEL_1_LIST_TYPE) {
@@ -247,8 +248,9 @@ public class MVSFTPEntryParser extends C
             isParsed = parseJeslevel2List(f, entry);
         }
 
-        if (!isParsed)
+        if (!isParsed) {
             f = null;
+        }
 
         return f;
     }
@@ -372,8 +374,9 @@ public class MVSFTPEntryParser extends C
      */
     private boolean parseUnixList(FTPFile file, String entry) {
         file = unixFTPEntryParser.parseFTPEntry(entry);
-        if (file == null)
+        if (file == null) {
             return false;
+        }
         return true;
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java Thu Jan 12 01:51:02 2012
@@ -216,7 +216,9 @@ public class AuthenticatingIMAPClient ex
         StringBuilder result = new StringBuilder(a.length*2);
         for (int i = 0; i < a.length; i++)
         {
-            if ( (a[i] & 0x0FF) <= 15 ) result.append("0");
+            if ( (a[i] & 0x0FF) <= 15 ) {
+                result.append("0");
+            }
             result.append(Integer.toHexString(a[i] & 0x0FF));
         }
         return result.toString();

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java Thu Jan 12 01:51:02 2012
@@ -102,8 +102,9 @@ public class IMAP extends SocketClient
         _replyLines.clear();
         String line = _reader.readLine();
 
-        if (line == null)
+        if (line == null) {
             throw new EOFException("Connection closed without indication.");
+        }
 
         _replyLines.add(line);
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPClient.java Thu Jan 12 01:51:02 2012
@@ -243,11 +243,15 @@ public class IMAPClient extends IMAP
     public boolean append(String mailboxName, String flags, String datetime) throws IOException
     {
         String args = mailboxName;
-        if (flags != null) args += " " + flags;
-        if (datetime != null)
-        {
-            if (datetime.charAt(0) == '{') args += " " + datetime;
-            else args += " {" + datetime + "}";
+        if (flags != null) {
+            args += " " + flags;
+        }
+        if (datetime != null) {
+            if (datetime.charAt(0) == '{') {
+                args += " " + datetime;
+            } else {
+                args += " {" + datetime + "}";
+            }
         }
         return doCommand (IMAPCommand.APPEND, args);
     }
@@ -305,7 +309,9 @@ public class IMAPClient extends IMAP
     public boolean search(String charset, String criteria) throws IOException
     {
         String args = "";
-        if (charset != null) args += "CHARSET " + charset;
+        if (charset != null) {
+            args += "CHARSET " + charset;
+        }
         args += criteria;
         return doCommand (IMAPCommand.SEARCH, args);
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPSClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPSClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAPSClient.java Thu Jan 12 01:51:02 2012
@@ -156,7 +156,9 @@ public class IMAPSClient extends IMAPCli
     protected void _connectAction_() throws IOException
     {
         // Implicit mode.
-        if (isImplicit) performSSLNegotiation();
+        if (isImplicit) {
+            performSSLNegotiation();
+        }
         super._connectAction_();
         // Explicit mode - don't do anything. The user calls execTLS()
     }
@@ -190,8 +192,12 @@ public class IMAPSClient extends IMAPCli
         socket.setEnableSessionCreation(true);
         socket.setUseClientMode(true);
 
-        if (protocols != null) socket.setEnabledProtocols(protocols);
-        if (suites != null) socket.setEnabledCipherSuites(suites);
+        if (protocols != null) {
+            socket.setEnabledProtocols(protocols);
+        }
+        if (suites != null) {
+            socket.setEnabledCipherSuites(suites);
+        }
         socket.startHandshake();
 
         _socket_ = socket;

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/DotTerminatedMessageWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/DotTerminatedMessageWriter.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/DotTerminatedMessageWriter.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/DotTerminatedMessageWriter.java Thu Jan 12 01:51:02 2012
@@ -83,15 +83,17 @@ public final class DotTerminatedMessageW
                 __output.write('\r');
                 return ;
             case '\n':
-                if (__state != __LAST_WAS_CR_STATE)
+                if (__state != __LAST_WAS_CR_STATE) {
                     __output.write('\r');
+                }
                 __output.write('\n');
                 __state = __LAST_WAS_NL_STATE;
                 return ;
             case '.':
                 // Double the dot at the beginning of a line
-                if (__state == __LAST_WAS_NL_STATE)
+                if (__state == __LAST_WAS_NL_STATE) {
                     __output.write('.');
+                }
                 //$FALL-THROUGH$
             default:
                 __state = __NOTHING_SPECIAL_STATE;
@@ -117,8 +119,9 @@ public final class DotTerminatedMessageW
     {
         synchronized (lock)
         {
-            while (length-- > 0)
+            while (length-- > 0) {
                 write(buffer[offset++]);
+            }
         }
     }
 
@@ -196,13 +199,15 @@ public final class DotTerminatedMessageW
     {
         synchronized (lock)
         {
-            if (__output == null)
+            if (__output == null) {
                 return ;
+            }
 
-            if (__state == __LAST_WAS_CR_STATE)
+            if (__state == __LAST_WAS_CR_STATE) {
                 __output.write('\n');
-            else if (__state != __LAST_WAS_NL_STATE)
+            } else if (__state != __LAST_WAS_NL_STATE) {
                 __output.write("\r\n");
+            }
 
             __output.write(".\r\n");
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIInputStream.java Thu Jan 12 01:51:02 2012
@@ -87,8 +87,9 @@ public final class FromNetASCIIInputStre
             }
             else
             {
-                if (ch != -1)
+                if (ch != -1) {
                     unread(ch);
+                }
                 return '\r';
             }
         }
@@ -113,8 +114,9 @@ public final class FromNetASCIIInputStre
     @Override
     public int read() throws IOException
     {
-        if (_noConversionRequired)
+        if (_noConversionRequired) {
             return super.read();
+        }
 
         return __read();
     }
@@ -155,11 +157,13 @@ public final class FromNetASCIIInputStre
     @Override
     public int read(byte buffer[], int offset, int length) throws IOException
     {
-        if (_noConversionRequired)
+        if (_noConversionRequired) {
             return super.read(buffer, offset, length);
+        }
 
-        if (length < 1)
+        if (length < 1) {
             return 0;
+        }
 
         int ch, off;
 
@@ -168,12 +172,14 @@ public final class FromNetASCIIInputStre
         __length = (length > ch ? ch : length);
 
         // If nothing is available, block to read only one character
-        if (__length < 1)
+        if (__length < 1) {
             __length = 1;
+        }
 
 
-        if ((ch = __read()) == -1)
+        if ((ch = __read()) == -1) {
             return -1;
+        }
 
         off = offset;
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIOutputStream.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIOutputStream.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/FromNetASCIIOutputStream.java Thu Jan 12 01:51:02 2012
@@ -146,8 +146,9 @@ public final class FromNetASCIIOutputStr
             return ;
         }
 
-        while (length-- > 0)
+        while (length-- > 0) {
             __write(buffer[offset++]);
+        }
     }
 
 
@@ -166,8 +167,9 @@ public final class FromNetASCIIOutputStr
             return ;
         }
 
-        if (__lastWasCR)
+        if (__lastWasCR) {
             out.write('\r');
+        }
         super.close();
     }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIInputStream.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIInputStream.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIInputStream.java Thu Jan 12 01:51:02 2012
@@ -132,20 +132,24 @@ public final class ToNetASCIIInputStream
     {
         int ch, off;
 
-        if (length < 1)
+        if (length < 1) {
             return 0;
+        }
 
         ch = available();
 
-        if (length > ch)
+        if (length > ch) {
             length = ch;
+        }
 
         // If nothing is available, block to read only one character
-        if (length < 1)
+        if (length < 1) {
             length = 1;
+        }
 
-        if ((ch = read()) == -1)
+        if ((ch = read()) == -1) {
             return -1;
+        }
 
         off = offset;
 
@@ -172,8 +176,9 @@ public final class ToNetASCIIInputStream
 
         result = in.available();
 
-        if (__status == __LAST_WAS_NL)
+        if (__status == __LAST_WAS_NL) {
             return (result + 1);
+        }
 
         return result;
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIOutputStream.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIOutputStream.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/ToNetASCIIOutputStream.java Thu Jan 12 01:51:02 2012
@@ -71,8 +71,9 @@ public final class ToNetASCIIOutputStrea
             out.write('\r');
             return ;
         case '\n':
-            if (!__lastWasCR)
+            if (!__lastWasCR) {
                 out.write('\r');
+            }
             //$FALL-THROUGH$
         default:
             __lastWasCR = false;
@@ -111,8 +112,9 @@ public final class ToNetASCIIOutputStrea
     public synchronized void write(byte buffer[], int offset, int length)
     throws IOException
     {
-        while (length-- > 0)
+        while (length-- > 0) {
             write(buffer[offset++]);
+        }
     }
 
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/Util.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/Util.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/Util.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/io/Util.java Thu Jan 12 01:51:02 2012
@@ -106,23 +106,28 @@ public final class Util
                 if (bytes == 0)
                 {
                     bytes = source.read();
-                    if (bytes < 0)
+                    if (bytes < 0) {
                         break;
+                    }
                     dest.write(bytes);
-                    if(flush)
-                      dest.flush();
+                    if(flush) {
+                        dest.flush();
+                    }
                     ++total;
-                    if (listener != null)
+                    if (listener != null) {
                         listener.bytesTransferred(total, 1, streamSize);
+                    }
                     continue;
                 }
 
                 dest.write(buffer, 0, bytes);
-                if(flush)
-                  dest.flush();
+                if(flush) {
+                    dest.flush();
+                }
                 total += bytes;
-                if (listener != null)
+                if (listener != null) {
                     listener.bytesTransferred(total, bytes, streamSize);
+                }
             }
         }
         catch (IOException e)
@@ -267,21 +272,24 @@ public final class Util
                 if (chars == 0)
                 {
                     chars = source.read();
-                    if (chars < 0)
+                    if (chars < 0) {
                         break;
+                    }
                     dest.write(chars);
                     dest.flush();
                     ++total;
-                    if (listener != null)
+                    if (listener != null) {
                         listener.bytesTransferred(total, chars, streamSize);
+                    }
                     continue;
                 }
 
                 dest.write(buffer, 0, chars);
                 dest.flush();
                 total += chars;
-                if (listener != null)
+                if (listener != null) {
                     listener.bytesTransferred(total, chars, streamSize);
+                }
             }
         }
         catch (IOException e)

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Article.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Article.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Article.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Article.java Thu Jan 12 01:51:02 2012
@@ -102,30 +102,35 @@ public class Article implements Threadab
 
                         int i = start + 3;
 
-                        while (i < len && subject.charAt(i) >= '0' && subject.charAt(i) <= '9')
+                        while (i < len && subject.charAt(i) >= '0' && subject.charAt(i) <= '9') {
                             i++;
+                        }
 
                         if (i < (len - 1)
                             && (subject.charAt(i) == ']' || subject.charAt(i) == ')')
-                            && subject.charAt(i + 1) == ':') {
+                            && subject.charAt(i + 1) == ':') 
+                        {
                             start = i + 2;
                             done = false;
                         }
                     }
                 }
 
-                if ("(no subject)".equals(simplifiedSubject))
+                if ("(no subject)".equals(simplifiedSubject)) {
                     simplifiedSubject = "";
+                }
 
                 int end = len;
 
-                while (end > start && subject.charAt(end - 1) < ' ')
+                while (end > start && subject.charAt(end - 1) < ' ') {
                     end--;
+                }
 
-                if (start == 0 && end == len)
+                if (start == 0 && end == len) {
                     simplifiedSubject = subject;
-                else
+                } else {
                     simplifiedSubject = subject.substring(start, end);
+                }
             }
         }
 
@@ -136,13 +141,16 @@ public class Article implements Threadab
      * @param depth the current tree depth
      */
     public static void printThread(Article article, int depth) {
-            for (int i = 0; i < depth; ++i)
+            for (int i = 0; i < depth; ++i) {
                 System.out.print("==>");
+            }
             System.out.println(article.getSubject() + "\t" + article.getFrom());
-            if (article.kid != null)
+            if (article.kid != null) {
                 printThread(article.kid, depth + 1);
-            if (article.next != null)
+            }
+            if (article.next != null) {
                 printThread(article.next, depth);
+            }
     }
 
     public String getArticleId() {
@@ -199,8 +207,9 @@ public class Article implements Threadab
     }
 
     public String simplifiedSubject() {
-        if(simplifiedSubject == null)
+        if(simplifiedSubject == null) {
             simplifySubject();
+        }
         return simplifiedSubject;
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTP.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTP.java Thu Jan 12 01:51:02 2012
@@ -133,15 +133,18 @@ public class NNTP extends SocketClient
     {
         _replyString = _reader_.readLine();
 
-        if (_replyString == null)
+        if (_replyString == null) {
             throw new NNTPConnectionClosedException(
-                "Connection closed without indication.");
+                    "Connection closed without indication.");
+        }
 
         // In case we run into an anomaly we don't want fatal index exceptions
         // to be thrown.
-        if (_replyString.length() < 3)
+        if (_replyString.length() < 3) {
             throw new MalformedServerReplyException(
                 "Truncated server reply: " + _replyString);
+        }
+
         try
         {
             _replyCode = Integer.parseInt(_replyString.substring(0, 3));
@@ -154,9 +157,10 @@ public class NNTP extends SocketClient
 
         fireReplyReceived(_replyCode, _replyString + SocketClient.NETASCII_EOL);
 
-        if (_replyCode == NNTPReply.SERVICE_DISCONTINUED)
+        if (_replyCode == NNTPReply.SERVICE_DISCONTINUED) {
             throw new NNTPConnectionClosedException(
                 "NNTP response 400 received.  Server closed connection.");
+        }
     }
 
     /***

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NNTPClient.java Thu Jan 12 01:51:02 2012
@@ -177,13 +177,12 @@ public class NNTPClient extends NNTP
             long firstNum = Long.parseLong(tokens[i++]);
             result._setFirstArticle(firstNum);
             result._setLastArticle(lastNum);
-            if((firstNum == 0) && (lastNum == 0))
+            if ((firstNum == 0) && (lastNum == 0)) {
                 result._setArticleCount(0);
-            else
+            } else {
                 result._setArticleCount(lastNum - firstNum + 1);
             }
-        catch (NumberFormatException e)
-        {
+        } catch (NumberFormatException e) {
             return null;
         }
 
@@ -257,15 +256,17 @@ public class NNTPClient extends NNTP
         while ((line = reader.readLine()) != null)
         {
             NewsgroupInfo tmp = __parseNewsgroupListEntry(line);
-            if (tmp != null)
+            if (tmp != null) {
                 list.addElement(tmp);
-            else
+            } else {
                 throw new MalformedServerReplyException(line);
+            }
         }
 
         int size;
-        if ((size = list.size()) < 1)
+        if ((size = list.size()) < 1) {
             return new NewsgroupInfo[0];
+        }
 
         NewsgroupInfo[] info = new NewsgroupInfo[size];
         list.copyInto(info);
@@ -695,11 +696,13 @@ public class NNTPClient extends NNTP
     public boolean selectNewsgroup(String newsgroup, NewsgroupInfo info)
     throws IOException
     {
-        if (!NNTPReply.isPositiveCompletion(group(newsgroup)))
+        if (!NNTPReply.isPositiveCompletion(group(newsgroup))) {
             return false;
+        }
 
-        if (info != null)
+        if (info != null) {
             __parseGroupReply(getReplyString(), info);
+        }
 
         return true;
     }
@@ -786,19 +789,19 @@ public class NNTPClient extends NNTP
     public boolean selectArticle(String articleId, ArticleInfo pointer)
     throws IOException
     {
-        if (articleId != null)
-        {
-            if (!NNTPReply.isPositiveCompletion(stat(articleId)))
+        if (articleId != null) {
+            if (!NNTPReply.isPositiveCompletion(stat(articleId))) {
                 return false;
-        }
-        else
-        {
-            if (!NNTPReply.isPositiveCompletion(stat()))
+            }
+        } else {
+            if (!NNTPReply.isPositiveCompletion(stat())) {
                 return false;
+            }
         }
 
-        if (pointer != null)
+        if (pointer != null) {
             __parseArticlePointer(getReplyString(), pointer);
+        }
 
         return true;
     }
@@ -847,11 +850,13 @@ public class NNTPClient extends NNTP
     public boolean selectArticle(long articleNumber, ArticleInfo pointer)
     throws IOException
     {
-        if (!NNTPReply.isPositiveCompletion(stat(articleNumber)))
+        if (!NNTPReply.isPositiveCompletion(stat(articleNumber))) {
             return false;
+        }
 
-        if (pointer != null)
+        if (pointer != null) {
             __parseArticlePointer(getReplyString(), pointer);
+        }
 
         return true;
     }
@@ -891,11 +896,13 @@ public class NNTPClient extends NNTP
     public boolean selectPreviousArticle(ArticleInfo pointer)
     throws IOException
     {
-        if (!NNTPReply.isPositiveCompletion(last()))
+        if (!NNTPReply.isPositiveCompletion(last())) {
             return false;
+        }
 
-        if (pointer != null)
+        if (pointer != null) {
             __parseArticlePointer(getReplyString(), pointer);
+        }
 
         return true;
     }
@@ -933,11 +940,13 @@ public class NNTPClient extends NNTP
      ***/
     public boolean selectNextArticle(ArticleInfo pointer) throws IOException
     {
-        if (!NNTPReply.isPositiveCompletion(next()))
+        if (!NNTPReply.isPositiveCompletion(next())) {
             return false;
+        }
 
-        if (pointer != null)
+        if (pointer != null) {
             __parseArticlePointer(getReplyString(), pointer);
+        }
 
         return true;
     }
@@ -972,8 +981,9 @@ public class NNTPClient extends NNTP
      ***/
     public NewsgroupInfo[] listNewsgroups() throws IOException
     {
-        if (!NNTPReply.isPositiveCompletion(list()))
+        if (!NNTPReply.isPositiveCompletion(list())) {
             return null;
+        }
 
         return __readNewsgroupListing();
     }
@@ -1038,8 +1048,9 @@ public class NNTPClient extends NNTP
      */
     public NewsgroupInfo[] listNewsgroups(String wildmat) throws IOException
     {
-        if(!NNTPReply.isPositiveCompletion(listActive(wildmat)))
+        if(!NNTPReply.isPositiveCompletion(listActive(wildmat))) {
             return null;
+        }
         return __readNewsgroupListing();
     }
 
@@ -1106,8 +1117,10 @@ public class NNTPClient extends NNTP
     {
         if (!NNTPReply.isPositiveCompletion(newgroups(
                                                 query.getDate(), query.getTime(),
-                                                query.isGMT(), query.getDistributions())))
+                                                query.isGMT(), query.getDistributions()))) 
+        {
             return null;
+        }
 
         return __readNewsgroupListing();
     }
@@ -1326,8 +1339,9 @@ public class NNTPClient extends NNTP
 
     public Writer postArticle() throws IOException
     {
-        if (!NNTPReply.isPositiveIntermediate(post()))
+        if (!NNTPReply.isPositiveIntermediate(post())) {
             return null;
+        }
 
         return new DotTerminatedMessageWriter(_writer_);
     }
@@ -1335,8 +1349,9 @@ public class NNTPClient extends NNTP
 
     public Writer forwardArticle(String articleId) throws IOException
     {
-        if (!NNTPReply.isPositiveIntermediate(ihave(articleId)))
+        if (!NNTPReply.isPositiveIntermediate(ihave(articleId))) {
             return null;
+        }
 
         return new DotTerminatedMessageWriter(_writer_);
     }
@@ -1713,7 +1728,9 @@ public class NNTPClient extends NNTP
    // Helper methods
 
     private ArticleInfo __ap2ai(@SuppressWarnings("deprecation") ArticlePointer ap) {
-        if (ap == null) return null;
+        if (ap == null) {
+            return null;
+        }
         ArticleInfo ai = new ArticleInfo();
         return ai;
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/NewGroupsOrNewsQuery.java Thu Jan 12 01:51:02 2012
@@ -72,40 +72,39 @@ public final class NewGroupsOrNewsQuery
         str = Integer.toString(num);
         num = str.length();
 
-        if (num >= 2)
+        if (num >= 2) {
             buffer.append(str.substring(num - 2));
-        else
+        } else {
             buffer.append("00");
+        }
 
         // Get month
         num = date.get(Calendar.MONTH) + 1;
         str = Integer.toString(num);
         num = str.length();
 
-        if (num == 1)
-        {
+        if (num == 1) {
             buffer.append('0');
             buffer.append(str);
-        }
-        else if (num == 2)
+        } else if (num == 2) {
             buffer.append(str);
-        else
+        } else {
             buffer.append("01");
+        }
 
         // Get day
         num = date.get(Calendar.DAY_OF_MONTH);
         str = Integer.toString(num);
         num = str.length();
 
-        if (num == 1)
-        {
+        if (num == 1) {
             buffer.append('0');
             buffer.append(str);
-        }
-        else if (num == 2)
+        } else if (num == 2) {
             buffer.append(str);
-        else
+        } else {
             buffer.append("01");
+        }
 
         __date = buffer.toString();
 
@@ -116,30 +115,28 @@ public final class NewGroupsOrNewsQuery
         str = Integer.toString(num);
         num = str.length();
 
-        if (num == 1)
-        {
+        if (num == 1) {
             buffer.append('0');
             buffer.append(str);
-        }
-        else if (num == 2)
+        } else if (num == 2) {
             buffer.append(str);
-        else
+        } else {
             buffer.append("00");
+        }
 
         // Get minutes
         num = date.get(Calendar.MINUTE);
         str = Integer.toString(num);
         num = str.length();
 
-        if (num == 1)
-        {
+        if (num == 1) {
             buffer.append('0');
             buffer.append(str);
-        }
-        else if (num == 2)
+        } else if (num == 2) {
             buffer.append(str);
-        else
+        } else {
             buffer.append("00");
+        }
 
 
         // Get seconds
@@ -147,15 +144,14 @@ public final class NewGroupsOrNewsQuery
         str = Integer.toString(num);
         num = str.length();
 
-        if (num == 1)
-        {
+        if (num == 1) {
             buffer.append('0');
             buffer.append(str);
-        }
-        else if (num == 2)
+        } else if (num == 2) {
             buffer.append(str);
-        else
+        } else {
             buffer.append("00");
+        }
 
         __time = buffer.toString();
     }
@@ -173,10 +169,11 @@ public final class NewGroupsOrNewsQuery
      ***/
     public void addNewsgroup(String newsgroup)
     {
-        if (__newsgroups != null)
+        if (__newsgroups != null) {
             __newsgroups.append(',');
-        else
+        } else {
             __newsgroups = new StringBuffer();
+        }
         __newsgroups.append(newsgroup);
     }
 
@@ -217,10 +214,11 @@ public final class NewGroupsOrNewsQuery
      ***/
     public void addDistribution(String distribution)
     {
-        if (__distributions != null)
+        if (__distributions != null) {
             __distributions.append(',');
-        else
+        } else {
             __distributions = new StringBuffer();
+        }
         __distributions.append(distribution);
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/SimpleNNTPHeader.java Thu Jan 12 01:51:02 2012
@@ -78,8 +78,9 @@ public class SimpleNNTPHeader
      ***/
     public void addNewsgroup(String newsgroup)
     {
-        if (__newsgroupCount++ > 0)
+        if (__newsgroupCount++ > 0) {
             __newsgroups.append(',');
+        }
         __newsgroups.append(newsgroup);
     }
 
@@ -154,8 +155,9 @@ public class SimpleNNTPHeader
         header.append("\nSubject: ");
         header.append(__subject);
         header.append('\n');
-        if (__headerFields.length() > 0)
+        if (__headerFields.length() > 0) {
             header.append(__headerFields.toString());
+        }
         header.append('\n');
 
         return header.toString();

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/ThreadContainer.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/ThreadContainer.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/ThreadContainer.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/ThreadContainer.java Thu Jan 12 01:51:02 2012
@@ -37,13 +37,13 @@ class ThreadContainer {
      * @return true if child is under self's tree. Detects circular references
      */
     boolean findChild(ThreadContainer target) {
-        if (child == null)
+        if (child == null) {
             return false;
-
-        else if (child == target)
+        } else if (child == target) {
             return true;
-        else
+        } else {
             return child.findChild(target);
+        }
     }
 
     // Copy the ThreadContainer tree structure down into the underlying Threadable objects
@@ -51,21 +51,24 @@ class ThreadContainer {
     // TODO convert this to an iterative function - this can blow the stack
     // with very large Threadable trees
     void flush() {
-        if (parent != null && threadable == null)
+        if (parent != null && threadable == null) {
             throw new RuntimeException("no threadable in " + this.toString());
+        }
 
         parent = null;
 
-        if (threadable != null)
+        if (threadable != null) {
             threadable.setChild(child == null ? null : child.threadable);
+        }
 
         if (child != null) {
             child.flush();
             child = null;
         }
 
-        if (threadable != null)
+        if (threadable != null) {
             threadable.setNext(next == null ? null : next.threadable);
+        }
 
         if (next != null) {
             next.flush();
@@ -86,14 +89,17 @@ class ThreadContainer {
                 kid != null;
                 prev = kid,
                     kid = rest,
-                    rest = (rest == null ? null : rest.next))
+                    rest = (rest == null ? null : rest.next)) 
+            {
                 kid.next = prev;
+            }
 
             child = prev;
 
             // Do it for the kids
-            for (kid = child; kid != null; kid = kid.next)
+            for (kid = child; kid != null; kid = kid.next) {
                 kid.reverseChildren();
+            }
         }
     }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/nntp/Threader.java Thu Jan 12 01:51:02 2012
@@ -55,15 +55,17 @@ public class Threader {
      * @since 3.0
      */
     public Threadable thread(Iterable<? extends Threadable> messages) {
-        if (messages == null)
+        if (messages == null) {
             return null;
+        }
 
         idTable = new HashMap<String,ThreadContainer>();
 
         // walk through each Threadable element
         for (Threadable t : messages) {
-            if (!t.isDummy())
+            if (!t.isDummy()) {
                 buildContainer(t);
+            }
         }
 
         root = findRootSet();
@@ -75,12 +77,14 @@ public class Threader {
         root.reverseChildren();
         gatherSubjects();
 
-        if (root.next != null)
+        if (root.next != null) {
             throw new RuntimeException("root node has a next:" + root);
+        }
 
         for (ThreadContainer r = root.child; r != null; r = r.next) {
-            if (r.threadable == null)
+            if (r.threadable == null) {
                 r.threadable = r.child.threadable.makeDummy();
+            }
         }
 
         Threadable result = (root.child == null ? null : root.child.threadable);
@@ -153,7 +157,9 @@ public class Threader {
         // be the parent of this container, unless doing so causes a circular reference
         if (parentRef != null
             && (parentRef == container || container.findChild(parentRef)))
+        {
             parentRef = null;
+        }
 
         // if it has a parent already, its because we saw this message in a References: field, and presumed
         // a parent based on the other entries in that field. Now that we have the actual message, we can
@@ -164,8 +170,9 @@ public class Threader {
             for (prev = null, rest = container.parent.child;
                 rest != null;
                 prev = rest, rest = rest.next) {
-                if (rest == container)
+                if (rest == container) {
                     break;
+                }
             }
 
             if (rest == null) {
@@ -177,10 +184,11 @@ public class Threader {
             }
 
             // Unlink this container from the parent's child list
-            if (prev == null)
+            if (prev == null) {
                 container.parent.child = container.next;
-            else
+            } else {
                 prev.next = container.next;
+            }
 
             container.next = null;
             container.parent = null;
@@ -206,9 +214,10 @@ public class Threader {
             Object key = iter.next();
             ThreadContainer c = idTable.get(key);
             if (c.parent == null) {
-                if (c.next != null)
+                if (c.next != null) {
                     throw new RuntimeException(
-                        "c.next is " + c.next.toString());
+                            "c.next is " + c.next.toString());
+                }
                 c.next = root.child;
                 root.child = c;
             }
@@ -230,10 +239,11 @@ public class Threader {
 
             // Is it empty and without any children? If so,delete it
             if (container.threadable == null && container.child == null) {
-                if (prev == null)
+                if (prev == null) {
                     parent.child = container.next;
-                else
+                } else {
                     prev.next = container.next;
+                }
 
                 // Set container to prev so that prev keeps its same value the next time through the loop
                 container = prev;
@@ -250,15 +260,17 @@ public class Threader {
                 ThreadContainer kids = container.child;
 
                 // Remove this container and replace with 'kids'.
-                if (prev == null)
+                if (prev == null) {
                     parent.child = kids;
-                else
+                } else {
                     prev.next = kids;
+                }
 
                 // Make each child's parent be this level's parent -> i.e. promote the children. Make the last child's next point to this container's next
                 // i.e. splice kids into the list in place of container
-                for (tail = kids; tail.next != null; tail = tail.next)
+                for (tail = kids; tail.next != null; tail = tail.next) {
                     tail.parent = container.parent;
+                }
 
                 tail.parent = container.parent;
                 tail.next = container.next;
@@ -284,8 +296,9 @@ public class Threader {
 
         int count = 0;
 
-        for (ThreadContainer c = root.child; c != null; c = c.next)
+        for (ThreadContainer c = root.child; c != null; c = c.next) {
             count++;
+        }
 
         // TODO verify this will avoid rehashing
         HashMap<String, ThreadContainer> subjectTable = new HashMap<String, ThreadContainer>((int) (count * 1.2), (float) 0.9);
@@ -297,13 +310,15 @@ public class Threader {
             // No threadable? If so, it is a dummy node in the root set.
             // Only root set members may be dummies, and they alway have at least 2 kids
             // Take the first kid as representative of the subject
-            if (threadable == null)
+            if (threadable == null) {
                 threadable = c.child.threadable;
+            }
 
             String subj = threadable.simplifiedSubject();
 
-            if (subj == null || subj == "")
+            if (subj == null || subj == "") {
                 continue;
+            }
 
             ThreadContainer old = subjectTable.get(subj);
 
@@ -326,8 +341,9 @@ public class Threader {
         }
 
         // If the table is empty, we're done
-        if (count == 0)
+        if (count == 0) {
             return;
+        }
 
         // subjectTable is now populated with one entry for each subject which occurs in the
         // root set. Iterate over the root set, and gather together the difference.
@@ -338,26 +354,30 @@ public class Threader {
             Threadable threadable = c.threadable;
 
             // is it a dummy node?
-            if (threadable == null)
+            if (threadable == null) {
                 threadable = c.child.threadable;
+            }
 
             String subj = threadable.simplifiedSubject();
 
             // Dont thread together all subjectless messages
-            if (subj == null || subj == "")
+            if (subj == null || subj == "") {
                 continue;
+            }
 
             ThreadContainer old = subjectTable.get(subj);
 
-            if (old == c) // That's us
+            if (old == c) { // That's us
                 continue;
+            }
 
             // We have now found another container in the root set with the same subject
             // Remove the "second" message from the root set
-            if (prev == null)
+            if (prev == null) {
                 root.child = c.next;
-            else
+            } else {
                 prev.next = c.next;
+            }
             c.next = null;
 
             if (old.threadable == null && c.threadable == null) {
@@ -365,14 +385,17 @@ public class Threader {
                 ThreadContainer tail;
                 for (tail = old.child;
                     tail != null && tail.next != null;
-                    tail = tail.next){}
+                    tail = tail.next) {
+                    // do nothing
+                }
 
                 if (tail != null) { // protect against possible NPE
                     tail.next = c.child;
                 }
 
-                for (tail = c.child; tail != null; tail = tail.next)
+                for (tail = c.child; tail != null; tail = tail.next) {
                     tail.parent = old;
+                }
 
                 c.child = null;
             } else if (
@@ -393,8 +416,10 @@ public class Threader {
 
                 for (ThreadContainer tail = newc.child;
                     tail != null;
-                    tail = tail.next)
+                    tail = tail.next) 
+                {
                     tail.parent = newc;
+                }
 
                 old.threadable = null;
                 old.child = null;

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpUtils.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpUtils.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpUtils.java Thu Jan 12 01:51:02 2012
@@ -62,19 +62,24 @@ public final class NtpUtils {
      * @return reference clock string if primary NTP server
      */
     public static String getReferenceClock(NtpV3Packet message) {
-        if (message == null)
+        if (message == null) {
             return "";
+        }
         int refId = message.getReferenceId();
-        if (refId == 0)
+        if (refId == 0) {
             return "";
+        }
         StringBuilder buf = new StringBuilder(4);
         // start at highest-order byte (0x4c434c00 -> LCL)
         for (int shiftBits = 24; shiftBits >= 0; shiftBits -= 8)
         {
             char c = (char) ((refId >>> shiftBits) & 0xff);
-            if (c == 0) break; // 0-terminated ASCII string
-            if (!Character.isLetterOrDigit(c))
+            if (c == 0) { // 0-terminated ASCII string
+                break;
+            }
+            if (!Character.isLetterOrDigit(c)) {
                 return "";
+            }
             buf.append(c);
         }
         return buf.toString();

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/NtpV3Impl.java Thu Jan 12 01:51:02 2012
@@ -304,8 +304,9 @@ public class NtpV3Impl implements NtpV3P
                 return idAsString(); // 4-character ASCII string (e.g. GPS, USNO)
             }
             // in NTPv4 servers this is latest transmit timestamp of ref source
-            if (version == VERSION_4)
+            if (version == VERSION_4) {
                 return idAsHex();
+            }
         }
 
         // Stratum 2 and higher this is a four-octet IPv4 address
@@ -333,7 +334,9 @@ public class NtpV3Impl implements NtpV3P
         StringBuilder id = new StringBuilder();
         for (int i = 0; i <= 3; i++) {
             char c = (char) buf[REFERENCE_ID_INDEX + i];
-            if (c == 0) break; // 0-terminated string
+            if (c == 0) {  // 0-terminated string
+                break;
+            }
             id.append(c);
         }
         return id.toString();
@@ -526,8 +529,9 @@ public class NtpV3Impl implements NtpV3P
     {
         byte[] incomingBuf = srcDp.getData();
         int len = srcDp.getLength();
-        if (len > buf.length)
+        if (len > buf.length) {
             len = buf.length;
+        }
 
         System.arraycopy(incomingBuf, 0, buf, 0, len);
     }



Mime
View raw message