commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1230358 [2/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
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeInfo.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeInfo.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeInfo.java Thu Jan 12 01:51:02 2012
@@ -100,13 +100,15 @@ public class TimeInfo {
     public TimeInfo(NtpV3Packet message, long returnTime, List<String> comments,
                    boolean doComputeDetails)
     {
-        if (message == null)
+        if (message == null) {
             throw new IllegalArgumentException("message cannot be null");
+        }
         this._returnTime = returnTime;
         this._message = message;
         this._comments = comments;
-        if (doComputeDetails)
+        if (doComputeDetails) {
             computeDetails();
+        }
     }
 
     /**
@@ -173,16 +175,15 @@ public class TimeInfo {
             {
                 _offset = Long.valueOf(xmitTime - _returnTime);
                 _comments.add("Error: zero orig time -- cannot compute delay");
-            } else
+            } else {
                 _comments.add("Error: zero orig time -- cannot compute delay/offset");
-        } else if (rcvNtpTime.ntpValue() == 0 || xmitNtpTime.ntpValue() == 0)
-        {
+            }
+        } else if (rcvNtpTime.ntpValue() == 0 || xmitNtpTime.ntpValue() == 0) {
             _comments.add("Warning: zero rcvNtpTime or xmitNtpTime");
             // assert destTime >= origTime since network delay cannot be negative
-            if (origTime > _returnTime)
+            if (origTime > _returnTime) {
                 _comments.add("Error: OrigTime > DestRcvTime");
-            else
-            {
+            } else {
                 // without receive or xmit time cannot figure out processing time
                 // so delay is simply the network travel time
                 _delay = Long.valueOf(_returnTime - origTime);
@@ -229,13 +230,15 @@ public class TimeInfo {
                              _comments.add("Info: processing time > total network time by 1 ms -> assume zero delay");
                              delayValue = 0;
                          }
-                     } else
-                         _comments.add("Warning: processing time > total network time");
+                     } else {
+                        _comments.add("Warning: processing time > total network time");
+                    }
                  }
              }
              _delay = Long.valueOf(delayValue);
-            if (origTime > _returnTime) // assert destTime >= origTime
+            if (origTime > _returnTime) {
                 _comments.add("Error: OrigTime > DestRcvTime");
+            }
 
             _offset = Long.valueOf(((rcvTime - origTime) + (xmitTime - _returnTime)) / 2);
         }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeStamp.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeStamp.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeStamp.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ntp/TimeStamp.java Thu Jan 12 01:51:02 2012
@@ -251,7 +251,9 @@ public class TimeStamp implements java.i
         }
         int ind = s.indexOf('.');
         if (ind == -1) {
-            if (s.length() == 0) return 0;
+            if (s.length() == 0) {
+                return 0;
+            }
             return Long.parseLong(s, 16) << 32; // no decimal
         }
 
@@ -361,8 +363,9 @@ public class TimeStamp implements java.i
     private static void appendHexString(StringBuilder buf, long l)
     {
         String s = Long.toHexString(l);
-        for (int i = s.length(); i < 8; i++)
+        for (int i = s.length(); i < 8; i++) {
             buf.append('0');
+        }
         buf.append(s);
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/ExtendedPOP3Client.java Thu Jan 12 01:51:02 2012
@@ -81,7 +81,9 @@ public class ExtendedPOP3Client extends 
                         InvalidKeyException, InvalidKeySpecException
     {
         if (sendCommand(POP3Command.AUTH, method.getAuthName())
-        != POP3Reply.OK_INT) return false;
+        != POP3Reply.OK_INT) {
+            return false;
+        }
 
         switch(method) {
             case PLAIN:
@@ -124,7 +126,9 @@ public class ExtendedPOP3Client extends 
         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/pop3/POP3.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3.java Thu Jan 12 01:51:02 2012
@@ -113,19 +113,21 @@ public class POP3 extends SocketClient
         _replyLines.clear();
         line = _reader.readLine();
 
-        if (line == null)
+        if (line == null) {
             throw new EOFException("Connection closed without indication.");
+        }
 
-        if (line.startsWith(_OK))
+        if (line.startsWith(_OK)) {
             _replyCode = POP3Reply.OK;
-        else if (line.startsWith(_ERROR))
+        } else if (line.startsWith(_ERROR)) {
             _replyCode = POP3Reply.ERROR;
-        else if (line.startsWith(_OK_INT))
+        } else if (line.startsWith(_OK_INT)) {
             _replyCode = POP3Reply.OK_INT;
-        else
+        } else {
             throw new
             MalformedServerReplyException(
                 "Received invalid POP3 protocol response from server." + line);
+        }
 
         _replyLines.add(line);
         _lastReplyLine = line;
@@ -185,8 +187,9 @@ public class POP3 extends SocketClient
         while (line != null)
         {
             _replyLines.add(line);
-            if (line.equals("."))
+            if (line.equals(".")) {
                 break;
+            }
             line = _reader.readLine();
         }
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3Client.java Thu Jan 12 01:51:02 2012
@@ -59,8 +59,9 @@ public class POP3Client extends POP3
 
         tokenizer = new StringTokenizer(line);
 
-        if (!tokenizer.hasMoreElements())
+        if (!tokenizer.hasMoreElements()) {
             return null;
+        }
 
         num = size = 0;
 
@@ -68,8 +69,9 @@ public class POP3Client extends POP3
         {
             num = Integer.parseInt(tokenizer.nextToken());
 
-            if (!tokenizer.hasMoreElements())
+            if (!tokenizer.hasMoreElements()) {
                 return null;
+            }
 
             size = Integer.parseInt(tokenizer.nextToken());
         }
@@ -88,8 +90,9 @@ public class POP3Client extends POP3
 
         tokenizer = new StringTokenizer(line);
 
-        if (!tokenizer.hasMoreElements())
+        if (!tokenizer.hasMoreElements()) {
             return null;
+        }
 
         num = 0;
 
@@ -97,8 +100,9 @@ public class POP3Client extends POP3
         {
             num = Integer.parseInt(tokenizer.nextToken());
 
-            if (!tokenizer.hasMoreElements())
+            if (!tokenizer.hasMoreElements()) {
                 return null;
+            }
 
             line = tokenizer.nextToken();
         }
@@ -129,14 +133,17 @@ public class POP3Client extends POP3
      ***/
     public boolean login(String username, String password) throws IOException
     {
-        if (getState() != AUTHORIZATION_STATE)
+        if (getState() != AUTHORIZATION_STATE) {
             return false;
+        }
 
-        if (sendCommand(POP3Command.USER, username) != POP3Reply.OK)
+        if (sendCommand(POP3Command.USER, username) != POP3Reply.OK) {
             return false;
+        }
 
-        if (sendCommand(POP3Command.PASS, password) != POP3Reply.OK)
+        if (sendCommand(POP3Command.PASS, password) != POP3Reply.OK) {
             return false;
+        }
 
         setState(TRANSACTION_STATE);
 
@@ -185,8 +192,9 @@ public class POP3Client extends POP3
         StringBuilder buffer, digestBuffer;
         MessageDigest md5;
 
-        if (getState() != AUTHORIZATION_STATE)
+        if (getState() != AUTHORIZATION_STATE) {
             return false;
+        }
 
         md5 = MessageDigest.getInstance("MD5");
         timestamp += secret;
@@ -195,7 +203,9 @@ public class POP3Client extends POP3
 
         for (i = 0; i < digest.length; i++) {
             int digit = digest[i] & 0xff;
-            if (digit <= 15) digestBuffer.append("0"); // Add leading zero if necessary (NET-351)
+            if (digit <= 15) { // Add leading zero if necessary (NET-351)
+                digestBuffer.append("0");
+            }
             digestBuffer.append(Integer.toHexString(digit));
         }
 
@@ -204,8 +214,9 @@ public class POP3Client extends POP3
         buffer.append(' ');
         buffer.append(digestBuffer.toString());
 
-        if (sendCommand(POP3Command.APOP, buffer.toString()) != POP3Reply.OK)
+        if (sendCommand(POP3Command.APOP, buffer.toString()) != POP3Reply.OK) {
             return false;
+        }
 
         setState(TRANSACTION_STATE);
 
@@ -230,8 +241,9 @@ public class POP3Client extends POP3
      ***/
     public boolean logout() throws IOException
     {
-        if (getState() == TRANSACTION_STATE)
+        if (getState() == TRANSACTION_STATE) {
             setState(UPDATE_STATE);
+        }
         sendCommand(POP3Command.QUIT);
         return (_replyCode == POP3Reply.OK);
     }
@@ -251,8 +263,9 @@ public class POP3Client extends POP3
      ***/
     public boolean noop() throws IOException
     {
-        if (getState() == TRANSACTION_STATE)
+        if (getState() == TRANSACTION_STATE) {
             return (sendCommand(POP3Command.NOOP) == POP3Reply.OK);
+        }
         return false;
     }
 
@@ -274,9 +287,10 @@ public class POP3Client extends POP3
      ***/
     public boolean deleteMessage(int messageId) throws IOException
     {
-        if (getState() == TRANSACTION_STATE)
+        if (getState() == TRANSACTION_STATE) {
             return (sendCommand(POP3Command.DELE, Integer.toString(messageId))
                     == POP3Reply.OK);
+        }
         return false;
     }
 
@@ -294,8 +308,9 @@ public class POP3Client extends POP3
      ***/
     public boolean reset() throws IOException
     {
-        if (getState() == TRANSACTION_STATE)
+        if (getState() == TRANSACTION_STATE) {
             return (sendCommand(POP3Command.RSET) == POP3Reply.OK);
+        }
         return false;
     }
 
@@ -316,10 +331,12 @@ public class POP3Client extends POP3
      ***/
     public POP3MessageInfo status() throws IOException
     {
-        if (getState() != TRANSACTION_STATE)
+        if (getState() != TRANSACTION_STATE) {
             return null;
-        if (sendCommand(POP3Command.STAT) != POP3Reply.OK)
+        }
+        if (sendCommand(POP3Command.STAT) != POP3Reply.OK) {
             return null;
+        }
         return __parseStatus(_lastReplyLine.substring(3));
     }
 
@@ -343,11 +360,13 @@ public class POP3Client extends POP3
      ***/
     public POP3MessageInfo listMessage(int messageId) throws IOException
     {
-        if (getState() != TRANSACTION_STATE)
+        if (getState() != TRANSACTION_STATE) {
             return null;
+        }
         if (sendCommand(POP3Command.LIST, Integer.toString(messageId))
-                != POP3Reply.OK)
+                != POP3Reply.OK) {
             return null;
+        }
         return __parseStatus(_lastReplyLine.substring(3));
     }
 
@@ -371,10 +390,12 @@ public class POP3Client extends POP3
      ***/
     public POP3MessageInfo[] listMessages() throws IOException
     {
-        if (getState() != TRANSACTION_STATE)
+        if (getState() != TRANSACTION_STATE) {
             return null;
-        if (sendCommand(POP3Command.LIST) != POP3Reply.OK)
+        }
+        if (sendCommand(POP3Command.LIST) != POP3Reply.OK) {
             return null;
+        }
         getAdditionalReply();
 
         // This could be a zero length array if no messages present
@@ -383,8 +404,9 @@ public class POP3Client extends POP3
         ListIterator<String> en = _replyLines.listIterator(1); // Skip first line
 
         // Fetch lines.
-        for (int line = 0; line < messages.length; line++)
+        for (int line = 0; line < messages.length; line++) {
             messages[line] = __parseStatus(en.next());
+        }
 
         return messages;
     }
@@ -409,11 +431,13 @@ public class POP3Client extends POP3
     public POP3MessageInfo listUniqueIdentifier(int messageId)
     throws IOException
     {
-        if (getState() != TRANSACTION_STATE)
+        if (getState() != TRANSACTION_STATE) {
             return null;
+        }
         if (sendCommand(POP3Command.UIDL, Integer.toString(messageId))
-                != POP3Reply.OK)
+                != POP3Reply.OK) {
             return null;
+        }
         return __parseUID(_lastReplyLine.substring(3));
     }
 
@@ -437,10 +461,12 @@ public class POP3Client extends POP3
      ***/
     public POP3MessageInfo[] listUniqueIdentifiers() throws IOException
     {
-        if (getState() != TRANSACTION_STATE)
+        if (getState() != TRANSACTION_STATE) {
             return null;
-        if (sendCommand(POP3Command.UIDL) != POP3Reply.OK)
+        }
+        if (sendCommand(POP3Command.UIDL) != POP3Reply.OK) {
             return null;
+        }
         getAdditionalReply();
 
         // This could be a zero length array if no messages present
@@ -449,8 +475,9 @@ public class POP3Client extends POP3
         ListIterator<String> en = _replyLines.listIterator(1); // skip first line
 
         // Fetch lines.
-        for (int line = 0; line < messages.length; line++)
+        for (int line = 0; line < messages.length; line++) {
             messages[line] = __parseUID(en.next());
+        }
 
         return messages;
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3SClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3SClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3SClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3SClient.java Thu Jan 12 01:51:02 2012
@@ -166,7 +166,9 @@ public class POP3SClient extends POP3Cli
     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()
     }
@@ -200,8 +202,12 @@ public class POP3SClient extends POP3Cli
         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/smtp/AuthenticatingSMTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/AuthenticatingSMTPClient.java Thu Jan 12 01:51:02 2012
@@ -119,8 +119,9 @@ public class AuthenticatingSMTPClient ex
         host = getLocalAddress();
         name = host.getHostName();
 
-        if (name == null)
+        if (name == null) {
             return false;
+        }
 
         return SMTPReply.isPositiveCompletion(ehlo(name));
     }
