This is an automated email from the ASF dual-hosted git repository.

garydgregory pushed a commit to branch pr-395
in repository https://gitbox.apache.org/repos/asf/commons-net.git

commit f1e913f012d4c66724df2f1c577d777cc6be7f78
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Jun 19 18:48:26 2026 +0000

    Fix GH PR suggestion compilation.
    
    Use ternary expression.
---
 .../java/org/apache/commons/net/ftp/FTPSClient.java     | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/main/java/org/apache/commons/net/ftp/FTPSClient.java 
b/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
index e8e8bb31..e96fb566 100644
--- a/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
+++ b/src/main/java/org/apache/commons/net/ftp/FTPSClient.java
@@ -1120,21 +1120,14 @@ public class FTPSClient extends FTPClient {
         }
     }
 
-    @Override
-    protected String resolveExtendedPassiveModeHost() {
-        if (_socket_ instanceof SSLSocket) {
-            return ((SSLSocket) _socket_).getSession().getPeerHost();
-        } else {
-            return super.resolveExtendedPassiveModeHost();
-        }
-    }
     /**
-     * Resolves the host for extended passive mode using the TLS session peer 
host,
-     * enabling TLS session reuse between the control and data connections.
+     * Resolves the host for extended passive mode using the TLS session peer 
host, enabling TLS session reuse between the control and data connections.
      *
+     * @return the passive host from the SSL session, or the default if not an 
SSL connection.
      * @since 3.14.0
-     * @return the passive host from the SSL session, or the default if not an 
SSL connection
      */
     @Override
     protected String resolveExtendedPassiveModeHost() {
-
+        return _socket_ instanceof SSLSocket ? ((SSLSocket) 
_socket_).getSession().getPeerHost() : super.resolveExtendedPassiveModeHost();
+    }
+}
\ No newline at end of file

Reply via email to