You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/05/22 15:34:53 UTC

svn commit: r1125962 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java

Author: sebb
Date: Sun May 22 13:34:53 2011
New Revision: 1125962

URL: http://svn.apache.org/viewvc?rev=1125962&view=rev
Log:
Remove redundant null check and use blocks for if statements

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPSClient.java

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=1125962&r1=1125961&r2=1125962&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 Sun May 22 13:34:53 2011
@@ -548,7 +548,7 @@ public class FTPSClient extends FTPClien
     protected Socket _openDataConnection_(int command, String arg)
             throws IOException {
         Socket socket = super._openDataConnection_(command, arg);
-        if (socket != null && socket instanceof SSLSocket) {
+        if (socket instanceof SSLSocket) {
             SSLSocket sslSocket = (SSLSocket)socket;
 
             sslSocket.setUseClientMode(isClientMode);
@@ -559,10 +559,12 @@ public class FTPSClient extends FTPClien
                 sslSocket.setNeedClientAuth(isNeedClientAuth);
                 sslSocket.setWantClientAuth(isWantClientAuth);
             }
-            if (suites != null)
+            if (suites != null) {
                 sslSocket.setEnabledCipherSuites(suites);
-            if (protocols != null)
+            }
+            if (protocols != null) {
                 sslSocket.setEnabledProtocols(protocols);
+            }
             sslSocket.startHandshake();
         }