@@ -167,7 +168,9 @@ public class AuthenticatingSMTPClient ex
                         InvalidKeyException, InvalidKeySpecException
     {
         if (!SMTPReply.isPositiveIntermediate(sendCommand(SMTPCommand.AUTH,
-                AUTH_METHOD.getAuthName(method)))) return false;
+                AUTH_METHOD.getAuthName(method)))) {
+            return false;
+        }
 
         if (method.equals(AUTH_METHOD.PLAIN))
         {
@@ -202,11 +205,14 @@ public class AuthenticatingSMTPClient ex
             // the server sends fixed responses (base64("Username") and
             // base64("Password")), so we don't have to read them.
             if (!SMTPReply.isPositiveIntermediate(sendCommand(
-                new String(Base64.encodeBase64(username.getBytes()))))) return false;
+                new String(Base64.encodeBase64(username.getBytes()))))) {
+                return false;
+            }
             return SMTPReply.isPositiveCompletion(sendCommand(
                 new String(Base64.encodeBase64(password.getBytes()))));
+        } else {
+            return false; // safety check
         }
-        else return false; // safety check
     }
 
     /**
@@ -221,7 +227,9 @@ public class AuthenticatingSMTPClient 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();
@@ -246,10 +254,15 @@ public class AuthenticatingSMTPClient ex
          */
         public static final String getAuthName(AUTH_METHOD method)
         {
-            if (method.equals(AUTH_METHOD.PLAIN)) return "PLAIN";
-            else if (method.equals(AUTH_METHOD.CRAM_MD5)) return "CRAM-MD5";
-            else if (method.equals(AUTH_METHOD.LOGIN)) return "LOGIN";
-            else return null;
+            if (method.equals(AUTH_METHOD.PLAIN)) {
+                return "PLAIN";
+            } else if (method.equals(AUTH_METHOD.CRAM_MD5)) {
+                return "CRAM-MD5";
+            } else if (method.equals(AUTH_METHOD.LOGIN)) {
+                return "LOGIN";
+            } else {
+                return null;
+            }
         }
     }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTP.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTP.java Thu Jan 12 01:51:02 2012
