You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/11/07 16:20:46 UTC
[commons-net] 06/09: Simplify nesting
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-net.git
commit d630068e6ce38ccefe3a3e60369d4701cd1a3bb0
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Nov 7 11:04:44 2022 -0500
Simplify nesting
---
src/main/java/org/apache/commons/net/ftp/FTPClient.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/commons/net/ftp/FTPClient.java b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
index 99c71455..f5081fb3 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPClient.java
@@ -851,13 +851,10 @@ public class FTPClient extends FTP implements Configurable {
throw new MalformedServerReplyException("Could not parse passive host information.\nServer Reply: " + reply);
}
}
+ } else if (_socket_ == null) {
+ pasvHost = null; // For unit testing.
} else {
- // Post-3.8 behavior
- if (_socket_ == null) {
- pasvHost = null; // For unit testing.
- } else {
- pasvHost = _socket_.getInetAddress().getHostAddress();
- }
+ pasvHost = _socket_.getInetAddress().getHostAddress();
}
this.passiveHost = pasvHost;
this.passivePort = pasvPort;