@@ -150,8 +150,9 @@ public class SMTP extends SocketClient
 
         if (args != null)
         {
-            if (includeSpace)
+            if (includeSpace) {
                 __commandBuffer.append(' ');
+            }
             __commandBuffer.append(args);
         }
 
@@ -190,16 +191,18 @@ public class SMTP extends SocketClient
 
         String line = _reader.readLine();
 
-        if (line == null)
+        if (line == null) {
             throw new SMTPConnectionClosedException(
                 "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);
+        }
 
         try
         {
@@ -221,9 +224,10 @@ public class SMTP extends SocketClient
             {
                 line = _reader.readLine();
 
-                if (line == null)
+                if (line == null) {
                     throw new SMTPConnectionClosedException(
                         "Connection closed without indication.");
+                }
 
                 _replyLines.add(line);
 
@@ -240,9 +244,10 @@ public class SMTP extends SocketClient
 
         fireReplyReceived(_replyCode, getReplyString());
 
-        if (_replyCode == SMTPReply.SERVICE_NOT_AVAILABLE)
+        if (_replyCode == SMTPReply.SERVICE_NOT_AVAILABLE) {
             throw new SMTPConnectionClosedException(
                 "SMTP response 421 received.  Server closed connection.");
+        }
     }
 
     /*** Initiates control connections and gets initial reply. ***/
@@ -443,8 +448,9 @@ public class SMTP extends SocketClient
     {
         StringBuilder buffer;
 
-        if (!_newReplyString)
+        if (!_newReplyString) {
             return _replyString;
+        }
 
         buffer = new StringBuilder();
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPClient.java Thu Jan 12 01:51:02 2012
@@ -221,8 +221,9 @@ public class SMTPClient extends SMTP
         host = getLocalAddress();
         name = host.getHostName();
 
-        if (name == null)
+        if (name == null) {
             return false;
+        }
 
         return SMTPReply.isPositiveCompletion(helo(name));
     }
@@ -358,8 +359,9 @@ public class SMTPClient extends SMTP
      ***/
     public Writer sendMessageData() throws IOException
     {
-        if (!SMTPReply.isPositiveIntermediate(data()))
+        if (!SMTPReply.isPositiveIntermediate(data())) {
             return null;
+        }
 
         return new DotTerminatedMessageWriter(_writer);
     }
@@ -389,8 +391,9 @@ public class SMTPClient extends SMTP
 
         writer = sendMessageData();
 
-        if (writer == null)
+        if (writer == null) {
             return false;
+        }
 
         writer.write(message);
         writer.close();
@@ -423,11 +426,13 @@ public class SMTPClient extends SMTP
                                      String message)
     throws IOException
     {
-        if (!setSender(sender))
+        if (!setSender(sender)) {
             return false;
+        }
 
-        if (!addRecipient(recipient))
+        if (!addRecipient(recipient)) {
             return false;
+        }
 
         return sendShortMessageData(message);
     }
@@ -461,17 +466,20 @@ public class SMTPClient extends SMTP
         boolean oneSuccess = false;
         int count;
 
-        if (!setSender(sender))
+        if (!setSender(sender)) {
             return false;
+        }
 
         for (count = 0; count < recipients.length; count++)
         {
-            if (addRecipient(recipients[count]))
+            if (addRecipient(recipients[count])) {
                 oneSuccess = true;
+            }
         }
 
-        if (!oneSuccess)
+        if (!oneSuccess) {
             return false;
+        }
 
         return sendShortMessageData(message);
     }
@@ -556,8 +564,9 @@ public class SMTPClient extends SMTP
      ***/
     public String listHelp() throws IOException
     {
-        if (SMTPReply.isPositiveCompletion(help()))
+        if (SMTPReply.isPositiveCompletion(help())) {
             return getReplyString();
+        }
         return null;
     }
 
@@ -579,8 +588,9 @@ public class SMTPClient extends SMTP
      ***/
     public String listHelp(String command) throws IOException
     {
-        if (SMTPReply.isPositiveCompletion(help(command)))
+        if (SMTPReply.isPositiveCompletion(help(command))) {
             return getReplyString();
+        }
         return null;
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPSClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPSClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPSClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SMTPSClient.java Thu Jan 12 01:51:02 2012
@@ -141,7 +141,9 @@ public class SMTPSClient extends SMTPCli
     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()
     }
@@ -175,8 +177,12 @@ public class SMTPSClient extends SMTPCli
         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/smtp/SimpleSMTPHeader.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/smtp/SimpleSMTPHeader.java Thu Jan 12 01:51:02 2012
@@ -99,10 +99,11 @@ public class SimpleSMTPHeader
      ***/
     public void addCC(String address)
     {
-        if (__cc == null)
+        if (__cc == null) {
             __cc = new StringBuffer();
-        else
+        } else {
             __cc.append(", ");
+        }
 
         __cc.append(address);
     }
@@ -121,8 +122,9 @@ public class SimpleSMTPHeader
     {
         StringBuilder header = new StringBuilder();
 
-        if (__headerFields.length() > 0)
+        if (__headerFields.length() > 0) {
             header.append(__headerFields.toString());
+        }
 
         header.append("From: ");
         header.append(__from);

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java Thu Jan 12 01:51:02 2012
@@ -115,10 +115,12 @@ public class TelnetClient extends Telnet
     @Override
     public void disconnect() throws IOException
     {
-        if (__input != null)
+        if (__input != null) {
             __input.close();
-        if (__output != null)
+        }
+        if (__output != null) {
             __output.close();
+        }
         super.disconnect();
     }
 
@@ -215,8 +217,9 @@ public class TelnetClient extends Telnet
     public void sendSubnegotiation(int[] message)
     throws IOException, IllegalArgumentException
     {
-        if (message.length < 1)
+        if (message.length < 1) {
             throw new IllegalArgumentException("zero length message");
+        }
         _sendSubnegotiation(message);
     }
 
@@ -401,7 +404,8 @@ public class TelnetClient extends Telnet
         synchronized (this) {
             listener = this.inputListener;
         }
-        if (listener != null)
+        if (listener != null) {
             listener.telnetInputAvailable();
+        }
     }
 }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java Thu Jan 12 01:51:02 2012
@@ -78,10 +78,11 @@ final class TelnetInputStream extends Bu
         __ioException = null;
         __readIsWaiting = false;
         __threaded = false;
-        if(readerThread)
+        if(readerThread) {
             __thread = new Thread(this);
-        else
+        } else {
             __thread = null;
+        }
     }
 
     TelnetInputStream(InputStream input, TelnetClient client) {
@@ -90,8 +91,9 @@ final class TelnetInputStream extends Bu
 
     void _start()
     {
-        if(__thread == null)
+        if(__thread == null) {
             return;
+        }
 
         int priority;
         __isClosed = false;
@@ -100,8 +102,9 @@ final class TelnetInputStream extends Bu
         // threads.  This should prevent scheduler induced deadlock (rather than
         // deadlock caused by a bug in this code).
         priority = Thread.currentThread().getPriority() + 1;
-        if (priority > Thread.MAX_PRIORITY)
+        if (priority > Thread.MAX_PRIORITY) {
             priority = Thread.MAX_PRIORITY;
+        }
         __thread.setPriority(priority);
         __thread.setDaemon(true);
         __thread.start();
@@ -129,12 +132,14 @@ final class TelnetInputStream extends Bu
         {
 
             // If there is no more data AND we were told not to block, just return WOULD_BLOCK (-2). (More efficient than exception.)
-            if(!mayBlock && super.available() == 0)
+            if(!mayBlock && super.available() == 0) {
                 return WOULD_BLOCK;
+            }
 
             // Otherwise, exit only when we reach end of stream.
-            if ((ch = super.read()) < 0)
+            if ((ch = super.read()) < 0) {
                 return EOF;
+            }
 
             ch = (ch & 0xff);
 
@@ -176,14 +181,15 @@ final class TelnetInputStream extends Bu
                 {
                     synchronized (__client)
                     {
-                        if (__client._requestedDont(TelnetOption.BINARY))
+                        if (__client._requestedDont(TelnetOption.BINARY)) {
                             __receiveState = _STATE_CR;
-                        else
+                        } else {
                             __receiveState = _STATE_DATA;
+                        }
                     }
-                }
-                else
+                } else {
                     __receiveState = _STATE_DATA;
+                }
                 break;
 
             case _STATE_IAC:
@@ -260,8 +266,9 @@ final class TelnetInputStream extends Bu
                     continue;
                 default:
                     // store suboption char
-                    if (__suboption_count < __suboption.length)
+                    if (__suboption_count < __suboption.length) {
                         __suboption[__suboption_count++] = ch;
+                    }
                     break;
                 }
                 __receiveState = _STATE_SB;
@@ -278,8 +285,9 @@ final class TelnetInputStream extends Bu
                     __receiveState = _STATE_DATA;
                     continue;
                 case TelnetCommand.IAC: // De-dup the duplicated IAC
-                    if (__suboption_count < __suboption.length)
+                    if (__suboption_count < __suboption.length) {
                         __suboption[__suboption_count++] = ch;
+                    }
                     break;
                 default:            // unexpected byte! ignore it
                     break;
@@ -340,8 +348,9 @@ final class TelnetInputStream extends Bu
             __queue[__queueTail] = ch;
             ++__bytesAvailable;
 
-            if (++__queueTail >= __queue.length)
+            if (++__queueTail >= __queue.length) {
                 __queueTail = 0;
+            }
         }
         return bufferWasEmpty;
     }
@@ -368,8 +377,9 @@ final class TelnetInputStream extends Bu
                 if (__bytesAvailable == 0)
                 {
                     // Return EOF if at end of file
-                    if (__hasReachedEOF)
+                    if (__hasReachedEOF) {
                         return EOF;
+                    }
 
                     // Otherwise, we have to wait for queue to get something
                     if(__threaded)
@@ -397,9 +407,11 @@ final class TelnetInputStream extends Bu
                         {
                             try
                             {
-                                if ((ch = __read(mayBlock)) < 0) // EOF or WOULD_BLOCK
-                                    if(ch != WOULD_BLOCK)
-                                        return (ch); // must be EOF
+                                if ((ch = __read(mayBlock)) < 0) { // must be EOF
+                                    if(ch != WOULD_BLOCK) {
+                                        return (ch);
+                                    }
+                                }
                             }
                             catch (InterruptedIOException e)
                             {
@@ -428,8 +440,9 @@ final class TelnetInputStream extends Bu
                             }
                             catch (InterruptedException e)
                             {
-                                if (__isClosed)
+                                if (__isClosed) {
                                     return EOF;
+                                }
                             }
 
                             // Reads should not block on subsequent iterations. Potentially, this could happen if the
@@ -450,8 +463,9 @@ final class TelnetInputStream extends Bu
 
                     ch = __queue[__queueHead];
 
-                    if (++__queueHead >= __queue.length)
+                    if (++__queueHead >= __queue.length) {
                         __queueHead = 0;
+                    }
 
                     --__bytesAvailable;
 
@@ -504,18 +518,21 @@ final class TelnetInputStream extends Bu
     {
         int ch, off;
 
-        if (length < 1)
+        if (length < 1) {
             return 0;
+        }
 
         // Critical section because run() may change __bytesAvailable
         synchronized (__queue)
         {
-            if (length > __bytesAvailable)
+            if (length > __bytesAvailable) {
                 length = __bytesAvailable;
+            }
         }
 
-        if ((ch = read()) == EOF)
+        if ((ch = read()) == EOF) {
             return EOF;
+        }
 
         off = offset;
 
@@ -588,8 +605,9 @@ _outerLoop:
             {
                 try
                 {
-                    if ((ch = __read(true)) < 0)
+                    if ((ch = __read(true)) < 0) {
                         break;
+                    }
                 }
                 catch (InterruptedIOException e)
                 {
@@ -603,8 +621,9 @@ _outerLoop:
                         }
                         catch (InterruptedException interrupted)
                         {
-                            if (__isClosed)
+                            if (__isClosed) {
                                 break _outerLoop;
+                            }
                         }
                         continue;
                     }
@@ -626,13 +645,15 @@ _outerLoop:
                 }
                 catch (InterruptedException e)
                 {
-                    if (__isClosed)
+                    if (__isClosed) {
                         break _outerLoop;
+                    }
                 }
 
                 // Notify input listener if buffer was previously empty
-                if (notify)
+                if (notify) {
                     __client.notifyInputListener();
+                }
             }
         }
         catch (IOException ioe)

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetOutputStream.java Thu Jan 12 01:51:02 2012
@@ -73,7 +73,9 @@ final class TelnetOutputStream extends O
                         }
                     } // __convertCRtoCRLF
                     else if (ch != '\n')
+                     {
                         __client._sendByte('\0'); // RFC854 requires CR NUL for bare CR
+                    }
                 }
 
                 __lastWasCR = false;
@@ -97,9 +99,9 @@ final class TelnetOutputStream extends O
             {
                 __client._sendByte(ch);
                 __client._sendByte(TelnetCommand.IAC);
-            }
-            else
+            } else {
                 __client._sendByte(ch);
+            }
         }
     }
 
@@ -133,8 +135,9 @@ final class TelnetOutputStream extends O
     {
         synchronized (__client)
         {
-            while (length-- > 0)
+            while (length-- > 0) {
                 write(buffer[offset++]);
+            }
         }
     }
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java Thu Jan 12 01:51:02 2012
@@ -150,8 +150,9 @@ public class TFTP extends DatagramSocket
 
         try
         {
-            while (true)
+            while (true) {
                 _socket_.receive(datagram);
+            }
         }
         catch (SocketException e)
         {

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java Thu Jan 12 01:51:02 2012
@@ -77,8 +77,9 @@ public final class TFTPAckPacket extends
 
         data = datagram.getData();
 
-        if (getType() != data[1])
+        if (getType() != data[1]) {
             throw new TFTPPacketException("TFTP operator code does not match type.");
+        }
 
         _blockNumber = (((data[2] & 0xff) << 8) | (data[3] & 0xff));
     }

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Thu Jan 12 01:51:02 2012
@@ -87,10 +87,11 @@ public class TFTPClient extends TFTP
      ***/
     public void setMaxTimeouts(int numTimeouts)
     {
-        if (numTimeouts < 1)
+        if (numTimeouts < 1) {
             __maxTimeouts = 1;
-        else
+        } else {
             __maxTimeouts = numTimeouts;
+        }
     }
 
     /***
@@ -135,8 +136,9 @@ public class TFTPClient extends TFTP
         dataLength = lastBlock = hostPort = bytesRead = 0;
         block = 1;
 
-        if (mode == TFTP.ASCII_MODE)
+        if (mode == TFTP.ASCII_MODE) {
             output = new FromNetASCIIOutputStream(output);
+        }
 
         sent =
             new TFTPReadRequestPacket(host, port, filename, mode);
@@ -243,8 +245,9 @@ _receivePacket:
                         {
                             discardPackets();
 
-                            if (lastBlock == (block == 0 ? 65535 : (block - 1)))
+                            if (lastBlock == (block == 0 ? 65535 : (block - 1))) {
                                 continue _sendPacket;  // Resend last acknowledgement.
+                            }
 
                             continue _receivePacket; // Start fetching packets again.
                         }
@@ -381,8 +384,9 @@ _receivePacket:
         block = 0;
         boolean lastAckWait = false;
 
-        if (mode == TFTP.ASCII_MODE)
+        if (mode == TFTP.ASCII_MODE) {
             input = new ToNetASCIIInputStream(input);
+        }
 
         sent =
             new TFTPWriteRequestPacket(host, port, filename, mode);

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java Thu Jan 12 01:51:02 2012
@@ -85,10 +85,11 @@ public final class TFTPDataPacket extend
         _data = data;
         _offset = offset;
 
-        if (length > MAX_DATA_LENGTH)
+        if (length > MAX_DATA_LENGTH) {
             _length = MAX_DATA_LENGTH;
-        else
+        } else {
             _length = length;
+        }
     }
 
     public TFTPDataPacket(InetAddress destination, int port, int blockNumber,
@@ -114,15 +115,17 @@ public final class TFTPDataPacket extend
         _data = datagram.getData();
         _offset = 4;
 
-        if (getType() != _data[1])
+        if (getType() != _data[1]) {
             throw new TFTPPacketException("TFTP operator code does not match type.");
+        }
 
         _blockNumber = (((_data[2] & 0xff) << 8) | (_data[3] & 0xff));
 
         _length = datagram.getLength() - 4;
 
-        if (_length > MAX_DATA_LENGTH)
+        if (_length > MAX_DATA_LENGTH) {
             _length = MAX_DATA_LENGTH;
+        }
     }
 
     /***
@@ -145,8 +148,9 @@ public final class TFTPDataPacket extend
         data[3] = (byte)(_blockNumber & 0xff);
 
         // Doublecheck we're not the same
-        if (data != _data)
+        if (data != _data) {
             System.arraycopy(_data, _offset, data, 4, _length);
+        }
 
         datagram.setAddress(_address);
         datagram.setPort(_port);
@@ -213,10 +217,11 @@ public final class TFTPDataPacket extend
         _offset = offset;
         _length = length;
 
-        if (length > MAX_DATA_LENGTH)
+        if (length > MAX_DATA_LENGTH) {
             _length = MAX_DATA_LENGTH;
-        else
+        } else {
             _length = length;
+        }
     }
 
     /***

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java Thu Jan 12 01:51:02 2012
@@ -112,13 +112,15 @@ public final class TFTPErrorPacket exten
         data = datagram.getData();
         length = datagram.getLength();
 
-        if (getType() != data[1])
+        if (getType() != data[1]) {
             throw new TFTPPacketException("TFTP operator code does not match type.");
+        }
 
         _error = (((data[2] & 0xff) << 8) | (data[3] & 0xff));
 
-        if (length < 5)
+        if (length < 5) {
             throw new TFTPPacketException("Bad error packet. No message.");
+        }
 
         index = 4;
         buffer = new StringBuilder();

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java Thu Jan 12 01:51:02 2012
@@ -127,9 +127,10 @@ public abstract class TFTPPacket
         byte[] data;
         TFTPPacket packet = null;
 
-        if (datagram.getLength() < MIN_PACKET_SIZE)
+        if (datagram.getLength() < MIN_PACKET_SIZE) {
             throw new TFTPPacketException(
                 "Bad packet. Datagram data length is too short.");
+        }
 
         data = datagram.getData();
 

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPRequestPacket.java Thu Jan 12 01:51:02 2012
@@ -111,8 +111,9 @@ public abstract class TFTPRequestPacket 
 
         byte[] data = datagram.getData();
 
-        if (getType() != data[1])
+        if (getType() != data[1]) {
             throw new TFTPPacketException("TFTP operator code does not match type.");
+        }
 
         StringBuilder buffer = new StringBuilder();
 
@@ -127,8 +128,9 @@ public abstract class TFTPRequestPacket 
 
         _filename = buffer.toString();
 
-        if (index >= length)
+        if (index >= length) {
             throw new TFTPPacketException("Bad filename and mode format.");
+        }
 
         buffer.setLength(0);
         ++index; // need to advance beyond the end of string marker

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/util/SubnetUtils.java Thu Jan 12 01:51:02 2012
@@ -216,9 +216,9 @@ public class SubnetUtils {
 
             /* Calculate broadcast address */
             broadcast = network | ~(netmask);
-        }
-        else
+        } else {
             throw new IllegalArgumentException("Could not parse [" + mask + "]");
+        }
     }
 
     /*
@@ -228,9 +228,9 @@ public class SubnetUtils {
         Matcher matcher = addressPattern.matcher(address);
         if (matcher.matches()) {
             return matchAddress(matcher);
-        }
-        else
+        } else {
             throw new IllegalArgumentException("Could not parse [" + address + "]");
+        }
     }
 
     /*
@@ -251,8 +251,9 @@ public class SubnetUtils {
      */
     private int[] toArray(int val) {
         int ret[] = new int[4];
-        for (int j = 3; j >= 0; --j)
+        for (int j = 3; j >= 0; --j) {
             ret[j] |= ((val >>> 8*(3-j)) & (0xff));
+        }
         return ret;
     }
 
@@ -276,8 +277,9 @@ public class SubnetUtils {
      * Returns x if it is in range, throws an exception otherwise.
      */
     private int rangeCheck(int value, int begin, int end) {
-        if (value > begin && value <= end) // (begin,end]
+        if (value > begin && value <= end) { // (begin,end]
             return value;
+        }
 
         throw new IllegalArgumentException("Value [" + value + "] not in range ("+begin+","+end+"]");
     }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/EnterpriseUnixFTPEntryParserTest.java Thu Jan 12 01:51:02 2012
@@ -101,8 +101,9 @@ public class EnterpriseUnixFTPEntryParse
         assertEquals("18128",
                      file.getGroup());
 
-        if(today.get(Calendar.MONTH) < Calendar.AUGUST)
+        if (today.get(Calendar.MONTH) < Calendar.AUGUST) {
             --year;
+        }
 
         Calendar timestamp = file.getTimestamp();
         assertEquals(year, timestamp.get(Calendar.YEAR));

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TelnetClientTest.java Thu Jan 12 01:51:02 2012
@@ -221,8 +221,9 @@ extends TestCase implements TelnetNotifi
             is2.read(buffread2);
             connect2_ok = true;
 
-            if(equalBytes(buffread2, expected2))
-                 init2_ok = true;
+            if (equalBytes(buffread2, expected2)) {
+                init2_ok = true;
+            }
         }
 
         InputStream is3 = ANSI.server.getInputStream();
@@ -346,8 +347,9 @@ extends TestCase implements TelnetNotifi
         {
             is1.read(buffread1);
 
-            if(equalBytes(buffread1, expected1))
+            if (equalBytes(buffread1, expected1)) {
                 negotiation1_ok = true;
+            }
         }
 
         InputStream is2 = OPTIONS.server.getInputStream();
@@ -361,8 +363,9 @@ extends TestCase implements TelnetNotifi
         {
             is2.read(buffread2);
 
-            if(equalBytes(buffread2, expected2))
+            if (equalBytes(buffread2, expected2)) {
                 negotiation2_ok = true;
+            }
 
             if(negotiation2_ok)
             {
@@ -374,8 +377,9 @@ extends TestCase implements TelnetNotifi
                 {
                     is2.read(buffread2b);
 
-                    if(equalBytes(buffread2b, expected2b))
+                    if (equalBytes(buffread2b, expected2b)) {
                         negotiation2_ok = true;
+                    }
                 }
             }
         }
@@ -391,8 +395,9 @@ extends TestCase implements TelnetNotifi
         {
             is3.read(buffread3);
 
-            if(equalBytes(buffread3, expected3))
+            if (equalBytes(buffread3, expected3)) {
                 negotiation3_ok = true;
+            }
 
             if(negotiation3_ok)
             {
@@ -403,8 +408,9 @@ extends TestCase implements TelnetNotifi
                 if(is3.available() == 10)
                 {
                     is3.read(buffread3b);
-                    if(equalBytes(buffread3b, expected3b))
-                            negotiation3_ok = true;
+                    if (equalBytes(buffread3b, expected3b)) {
+                        negotiation3_ok = true;
+                    }
                 }
             }
         }
@@ -474,8 +480,9 @@ extends TestCase implements TelnetNotifi
         {
             is.read(buffread);
 
-            if(equalBytes(buffread, expected))
+            if (equalBytes(buffread, expected)) {
                 negotiation1_ok = true;
+            }
 
             if(negotiation1_ok)
             {
@@ -486,8 +493,9 @@ extends TestCase implements TelnetNotifi
                 if(is.available() == 3)
                 {
                     is.read(buffread2);
-                    if(equalBytes(buffread2, expected2))
-                            negotiation1_ok = true;
+                    if (equalBytes(buffread2, expected2)) {
+                        negotiation1_ok = true;
+                    }
                 }
             }
         }
@@ -608,8 +616,9 @@ extends TestCase implements TelnetNotifi
             if(is.available() == 6)
             {
                 is.read(buffread);
-                if(equalBytes(buffread, expected))
+                if (equalBytes(buffread, expected)) {
                     remove_ok = true;
+                }
             }
         }
 
@@ -665,16 +674,18 @@ extends TestCase implements TelnetNotifi
         assertNotNull(tr);
         boolean res1 = ANSI.client.sendAYT(2000);
 
-        if(res1 == true)
+        if (res1 == true) {
             ayt_true_ok=true;
+        }
 
         Thread.sleep(1000);
         is.skip(is.available());
 
         boolean res2 = ANSI.client.sendAYT(2000);
 
-        if(res2 == false)
+        if (res2 == false) {
             ayt_false_ok=true;
+        }
 
 
         assertTrue(ayt_true_ok);
@@ -712,8 +723,9 @@ extends TestCase implements TelnetNotifi
         if(pi.available() == 5)
         {
             pi.read(buffer);
-            if(equalBytes(buffer, expected1))
+            if (equalBytes(buffer, expected1)) {
                 test1spy_ok = true;
+            }
         }
 
         ostc.write("test2".getBytes());
@@ -724,8 +736,9 @@ extends TestCase implements TelnetNotifi
         if(pi.available() == 5)
         {
             pi.read(buffer);
-            if(equalBytes(buffer, expected2))
+            if (equalBytes(buffer, expected2)) {
                 test2spy_ok = true;
+            }
         }
 
         STANDARD.client.stopSpyStream();
@@ -796,9 +809,10 @@ extends TestCase implements TelnetNotifi
                 pos+=read;
             }
 
-            if(equalBytes(buffread1, expected1))
+            if (equalBytes(buffread1, expected1)) {
                 negotiation1_ok = true;
         //}
+            }
 
 
         InputStream is2 = STANDARD.server.getInputStream();
@@ -819,9 +833,10 @@ extends TestCase implements TelnetNotifi
         //{
             is2.read(buffread1);
 
-            if(equalBytes(buffread1, expected1))
+            if (equalBytes(buffread1, expected1)) {
                 negotiation2_ok = true;
         //}
+            }
 
         assertTrue(!NOREAD.client.getReaderThread());
         assertTrue(STANDARD.client.getReaderThread());
@@ -846,8 +861,9 @@ extends TestCase implements TelnetNotifi
             for(int ii=0; ii<a1.length; ii++)
             {
 
-                if(a1[ii]!= a2[ii])
+                if (a1[ii]!= a2[ii]) {
                     result = false;
+                }
             }
             return(result);
         }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/telnet/TerminalTypeOptionHandlerTest.java Thu Jan 12 01:51:02 2012
@@ -104,8 +104,9 @@ public class TerminalTypeOptionHandlerTe
             boolean result = true;
             for(int ii=0; ii<a1.length; ii++)
             {
-                if(a1[ii]!= a2[ii])
+                if(a1[ii]!= a2[ii]) {
                     result = false;
+                }
             }
             return(result);
         }

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTCPClientTest.java Thu Jan 12 01:51:02 2012
@@ -82,8 +82,9 @@ public class TimeTCPClientTest extends T
                 time = System.currentTimeMillis();
             } finally
             {
-              if(client.isConnected())
-                client.disconnect();
+              if(client.isConnected()) {
+                  client.disconnect();
+              }
             }
 
             try
@@ -95,8 +96,9 @@ public class TimeTCPClientTest extends T
                 time2 = System.currentTimeMillis();
             } finally
             {
-              if(client.isConnected())
-                client.disconnect();
+              if(client.isConnected()) {
+                  client.disconnect();
+              }
             }
 
         } finally

Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java?rev=1230358&r1=1230357&r2=1230358&view=diff
==============================================================================
--- commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java (original)
+++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/time/TimeTestSimpleServer.java Thu Jan 12 01:51:02 2012
@@ -122,7 +122,7 @@ public class TimeTestSimpleServer implem
             {
             } finally
             {
-                if (socket != null)
+                if (socket != null) {
                     try
                     {
                         socket.close();  // force closing of the socket
@@ -130,6 +130,7 @@ public class TimeTestSimpleServer implem
                     {
                         System.err.println("close socket error: " + e);
                     }
+                }
             }
         }
     }



Mime
View raw message